Ubuntu系统如何安装双网卡及更改网卡名称(eth0改为eth1)

本文只有部分内容,请到一牛网阅读全文:

http://www.16rd.com/blog-4-1442.html

最近,在原来的ubuntu服务器上安装两块千兆网卡,需要用到了一些网卡的安装、配置及更改命令。

新 安装的网卡为PCI-E 1x 接口,芯片为“BROADCOM 5721”;服务器为IBM 3650 M2,Ubuntu系统采用的是10.04 版本。安装好网卡以后启动服务器,使用“lspci”命令查看服务器PCI设备,看看是否正确识别出新网卡。我的服务器识别出了新网卡,说明Ubuntu 系统带有该网卡的驱动,不必手动安装驱动。识别出新网卡后,即可对其进行配置。

此 时新网卡的名称应该为“eth2”和“eth3”,因为“eth0”和“eth1”被服务器原有的网卡占用了。服务器启动完毕以后,使用 “ifconfig”命令,看到的却是“eth0”、“eth0_rename”、“eth1”和“eth2”,并且原有两块“eth0”和“eth1” 网卡无**常工作。看来必须对服务器上的四块网卡重新进行设置。

1)用“ifconfig”命令查看并记录下四块网卡的MAC地址;

2)vi /etc/udev/rules.d/70-persistent-net.rules

3)上面的文件内容与下面类似

# This file was automatically generated by the /lib/udev/write_net_rules

# program run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single line.

 

# PCI device 0x8086:0x10c0 (e1000e)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1a:a0:9d:f2:58", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" 

其中,NAME="eth0"就是网卡的名称,该名称与MAC地址"00:1a:a0:9d:f2:58"对应。通过编辑该文件,就可以调整网卡名称。

4)更改完后重启服务器。

5)服务器启动完毕以后,编辑网卡配置文件。

“sudo vi /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

auto eth0   #设置eth0

iface eth0 inet static

   address 192.168.10.10

   netmask 255.255.255.0

   network 192.168.10.0

   broadcast 192.168.10.255

   gateway 192.168.10.1

   dns-nameservers 202.103.224.68

   dns-nameservers 202.103.225.68

 

本文只有部分内容,请到一牛网阅读全文:

http://www.16rd.com/blog-4-1442.html

转载于:https://my.oschina.net/cy2/blog/725974

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值