scottgus1 wrote:That is the usual use of a gateway. However, the "gateway" is merely the passage from a private network behind a NAT router to the public network on the other side. On the private side, a computer could access network services anywhere in the private network's IP addresses, and through the "gateway" it can access the services on the public side.
Thanks.
On two VMs, I did:
Code: Select all
$ sudo nmcli connection modify "UUID" IPv4.address 192.168.100.X
$ sudo nmcli connection modify "UUID" IPv4.method manual
$ sudo nmcli connection down "UUID"
$ sudo nmcli connection up "UUID"
Then opened /etc/hosts file on all VMs and put the IP addresses and host names of each VMs inside it:
Code: Select all
192.168.100.1 node1.localhost.localdomain node1
192.168.100.2 node2.localhost.localdomain node2
...
Then:
Code: Select all
# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.100.1 netmask 255.255.255.255 broadcast 0.0.0.0
inet6 fe80::a00:27ff:fef5:e155 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:f5:e1:55 txqueuelen 1000 (Ethernet)
RX packets 22 bytes 3360 (3.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 32 bytes 4232 (4.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.3.15 netmask 255.255.255.0 broadcast 10.0.3.255
inet6 fe80::a00:27ff:fe35:92d2 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:35:92:d2 txqueuelen 1000 (Ethernet)
RX packets 1689 bytes 558532 (545.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1426 bytes 141975 (138.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 21 bytes 2435 (2.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 21 bytes 2435 (2.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
And:
Code: Select all
# 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. Need I any DNS or Gateway address?