博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu系统如何安装双网卡及更改网卡名称(eth0改为eth1)
阅读量:2385 次
发布时间:2019-05-10

本文共 1519 字,大约阅读时间需要 5 分钟。

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

最近,在原来的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

 

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

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

你可能感兴趣的文章
file_operations结构体
查看>>
try_module_get和module_put
查看>>
使用 /proc 文件系统来访问 Linux 内核的内容
查看>>
c#明年学习计划书
查看>>
linux驱动程序开发实例
查看>>
7500刀的accounts.google.com域下XSS分析(wooyun)
查看>>
FreeRADIUS Google Dual Factor Authenticator
查看>>
Linux内存管理之mmap详解
查看>>
Linux进程管理内核API函数pid_task( )
查看>>
Adore-ng-0.56源码分析
查看>>
struct inode 和 struct file
查看>>
struct inode 和 struct file
查看>>
struct inode 和 struct file
查看>>
struct inode 和 struct file
查看>>
struct inode 和 struct file
查看>>
struct inode 和 struct file
查看>>
struct inode 和 struct file
查看>>
struct inode 和 struct file
查看>>
struct inode 和 struct file
查看>>
S_ISREG等几个常见的宏
查看>>