简体   繁体   English

通过交换机通过以太网将嵌入式系统连接到主机

[英]Connect embedded system to host via ethernet over a switch

I have a arm platform with gigabit ethernet that I would like to connect to my ubuntu machine to test the ethernet ports. 我有一个带千兆位以太网的arm平台,我想连接到我的ubuntu机器上以测试以太网端口。

Networking is not my strong suit. 网络并不是我的强项。

I've modified /etc/network/interfaces on the embedded system thusly: 我因此在嵌入式系统上修改了/ etc / network / interfaces:

# Configure Loopback
auto lo
iface lo inet loopback

#auto eth0
#iface eth0 inet dhcp

auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.0

And on my ubuntu machine I have set (through the network connections window): 在我的ubuntu机器上,我已经设置了(通过网络连接窗口):

IP: 192.168.1.1
netmask: 255.255.255.0
gateway: 192.168.1.0

When I test the connection, no connection is recognized on the arm system. 当我测试连接时,手臂系统上没有识别到​​连接。

The eth0 port produces this output: eth0端口产生以下输出:

eth0: link up, 10 Mb/s, half duplex, flow control disabled        
ip: RTNETLINK answers: Invalid argument 

ifconfig displays: ifconfig显示:

# ifconfig                                                                                             
eth0      Link encap:Ethernet  HWaddr 02:50:43:C5:C5:75                                                
          inet addr:192.168.1.2  Bcast:0.0.0.0  Mask:255.255.255.0                                     
          UP BROADCAST RUNNING MULTICAST  MTU:1500  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:1000                                                                 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)                                                       
          Interrupt:11                                                                                 

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)   

Can anyone point out my most likely obvious mistake? 谁能指出我最可能的明显错误? Let me know if I need to provide more information. 让我知道是否需要提供更多信息。

EDIT: I'm running busybox 1.18.5 on the embedded system. 编辑:我正在嵌入式系统上运行busybox 1.18.5。

EDIT 2: 编辑2:

# route                                                                                                
Kernel IP routing table                                                                                
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface                          
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0  

This is bad 这不好

auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.0

192.168.1.0 is your network address. 192.168.1.0是您的网络地址。 For sure it cannot be your gateway. 当然,它不能成为您的网关。 Usually you have configuration like this 通常你有这样的配置

auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255

where the latter two can automatically be calculated from the address and the netmask and are therefore not written in the config file 其中后两个可以根据地址和网络掩码自动计算,因此不会写入配置文件中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM