0

Host: centos6 with ip 10.10.11.36 and gateway 10.10.11.33

Guest two vms with ip 10.10.11.60 and 10.10.11.57 and gateway of that of host ie 10.10.11.36

On host packet forwarding is enabled.

from guests:

route

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.10.11.36     0.0.0.0         UG    0      0        0 eth0
10.10.11.0      *               255.255.255.0   U     0      0        0 eth0

Question1: When google.com is pinged from guest why it shows redirect host

PING google.com (173.194.36.7) 56(84) bytes of data.

64 bytes from bom04s01-in-f7.1e100.net (173.194.36.7): icmp_req=1 ttl=58 time=15.5 ms

**From 10.10.11.36: icmp_seq=2 Redirect Host(New nexthop: 10.10.11.33)**

64 bytes from bom04s01-in-f7.1e100.net (173.194.36.7): icmp_req=2 ttl=58 time=11.7 ms

Question2 Why Guests are not sending packets through its gateway instead through host's gateway ie 10.10.11.33.

deleted arp cache from guest and pinged 8.8.8.8

after that when arp cache was checked mac address of its gateway is not updated

arp -a

? (10.10.11.33) at 00:02:b6:42:7c:b5 [ether] on eth0
? (10.10.11.36) at <incomplete> on eth0

if packets go through 10.10.11.36 then why mac address of it didnt get updated.

even tracerout confirmed it

traceroute 8.8.8.8

traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets

1  10.10.11.33 (10.10.11.33)  0.286 ms  0.272 ms  0.264 ms
Kevin Parker
  • 757
  • 1
  • 13
  • 32

1 Answers1

0

You can't set the gateways like that. If all the machines are on the same network (physical and virtual networks are bridged) then use 10.10.11.33 as a gateway for VMs, if they are on separate networks (for example using NAT) then VMs and Host should be on completely different subnetworks.

Gateway is for exiting the network!

You get redirected because you can exit the network only once and that is through your 10.10.11.33. 10.10.11.36 (your host) is actually a node on the network and not a gateway

Alex
  • 516
  • 1
  • 7
  • 18
  • i am trying to do NATing,for that i guess its hsould be done on Gateway machine to avoid SNAT each,in this case how can i do that. – Kevin Parker Jul 17 '13 at 09:39