我是网络新手。我正在尝试通过以太网将嵌入式 Linux 连接到我的 Ubuntu 12.04.3 LTS。
我已将嵌入式系统配置为使用静态 IP 地址 (192.168.9.119)。
我在我的 Ubuntu 上添加了一个 eth1 接口,并将静态 IP 设置为 192.168.9.118。
嵌入式 Linux 通过以太网直接连接到我的 eth1,但是不起作用。
我的 ifconfig:
eth0 Link encap:Ethernet HWaddr 00:25:64:f8:7a:7a
inet addr:192.168.200.58 Bcast:192.168.200.255 Mask:255.255.255.0
inet6 addr: fe80::225:64ff:fef8:7a7a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:339694 errors:0 dropped:0 overruns:0 frame:0
TX packets:122045 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:81556483 (81.5 MB) TX bytes:92889268 (92.8 MB)
eth1 Link encap:Ethernet HWaddr 00:50:ba:51:d2:9e
inet addr:192.168.9.118 Bcast:192.168.9.255 Mask:255.255.255.0
inet6 addr: fe80::250:baff:fe51:d29e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:66 dropped:0 overruns:0 carrier:132
collisions:1122 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:4068 (4.0 KB)
Interrupt:22 Base address:0xec00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:82 errors:0 dropped:0 overruns:0 frame:0
TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6696 (6.6 KB) TX bytes:6696 (6.6 KB)
嵌入式设备上的 ifconfig(不关心 eth0):
eth0 Link encap:Ethernet HWaddr 00:50:C2:D5:D3:3D
inet addr:192.168.6.118 Bcast:192.168.6.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1974 (1.9 KiB) TX bytes:2624 (2.5 KiB)
Interrupt:13 Base address:0xc000
eth1 Link encap:Ethernet HWaddr 00:50:C2:D5:D3:3E
inet addr:192.168.9.119 Bcast:192.168.9.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:97 errors:0 dropped:0 overruns:0 frame:0
TX packets:71 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10905 (10.6 KiB) TX bytes:7773 (7.5 KiB)
Interrupt:13
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
SSH 错误消息(我认为它对你没用但我还是放了它):
ssh: connect to host 192.168.9.119 port 22: No route to host
你知道哪里出了问题吗?谢谢
编辑:这是正常的吗?
user@linux:~$ ethtool eth1
Settings for eth1:
Cannot get wake-on-lan settings: Operation not permitted
No data available
route -n(在嵌入式设备上):
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.9.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 192.168.6.1 0.0.0.0 UG 0 0 0 eth0
现在,在 Ubuntu 上执行 arp -n 和 route -n :
user@linux:~$ arp -n
Address HWtype HWaddress Flags Mask Iface
192.168.200.120 ether b8:ac:6f:b5:90:61 C eth0
user@linux:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.200.1 0.0.0.0 UG 100 0 0 eth0
192.168.9.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
答案1
你自己布线吗?看起来你遇到了布线问题eth1
collisions:1122