linux虚拟机添加新的网卡

2018-12-05  本文已影响0人  贪恋红尘
linux虚拟机添加新的网卡
ifconfig

[root@linux-wx ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:C3:F1:37
inet addr:10.0.0.90 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec3:f137/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:49 errors:0 dropped:0 overruns:0 frame:0
TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6655 (6.4 KiB) TX bytes:6739 (6.5 KiB)

cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-eth1
vim ifcfg-eth1

DEVICE=eth1
HWADDR=00:0c:29:c3:f1:41
TYPE=Ethernet
UUID=7447f015-3cbc-42f9-b301-7f49c7db29d0
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
USERCTL=no
PEERDNS=yes
IPV6INIT=no
IPADDR=192.168.1.90
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=192.168.1.1


ifup eth1

Determining if ip address 192.168.1.90 is already in use for device eth1...

ping 192.168.1.90

PING 192.168.1.90 (192.168.1.90) 56(84) bytes of data.
64 bytes from 192.168.1.90: icmp_seq=1 ttl=64 time=0.051 ms
64 bytes from 192.168.1.90: icmp_seq=2 ttl=64 time=0.070 ms
^C
--- 192.168.1.90 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1831ms
rtt min/avg/max/mdev = 0.051/0.060/0.070/0.012 ms


总结:简单说来就是两个要点
  1. 拷贝网卡配置文件
  2. 修改网卡设备名称和mac地址信息
上一篇 下一篇

猜你喜欢

热点阅读