ubuntu怎么更改网卡的eth
❶ ubuntu server13.10更改网卡名称
终端输入:vi /etc/udev/rules.d/70-persistent-net.rules
出现以下文件
# 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, and change only the value of the NAME= key.
# PCI device 0x8086:0x10de (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:65:b5:82:ca", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0d:0c:69:af:b8", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0e:01:2c:09:9c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
修改相对的设备名称,保存退出,重启网卡服务
❷ Ubuntu怎么修改网络配置
方法/步骤
方法一.使用图行界面设置,这个最简单。IP,子网掩码,网关,DNS都可以轻松设置。永久保存。
方法二,采用命令方式,临时修改网卡IP和子网掩码,重启网络后会丢失。$sudo ifconfig eth0 192.168.1.1 netmask 255.255.255.0
查看网关,命令$route -n
修改网关$sudo route add default gw 192.168.0.1
查看DNS,使用nm-tool命令$ns-tool
方法三,修改网卡的配置文件,这个是最主要的方式,可以永久保存。
注意不是/etc/resolv.conf,而是/etc/network/interfaces文件。
输入命令$sudo nano /etc/network/interfaces
输入:
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
Ctrl+x保存退出
输入命令$sudo nano /etc/resolvconf/resolv.conf.d/base
修改DNS
❸ 怎样修改网卡linux的名字为eth0
linux可通过以下步骤修改网卡名称:1、修改/etc/udev/rules.d/70-persistent-net.rules,将eth0 改为em1,将eth1 改为em2,注意:只需要修改name即可,不需要修改kernel;2、重命名网卡配置文件,需要ifcfg-eth0文件重命名为ifcfg-em1,需要ifcfg-eth1文件重命名为ifcfg-em2,mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-em1mv /etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-em23、编辑网卡配置文件,将名称修改过来,并把uuid删除(如没有就不用),重启服务器,重启之后网卡名称已经修改过来,网络正常。
❹ linux ubuntu 怎么修改网卡名称
在/etc/default/grub中,GRUB_CMDLINE_LINUX里添加参数net.ifnames=0 biosdevname=0,如下图所示:
然后在命令行执行,update-grub,最后,修改/etc/network/interfaces文件,
将网卡名改为eth0
重启系统,网卡名更改成功,当然这里也会出现服务器失联的情况需要注意。
❺ ubuntu 如何修改网卡名称
方案一:
1,首先修改网卡物理配置文件,没有这个文件的话新建一个或者从已有的环境上拷贝一份过来按照要求进行修改
vi /etc/udev/rules.d/70-persistent-net.rules
# PCI device 0x14e4:0x1692 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="bc:30:5b:b1:cd:be", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
关键字解释:
ATTR{address}=="bc:30:5b:9c:ae:79" ##物理网卡MAC地址 ifconfig查看
KERNEL=="eth*" ##原网卡名
NAME="eth0" ##现网卡名1234567
需要把这个文件中网卡的MAC地址,原网卡名字以及需要改成的网卡名字配置进去。
2,修改网落配置文件
vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 172.16.19.XX
netmask 255.255.255.0
这个要配置成修改后新的网卡名字
auto eth0 ##网卡名对应要正确1234567
3,重启服务器
重启物理服务器有一定的风险服务器没有重启起来,个人测试环境比较老旧有出现过服务器重启不起来,或者重启起来服务器因为网络配置错误出现失联情况,提示:在进行网卡修改的时候最好服务器离自己比较近,不要在远程的方式下进行修改,防止服务器失联。
三、方案二:
在/etc/default/grub中,GRUB_CMDLINE_LINUX里添加参数net.ifnames=0 biosdevname=0,如下图所示:
然后在命令行执行,update-grub,最后,修改/etc/network/interfaces文件,
将网卡名改为eth0
重启系统,网卡名更改成功,当然这里也会出现服务器失联的情况需要注意。
阅读全文
❻ Ubuntu系统如何安装双网卡及更改网卡名称(eth0改为eth1)
如果ethtool eth0显示的信息类似与下面Settings for eth0:Supported ports: [ TP ]Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/FullSupports auto-negotiation: YesAdvertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full说明eth0是千兆网卡,如果ethtool eth0显示的信息类似与下面Settings for eth0:Supported ports: [ TP ]Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/FullSupports auto-negotiation: YesAdvertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full说明eth0是百兆网卡。对网络进行设置,可以编辑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 interfaceauto loiface lo inet loopbackauto eth0 #设置eth0iface eth0 inet static address 192.168.37.76 netmask 255.255.255.0 network 192.168.37.0 broadcast 192.168.37.255 gateway 192.168.37.254 dns-nameservers 192.168.37.254 #auto eth1 #设置eth1#iface eth1 inet static#address xxx #auto eth0:1 #单网卡设置多个IP#iface eth0:1 inet static#address 192.168.1.60#netmask 255.255.255.0#network x.x.x.x#broadcast x.x.x.x#gateway x.x.x.x设置完后重启网络/etc/init.d/networking restart
❼ ubuntu怎么设置以太网
Ubuntu
$sudo vi /etc/network/interfaces
iface eth0 inet dhcp (自动获取ip)
auto eth0
iface eth0 inet static
address 192.168.0.22 ip地址
netmask 255.255.255.0 子网掩码
gateway 192.168.0.1 网关
$ sudo /etc/init.d/networking restart 重启网络
dns 添加
sudo vim /etc/resolv.conf
nameserver 8.8.8.8
❽ ubuntu网卡文件位置
1.修改网卡名称:ens3=>eth0
步骤1:首先切换到 root 账号,然后 vi /etc/default/grub;
步骤2:修改参数 GRUB_CMDLINE_LINUX 添加 net.ifnames=0 biosdevname=0;
步骤3:然后保存文件,执行命令update-grub
步骤4:编辑文件 /etc/network/interface 保存后重启ubuntu
步骤5:最后验证是否修改成功
2.设置eth0
#sudo nano /etc/network/interfaces #编辑网网卡配置文件
auto lo
iface lo inet loopback
auto eth0 #开机自动连接网络
iface eth0 inet static #static表示使用固定ip,dhcp表述使用动态ip
address 192.168.1.168 #设置ip地址
netmask 255.255.255.0 #设置子网掩码
gateway 192.168.1.1 #设置网关
3. 为网卡配置静态IP地址
编辑文件/etc/network/interfaces:
sudo nano /etc/network/interfaces
并用下面的行来替换有关eth0的行:# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
将上面的ip地址等信息换成你自己就可以了.用下面的命令使网络设置生效:
sudo /etc/init.d/networking restart。
4. 设定第二个IP地址(虚拟IP地址)
编辑文件/etc/network/interfaces: sudo vi /etc/network/interfaces
在该文件中添加如下的行:
auto eth0:1
iface eth0:1 inet static
address 192.168.1.60
netmask 255.255.255.0
network x.x.x.x
broadcast x.x.x.x
gateway x.x.x.x
根据你的情况填上所有诸如address,netmask,network,broadcast和gateways等信息。
用下面的命令使网络设置生效:
sudo /etc/init.d/networking restart。
❾ ubuntu 16.04 加装网卡后 怎么eth0
要ping通,最方便的方式是在虚拟机的配置中,把虚拟网卡的工作方式设置为“桥接”。 这样,虚拟机与实体机都在同一个IP段。前提是有路由并打开了DHCP功能。 没有DHCP的话,手动设置为同一IP段内即可。