2
I have 2 Ubuntu machines, connected via Ethernet cable, machine A at interface eth0 and machine B at eth6. I have configured IP on both machine.
ifconfig -a on machine A (showing for eth0 only):
eth0 Link encap:Ethernet HWaddr 98:90:96:9b:83:f1
inet addr:100.0.2.1 Bcast:100.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::9a90:96ff:fe9b:83f1/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:372 errors:0 dropped:0 overruns:0 frame:0
TX packets:280 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:101005 (101.0 KB) TX bytes:30148 (30.1 KB)
Interrupt:20 Memory:f7c00000-f7c20000
route -n on Machine A:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 203.135.63.1 0.0.0.0 UG 0 0 0 eth3
100.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth3
203.135.63.0 0.0.0.0 255.255.255.192 U 1 0 0 eth3
ifconfig -a on Machine B (Showing for eth6 only)
eth6 Link encap:Ethernet HWaddr ec:08:6b:0b:85:72
inet addr:100.0.2.3 Bcast:100.0.2.225 Mask:255.255.255.0
inet6 addr: fe80::ee08:6bff:fe0b:8572/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:90 (90.0 B)
route -n on machine B:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.102.72.1 0.0.0.0 UG 0 0 0 eth7
10.102.72.0 0.0.0.0 255.255.254.0 U 1 0 0 eth7
100.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth0
100.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth6
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
When I ping 100.0.2.1 from machine B, I get this:
PING 100.0.2.1 (100.0.2.1) 56(84) bytes of data.
From 100.0.2.3 icmp_seq=1 Destination Host Unreachable
From 100.0.2.3 icmp_seq=2 Destination Host Unreachable
From 100.0.2.3 icmp_seq=3 Destination Host Unreachable
From 100.0.2.3 icmp_seq=4 Destination Host Unreachable
From 100.0.2.3 icmp_seq=5 Destination Host Unreachable
From 100.0.2.3 icmp_seq=6 Destination Host Unreachable
From 100.0.2.3 icmp_seq=7 Destination Host Unreachable
From 100.0.2.3 icmp_seq=8 Destination Host Unreachable
From 100.0.2.3 icmp_seq=9 Destination Host Unreachable
^C
--- 100.0.2.1 ping statistics ---
11 packets transmitted, 0 received, +9 errors, 100% packet loss, time 10054ms
pipe 3
Please let me know what I am doing wrong.
1Why are you using
100.0.0.0/8
for your internal network? You're squatting on Verizon's IP space, as well as Sprint's, Amazon EC2's, T-Mobile's, &c… The only reserved "private use" space in that region is actually100.64.0.0/10
with netmask255.192.0.0
. That is of course, unless you meant10.0.0.0/8
(one zero). – user1686 – 2018-09-19T08:51:54.487You should be using a crossover Ethernet cable. Are you?
– harrymc – 2018-09-19T09:39:04.2433
@harrymc: Should you? Crossover cables are generally a thing of the past now.
– user1686 – 2018-09-19T10:00:29.0071The first thing that stands out are the overlapping routes on machine B (100.../8 on eth0), on top of eth0 having a link-local address. You didn't say what's behind eth0 there, but remove this route, and see if the ping then works. Also use
ip route get 100.0.2.1
on B to test if routing is correct. And while you are at it, change the `100...IP range to a proper private IP range, e.g.
10.../8and
10.0.2./24`, as the other comment said. – dirkt – 2018-09-19T10:07:52.457Investigating with
ip route get
is a good idea, but generally routes are longest-prefix-match so it would be very curious if that were the problem. (Indeed most computers have 2–3 overlapping routes anyway.) – user1686 – 2018-09-19T10:52:04.193