Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gateway Config

Gateway IP (192.168.10.1) is NOT specified

Host 1

root@host1:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
10.0.2.0        *               255.255.255.0   U     0      0        0 eth0
192.168.10.0    *               255.255.255.0   U     0      0        0 eth1
192.168.20.0    *               255.255.255.0   U     0      0        0 eth1

root@host1:~# ping 192.168.20.20
PING 192.168.20.20 (192.168.20.20) 56(84) bytes of data.
From 192.168.10.10 icmp_seq=1 Destination Host Unreachable
From 192.168.10.10 icmp_seq=2 Destination Host Unreachable
From 192.168.10.10 icmp_seq=3 Destination Host Unreachable
From 192.168.10.10 icmp_seq=4 Destination Host Unreachable
From 192.168.10.10 icmp_seq=5 Destination Host Unreachable
From 192.168.10.10 icmp_seq=6 Destination Host Unreachable
^C
--- 192.168.20.20 ping statistics ---
7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6019ms
pipe 3

Host 2

NOTE: tcpdump started before ping was issued in host 1

root@host2:~# tcpdump -n -i eth1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
22:46:45.338178 ARP, Request who-has 192.168.20.20 tell 192.168.10.10, length 46
22:46:46.337945 ARP, Request who-has 192.168.20.20 tell 192.168.10.10, length 46
22:46:47.338237 ARP, Request who-has 192.168.20.20 tell 192.168.10.10, length 46
22:46:48.341552 ARP, Request who-has 192.168.20.20 tell 192.168.10.10, length 46
22:46:49.337374 ARP, Request who-has 192.168.20.20 tell 192.168.10.10, length 46
22:46:50.338895 ARP, Request who-has 192.168.20.20 tell 192.168.10.10, length 46
22:46:51.356868 ARP, Request who-has 192.168.20.20 tell 192.168.10.10, length 46
22:46:52.357944 ARP, Request who-has 192.168.20.20 tell 192.168.10.10, length 46
22:46:53.358751 ARP, Request who-has 192.168.20.20 tell 192.168.10.10, length 46

Gateway IP (192.168.10.1) is specified

Host 1

root@host1:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.2.2        0.0.0.0         UG    0      0        0 eth0
10.0.2.0        *               255.255.255.0   U     0      0        0 eth0
192.168.10.0    *               255.255.255.0   U     0      0        0 eth1
192.168.20.0    192.168.10.1    255.255.255.0   UG    0      0        0 eth1

root@host1:~# ping 192.168.20.20
PING 192.168.20.20 (192.168.20.20) 56(84) bytes of data.
^C
--- 192.168.20.20 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5026ms

Host 2

NOTE: tcpdump started before ping was issued in host 1

root@host2:~# tcpdump -n -i eth1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
22:40:42.297004 IP 192.168.10.10 > 192.168.20.20: ICMP echo request, id 3372, seq 1, length 64
22:40:43.305269 IP 192.168.10.10 > 192.168.20.20: ICMP echo request, id 3372, seq 2, length 64
22:40:44.313704 IP 192.168.10.10 > 192.168.20.20: ICMP echo request, id 3372, seq 3, length 64
22:40:45.322191 IP 192.168.10.10 > 192.168.20.20: ICMP echo request, id 3372, seq 4, length 64
22:40:46.322609 IP 192.168.10.10 > 192.168.20.20: ICMP echo request, id 3372, seq 5, length 64
22:40:47.306915 ARP, Request who-has 192.168.10.1 tell 192.168.10.10, length 46
22:40:47.306963 ARP, Reply 192.168.10.1 is-at 08:00:27:be:b2:2f, length 28
22:40:47.322725 IP 192.168.10.10 > 192.168.20.20: ICMP echo request, id 3372, seq 6, length 64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.