首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >多网卡在重新启动时切换端口

多网卡在重新启动时切换端口
EN

Ask Ubuntu用户
提问于 2020-03-23 20:43:40
回答 1查看 234关注 0票数 0

我有一个2端口英特尔NIC在我的Ubuntu 18机器,以及一个NIC在主板上,我不使用。我最初想用不同的up设置两个up,但是失败了,现在我在同一个NIC端口上有两个up,但是在两个接口上(eth0和p4p1)。通常,当我重新启动机器时,Ubuntu会切换到NIC上的另一个以太网端口(未连接),我不知道我的配置哪里出错了。有人看到这个并修好了吗?最终,我想把这两个I分开,每个I都在自己的以太网端口上。我只是想不出如何将软件接口分配给硬件端口。我会提供日志和信息,告诉我你需要什么。谢谢。

代码语言:javascript
复制
# lshw -C network
  *-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:01:00.0
       logical name: p4p1
       version: 06
       serial: 10:bf:48:40:ba:c3
       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.0.120 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:35 ioport:e000(size=256) memory:fd004000-fd004fff memory:fd000000-fd003fff
  *-network:0
       description: Ethernet interface
       product: 82571EB/82571GB Gigabit Ethernet Controller D0/D1 (copper applications)
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: eth0
       version: 06
       serial: 00:15:17:ba:ee:72
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=5.11-2 ip=192.168.0.150 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:37 memory:fe9a0000-fe9bffff memory:fe980000-fe99ffff ioport:d020(size=32) memory:fe960000-fe97ffff
  *-network:1 DISABLED
       description: Ethernet interface
       product: 82571EB/82571GB Gigabit Ethernet Controller D0/D1 (copper applications)
       vendor: Intel Corporation
       physical id: 0.1
       bus info: pci@0000:04:00.1
       logical name: eth1
       version: 06
       serial: 00:15:17:ba:ee:73
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=5.11-2 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:38 memory:fe940000-fe95ffff memory:fe920000-fe93ffff ioport:d000(size=32) memory:fe900000-fe91ffff




# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto p4p1
iface p4p1 inet static
  address 192.168.0.120
  netmask 255.255.255.0
  gateway 192.168.0.1
  network 192.168.0.0
  dns-nameservers 192.168.0.170  192.168.0.171

auto eth0
iface eth0 inet static
  address 192.168.0.150
  netmask 255.255.255.0
  gateway 192.168.0.1
  network 192.168.0.0
  dns-nameservers 192.168.0.170  192.168.0.171

iface eth1 inet manual
#auto eth1
#iface eth1 inet static
#  address 192.168.0.151
#  netmask 255.255.255.0
#  gateway 192.168.0.1
#  network 192.168.0.0
#  dns-nameservers 192.168.0.170  192.168.0.171




No yaml files.
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2020-03-24 19:15:31

试试下面的..。

代码语言:javascript
复制
# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto p4p1
iface p4p1 inet static
  hwaddress 10:bf:48:40:ba:c3
  metric 100
  address 192.168.0.120
  netmask 255.255.255.0
  gateway 192.168.0.1
  network 192.168.0.0
  dns-nameservers 192.168.0.170  192.168.0.171

auto eth0
iface eth0 inet static
  hwaddress 00:15:17:ba:ee:72
  metric 200
  address 192.168.0.150
  netmask 255.255.255.0
  gateway 192.168.0.1
  network 192.168.0.0
  dns-nameservers 192.168.0.170  192.168.0.171

auto eth1
iface eth1 inet static
  hwaddress 00:15:17:ba:ee:73
  metric 300
  address 192.168.0.151
  netmask 255.255.255.0
  gateway 192.168.0.1
  network 192.168.0.0
  dns-nameservers 192.168.0.170  192.168.0.171
票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1219625

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档