0

I am practising for LFCS. I have two virtual machines, ubuntu 18.04 both. On machine1, when i run traceroute 8.8.8.8 I have a normal output. When on machine1 I run

 sudo ip route add 8.8.0.0/16 proto static metric 10 via inet if-of-machine2 dev ens3

then the traceroute stops at the first hop as follows

traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  machine2  0.439 ms  0.380 ms  0.359 ms
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
.....

and never completes. On machine2, traceroute 8.8.8.8 is absolutely successful. Also I set

sysctl net.ipv4.ip_forward=1

I flushed iptables and i made sure all policies are set to ACCEPT. ufw is disabled.

What am i missing? Why is traceroute not going further my first hop on machine1?

Vasiliki
  • 143
  • 1
  • 8

1 Answers1

0

Troubleshooting

  • Check the routes on the machine2 with command ip route get 8.8.8.8 from <ip-machine1> iif <iface>. It should return a valid route.
  • Check outgoing packets with the tcpdump.
  • Likely you need the SNAT/MASQUERADE rule, otherwise all next hops should know route to source.
Anton Danilov
  • 4,874
  • 2
  • 11
  • 20
  • $ ip route get 8.8.8.8 from machine1 iif ens3 outputs 8.8.8.8 from machine1 via 192.168.123.1 dev ens3 cache iif ens3 – Vasiliki Jul 05 '19 at 12:10
  • tcpdump outputs 13:11:38.460907 STP 802.1d, Config, Flags [none], bridge-id 8000.52:54:00:d5:bb:17.8003, length 35 – Vasiliki Jul 05 '19 at 12:12
  • Hm.. It's a strange, because you have a redirect. Draw your topology. – Anton Danilov Jul 05 '19 at 12:31
  • What do you mean, _Draw your topology_? You mean network diagram? I am afraid this is a bit too advanced for my level of knowledge but I will try. – Vasiliki Jul 05 '19 at 14:04