ifconfig eth0 eth0: error fetching interface information: Device not found

露珠在BT5虚拟机中使用ifconfig后发现只有lo网卡,其他网卡都没有显示。

如下:

root@bt:~# ifconfig

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:16436  Metric:1
          RX packets:54 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:12741 (12.7 KB)  TX bytes:12741 (12.7 KB)

这时用ifconfig -a命令查看有多少网卡。这下就看到了eth3


root@bt:~# ifconfig -a
eth3      Link encap:Ethernet  HWaddr 00:0c:29:ac:3c:2a  
          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:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:19 Base address:0x2000 




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:16436  Metric:1
          RX packets:66 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:16565 (16.5 KB)  TX bytes:16565 (16.5 KB)


然后直接给eth3设置ip和子网掩码。


root@bt:~# ifconfig eth3 10.10.10.128 netmask 255.255.255.0

设置成功,再看一下网卡:

root@bt:~# ifconfig -a
eth3      Link encap:Ethernet  HWaddr 00:0c:29:ac:3c:2a                                                //有了,哈哈!
          inet addr:10.10.10.128  Bcast:10.10.10.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feac:3c2a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:238 (238.0 B)
          Interrupt:19 Base address:0x2000 




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:16436  Metric:1
          RX packets:85 errors:0 dropped:0 overruns:0 frame:0
          TX packets:85 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:22421 (22.4 KB)  TX bytes:22421 (22.4 KB)


ping一下……

root@bt:~# ping 10.10.10.130
PING 10.10.10.130 (10.10.10.130) 56(84) bytes of data.
64 bytes from 10.10.10.130: icmp_seq=1 ttl=128 time=0.583 ms
64 bytes from 10.10.10.130: icmp_seq=2 ttl=128 time=0.278 ms
64 bytes from 10.10.10.130: icmp_seq=3 ttl=128 time=0.662 ms
^C
--- 10.10.10.130 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.278/0.507/0.662/0.167 ms

root@bt:~# 

问题解决!


  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值