This is for "research" not pragmatic purposes -- I want to know how this is supposed to work, since my guess below does not. In other words, I do not want an answer that involves
/etc/network/interfaces or anything else distro specific, or NetworkManager.
Please do not close this as a duplicate of a question which provides such answers.
I'm trying to connect two GNU/Linux systems w/ a regular (not cross-over) ethernet cable. Rumor has it that this should not be a problem now-a-days.
What I tried to do is add a private IP for the interface on both machines:
ip addr add 10.0.0.1 dev eth0
10.0.0.2 on the other machine. Neither one is attached to a network that could be identified this way.
I then added routes back and forth:
ip route add 10.0.0.2 via 10.0.0.1
And vice versa. Subsequently, the output of
ip addr and
ip route seems to be correct (see below). As per John's comment, I also tried this without adding any route; in this case the ping simply times out.
Both machines have iptables wide open; INPUT, OUTPUT, and FORWARD are ACCEPT with no rules.
But this is what happens when I try a ping:
> ping 10.0.0.2 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data. From 10.0.0.1 icmp_seq=1 Destination Host Unreachable From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
Notice it's the local interface (10.0.0.1) that returns this.
What additional steps are needed here and/or where have I gone wrong?
The routing table after using
ip route ... looks like:
default via 192.168.0.1 dev wlan0 10.0.0.2 via 10.0.0.1 dev eth0 192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.19
ip route ..., it looks the same but without line 2.
Output from ethtool (both NICs are identical hardware) looks like:
ethtool eth0 Settings for eth0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Advertised pause frame use: Symmetric Receive-only Advertised auto-negotiation: Yes Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Link partner advertised pause frame use: Symmetric Receive-only Link partner advertised auto-negotiation: Yes Speed: 100Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: internal Auto-negotiation: on Supports Wake-on: pumbag Wake-on: d Current message level: 0x00000007 (7) drv probe link Link detected: yes
The output from
ip a for the ethernet NIC looks like:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether b8:27:eb:f5:4f:7a brd ff:ff:ff:ff:ff:ff inet 10.0.0.2/32 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::ba27:ebff:fef5:4f7a/64 scope link valid_lft forever preferred_lft forever