How to configure route so ping will go from one machine to another

Clash Royale CLAN TAG#URR8PPP up vote
2
down vote
favorite
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
networking routing
add a comment |Â
up vote
2
down vote
favorite
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
networking routing
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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
networking routing
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
networking routing
edited Apr 20 at 2:42
muru
129k19272462
129k19272462
asked Apr 20 at 2:39
Yoda
111
111
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
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.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
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.
add a comment |Â
up vote
0
down vote
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.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
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.
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.
edited Apr 20 at 17:28
answered Apr 20 at 7:56
Eraseth
1299
1299
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026567%2fhow-to-configure-route-so-ping-will-go-from-one-machine-to-another%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password