2

My sincere apologies if I was wrong In that, I published the question but found nothing similar.

I received an exercise in the course in VMware Workstation at I am doing where I was required to perform the following actions Set up two ubuntu server 16.04 virtual machines VM1 VM2 Machine VM1 should do the following: Access a web site where stock exchange stocks are broadcast - download the latest information into a file - CSV/ excel - every five minutes limitation each machine need the have a unique network segment in this case I picked VM1 -192.168.3.0/24 and the static IP of 192.168.3.254 VM2 -192.168.2.0/24 and the static IP of 192.168.2.254 From what I understand the only way the two can talk is put a third machine (which I named Jack - also ubuntu server 16.04) and gave Jack two network adapters 1. 192.168.2.222/24 which respond to ping from VM2 2. 192.168.3.222/24 which respond to ping from VM1

can someone help by explaining what steps I need to do in order I can ping from VM2 to Jack network interface 2 and afterwards to VM 192.168.3.254? of course the ping needs to return back to VM 2

1 Answer 1

0

Enable forwarding

First activate the IPv4 forwarding in your "Jack" server.

To enable it on the fly you can use :

echo 1 > /proc/sys/net/ipv4/ip_forward

To enable it permantly, edit the file /etc/sysctl.confand uncomment the line with net.ipv4.ip_forward = 1. Then reload the conf : sysctl -p /etc/sysctl.conf.

Define default gateway

After, you have to define the "Jack" device as the default gateway in your two VM.

To perform that you can edit directly the file /etc/network/interfaces.

Example :

auto eth0
iface eth0 inet static
        address 192.168.3.254 # VM 1
        netmask 255.255.255.0
        gateway 192.168.3.222 # Interface of jack in the sub net of VM1

You can add a default route on the fly with the command ip route (with this command you can, if you want, only specify the route for the subnet of each VM).

sudo ip route add default gw 192.168.3.222 eth0

Debug/Confirm

You can check your IP address with the command ip address. Ensure that your IP is correctly defined.

You can check your route with the command ip route. Ensure that the default route for both of your VM is the "Jack" IP.

Then, ping from each VM to their Gateway (Jack). And finally ping each VM. Done.

If this does not work, check the Firewall and edit it if required :

sudo iptables -L

Hope this answer help and sorry for my english.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .