zhaobei / Question-bank

此项目记录了日常遇到的问题与解决问题的过程
MIT License
0 stars 0 forks source link

给虚拟机添加虚拟网卡并设置MAC地址 #6

Open zhaobei opened 2 years ago

zhaobei commented 2 years ago

vim /etc/yum.repos.d/nux-misc.repo

[nux-misc] name=Nux Misc baseurl=http://li.nux.ro/download/nux/misc/el7/x86_64/ enabled=0 gpgcheck=1 gpgkey=http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro

yum --enablerepo=nux-misc install tunctl

tunctl -t eth2 -u root

修改配置

cd /etc/sysconfig/network-scripts/

cp ifcfg-eth0 ./ifcfg-eth2

vim ifcfg-eth2

DEVICE=eth2 ONBOOT=yes BOOTPROTO=static IPADDR= NETMASK= MACADDR=

GATEWAY=网关地址

service network restart