ubuntu server 14 双网卡问题

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
回复
beingjoey
帖子: 11
注册时间: 2016-01-26 16:57

ubuntu server 14 双网卡问题

#1

帖子 beingjoey »

各位,
我在一台双网卡工控机上装了Ubuntu server,断电开机之后,ifconfig -a只能看到一个网口。lshw -class network 发现第二个网口没有logic name。如下:
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:03:00.0
logical name: p1p1
version: 06
serial: 00:0b:ab:a8:9e:94
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 ip=192.168.100.201 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
resources: irq:89 ioport:d000(size=256) memory:90604000-90604fff memory:90600000-90603fff
*-network UNCLAIMED
description: Ethernet controller
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:04:00.0
version: 06
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd cap_list
configuration: latency=0
resources: ioport:2000(size=256)

热重启之后,双网卡就都能使用了。请问是为什么?
这几天一直在研究这个问题。查看了Ubuntu 的官方文档,说是要修改/etc/udev/rules.d/70-persistent-net.rules文件,但是我发现我的系统里根本没有这个文件。又查出说是/lib/udev/write_net_rules 生成的文件。所以直接运行write_net_rules,又报missing $INTERFACE。

始终搞不懂Ubuntu是怎么设置网络的,请大神答疑解惑。
beingjoey
帖子: 11
注册时间: 2016-01-26 16:57

Re: ubuntu server 14 双网卡问题

#2

帖子 beingjoey »

忘了说版本
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: ubuntu server 14 双网卡问题

#3

帖子 poloshiao »

lshw -class network
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
*-network UNCLAIMED
description: Ethernet controller
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
热重启之后,双网卡就都能使用了。请问是为什么?
再次
sudo lshw -class network
看看 能夠使用的情況
兩個網卡的
physical id: 0
physical id: 0
是否還一樣
還是不一樣了
beingjoey
帖子: 11
注册时间: 2016-01-26 16:57

Re: ubuntu server 14 双网卡问题

#4

帖子 beingjoey »

poloshiao 写了:
lshw -class network
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
*-network UNCLAIMED
description: Ethernet controller
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
热重启之后,双网卡就都能使用了。请问是为什么?
再次
sudo lshw -class network
看看 能夠使用的情況
兩個網卡的
physical id: 0
physical id: 0
是否還一樣
還是不一樣了
还是一样:
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:03:00.0
logical name: p1p1
version: 06
serial: 00:0b:ab:a8:9e:94
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.040.00-NAPI duplex=half ip=192.168.100.201 latency=0 link=no multicast=yes port=twisted pair speed=100Mbit/s
resources: irq:88 ioport:d000(size=256) memory:90704000-90704fff memory:90700000-90703fff
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:04:00.0
logical name: p2p1
version: 06
serial: 00:0b:ab:a8:9e:95
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.040.00-NAPI duplex=full ip=192.168.1.132 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
resources: irq:90 ioport:c000(size=256) memory:90604000-90604fff memory:90600000-90603fff
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: ubuntu server 14 双网卡问题

#5

帖子 poloshiao »

还是一样:
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
physical id: 0
serial: 00:0b:ab:a8:9e:94
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
physical id: 0
serial: 00:0b:ab:a8:9e:95
serial: 00:0b:ab:a8:9e:94
serial: 00:0b:ab:a8:9e:95
不一樣

sudo ifconfig -a
看看 是一個 還是兩個 有線網卡
beingjoey
帖子: 11
注册时间: 2016-01-26 16:57

Re: ubuntu server 14 双网卡问题

#6

帖子 beingjoey »

2个。重启之后就都正常了。
beingjoey
帖子: 11
注册时间: 2016-01-26 16:57

Re: ubuntu server 14 双网卡问题

#7

帖子 beingjoey »

有大神能解答吗??每次重新上电都会这样,只有一个网口,另外一个硬件显示UNCLAIMED。热重启之后就好了。
beingjoey
帖子: 11
注册时间: 2016-01-26 16:57

Re: ubuntu server 14 双网卡问题

#8

帖子 beingjoey »

有大神能解答吗??每次重新上电都会这样,只有一个网口,另外一个硬件显示UNCLAIMED。热重启之后就好了。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: ubuntu server 14 双网卡问题

#9

帖子 poloshiao »

2个。重启之后就都正常了。
把下面指令 複製 貼進終端機 執行
0. sudo lspci -knn
1. sudo ifconfig -a
2. sudo cat /etc/udev/rules.d/70-persistent-net.rules
請全部複製貼上來
回复