2012-10-23 10 views
0

我有一个带有千兆以太网的arm平台,我想连接到我的ubuntu机器 来测试以太网端口。通过交换机通过以太网将嵌入式系统连接到主机

网络不是我的强项。

我修改的/ etc /网络/正是如此嵌入式系统的接口(通过网络连接窗口)

# 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 

我也在我的Ubuntu机器上:

IP: 192.168.1.1 
netmask: 255.255.255.0 
gateway: 192.168.1.0 

当我测试连接时,手臂系统上无法识别连接。

eth0的端口产生这样的输出:

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

使用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) 

任何人都可以指出我的最有可能的明显错误? 让我知道我是否需要提供更多信息。

编辑:我在嵌入式系统上运行busybox 1.18.5。

编辑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 
+1

你能提供“路线”的输出?添加了 – imreal

+0

。网关是空的...... hmm –

+1

星号表示它直接连接(没有跳数),但它没有默认路由,你如何测试连接?交换机上的接口的ip是192.168.1.0? – imreal

回答

1

这是不好的

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是您的网络地址。当然,它不能成为你的门户。通常你因此像这样的

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 

其中后两个可以自动从地址和子网掩码计算和配置都没有写在配置文件中

相关问题