Network is unreachable after reboot
This is the output of ifconfig on my Yocto embedded Linux board (I am using eth0.2 interface):
eth0 Link encap:Ethernet HWaddr f8:dc:7a:3b:e9:f8
inet6 addr: fe80::fadc:7aff:fe3b:e9f8/64 Scope:Link
inet6 addr: 2001:b07:5d28:764:fadc:7aff:fe3b:e9f8/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10164 errors:14 dropped:2 overruns:0 frame:14
TX packets:12576 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2661192 (2.5 MiB) TX bytes:6310390 (6.0 MiB)
eth0.2 Link encap:Ethernet HWaddr f8:dc:7a:3b:e9:f8
inet addr:192.168.1.65 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::fadc:7aff:fe3b:e9f8/64 Scope:Link
inet6 addr: 2001:b07:5d28:764:fadc:7aff:fe3b:e9f8/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10148 errors:0 dropped:416 overruns:0 frame:0
TX packets:11622 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2415854 (2.3 MiB) TX bytes:6199551 (5.9 MiB)
However, this is the output I get after a reboot command:
eth0 Link encap:Ethernet HWaddr f8:dc:7a:3b:e9:f8
inet6 addr: fe80::fadc:7aff:fe3b:e9f8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8836 errors:22 dropped:0 overruns:0 frame:22
TX packets:10417 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2404061 (2.2 MiB) TX bytes:4115640 (3.9 MiB)
eth0.2 Link encap:Ethernet HWaddr f8:dc:7a:3b:e9:f8
inet addr:192.168.1.65 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::fadc:7aff:fe3b:e9f8/64 Scope:Link
inet6 addr: 2001:b07:5d28:764:fadc:7aff:fe3b:e9f8/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8836 errors:0 dropped:326 overruns:0 frame:0
TX packets:9648 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2191997 (2.0 MiB) TX bytes:4018664 (3.8 MiB)
The only difference I can see, it that the “Scope:Global” entry in eth0 is missing after a software reboot. When this occurs, pinging e.g.: 1.1.1.1 gives me “Network is unreachable“, though I can still reach the board locally through 192.168.1.65.
The only way to get everything back to normal is to unplug the power supply and then plug it back. It seems to me like the network interface is not restarted when I issue a reboot command (the LEDs on the Ethernet interfaces do not turn off).
How can I solve this? Please tell me if you need any more details.