Hello,
I want to create an internal network for three Fedora Server virtual machines in the VirtualBox. I selected “Internal Network” in the “Network” section for each virtual machine. I want all three virtual machines can see each other. What should be the IP value in below commands for VM1 to VM3?
10.0.0.10 .20 .30 for the VM’s
10.0.0.1 the gateway or let it empty if you don’t want to make a router vm.
1.0.0.1 the DNS if you have access to the internet.
If you just want to resolve the subnet you could make it in the host file of one of this 3 VM’s and use it as DNS.
Now it comes the best … if you want to ping / traceroute you just can use:
ping 10.10
ping 10.1
ping 1.1
Thank you.
Thus, a gateway is not mandatory for my VMs? I guess the gateway is needed when I have a DHCP server and the gateway is the IP address of my DHCP server. AM I right?
Servers normally use a static IP-Address (Fix IP). There is no need for DHCP (Dinamic IP).
As you said you want all servers in the sub net of 192.168.10.x/24 you have .1 to .254 addresses who are communicating within this sub net. .0 is the address of the network and .255 is the broadcast address.
If your DHCP server is a router who is used to connect to the internet, yes then you can use the ip as a default gateway. Just if your router is in an other sub net like 192.168.11.x/24 you have to create a route between this two networks.
Anyway, if this environment is build up on your working place, you better talk with your network department
you can put this in lets say in the webserver’s /etc/hosts file. Now you can use it as a DNS like 192.168.10.10 to resolve within your virtualbox images.
If I’m not wrong you should be able just to add the computers and servers from the network 192.168.10.0/24 to one hostfile (from the webserver {in my example}) and a name resolution should be possible.
If all your computers have the avahi-daemon.service - Avahi mDNS/DNS-SD Stack active, you can also skip the DNS part. Avahi resolves over the hostname you give while installing fedora.
Thank you.
What is the main usage of “/etc/hosts” file? When I put the host names and IP addresses of each VM inside of this file on all VMs, then they can see each other.
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.3.2 0.0.0.0 UG 101 0 0 enp0s8
10.0.3.0 0.0.0.0 255.255.255.0 U 101 0 0 enp0s8
But VMs can see each other? I never defined any “Gateway” and “DNS”. As I said, in the VirtualBox, I selected “Internal Network” in the “Network” section for each virtual machine.