下面是ifconfig的输出情况
最开始,看不到usb0 (usb转network的接口)
#ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:AB:2E:69:77
inet addr:192.168.201.77 Bcast:192.168.201.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10937 errors:0 dropped:0 overruns:0 frame:71
TX packets:7593 errors:0 dropped:0 overruns:0 carrier:0
collisions:147 txqueuelen:100
RX bytes:6100408 (5.8 Mb) TX bytes:1230681 (1.1 Mb)
Interrupt:11 Base address:0xc000
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:2252 errors:0 dropped:0 overruns:0 frame:0
TX packets:2252 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1012062 (988.3 Kb) TX bytes:1012062 (988.3 Kb)
但是,可以通过下面的命令,看到usb0
#ifconfig usb0
usb0 Link encap:Ethernet HWaddr 80:5A:40:39:5E:18
BROADCAST 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:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
也可以绑定ip,而且也可以自己ping 自己
#ifconfig usb0 192.168.201.55
bash-2.05a# ifconfig usb0
usb0 Link encap:Ethernet HWaddr 80:5A:40:39:5E:18
inet addr:192.168.201.55 Bcast:192.168.201.255 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:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
#ping -c 3 192.168.201.55
PING 192.168.201.55 (192.168.201.55) from 192.168.201.55 : 56(84) bytes of data.64 bytes from 192.168.201.55: icmp_seq=1 ttl=255 time=0.147 ms
64 bytes from 192.168.201.55: icmp_seq=2 ttl=255 time=0.074 ms
64 bytes from 192.168.201.55: icmp_seq=3 ttl=255 time=0.078 ms
--- 192.168.201.55 ping statistics ---
3 packets transmitted, 3 received, 0% loss, time 2016ms
rtt min/avg/max/mdev = 0.074/0.099/0.147/0.035 ms
这个时候,就可以看usb0了
ifconfig
eth0 Link encap:Ethernet HWaddr 52:54:AB:2E:69:77
inet addr:192.168.201.77 Bcast:192.168.201.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11151 errors:0 dropped:0 overruns:0 frame:71
TX packets:7625 errors:0 dropped:0 overruns:0 carrier:0
collisions:147 txqueuelen:100
RX bytes:6127293 (5.8 Mb) TX bytes:1233399 (1.1 Mb)
Interrupt:11 Base address:0xc000
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:2279 errors:0 dropped:0 overruns:0 frame:0
TX packets:2279 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1014414 (990.6 Kb) TX bytes:1014414 (990.6 Kb)
usb0 Link encap:Ethernet HWaddr 80:5A:40:39:5E:18
inet addr:192.168.201.55 Bcast:192.168.201.255 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:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
现在想用usb0接口ping它所相连的另一台机子,就ping 不通,这个是什么原因呢?!