赞
踩
centos6.x虚机系统为例
1.记录网卡MAC信息
2.修改虚机网卡
- [root@rac2 ~]# cat /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 0x1af4:0x1000 (virtio-pci)
-
- # PCI device 0x1af4:0x1000 (virtio-pci)
-
- # PCI device 0x1af4:0x1000 (virtio-pci)
- SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="0e:f9:ab:61:42:17", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
-
- # PCI device 0x1af4:0x1000 (virtio-pci)
- SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="aa:60:17:fd:0e:e3", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
- [root@rac2 ~]#
3.修改系统ip信息:
- [root@rac2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
- DEVICE=eth0
- HWADDR=0E:F9:AB:61:42:17
- TYPE=Ethernet
- ONBOOT=yes
- NM_CONTROLLED=yes
- BOOTPROTO=static
- IPADDR=192.168.207.137
- GATEWAY=192.168.207.1
- NETMASK=255.255.255.0
- DNS1=223.5.5.5
- [root@rac2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
- DEVICE=eth1
- HWADDR=AA:60:17:FD:0E:E3
- TYPE=Ethernet
- ONBOOT=yes
- NM_CONTROLLED=yes
- BOOTPROTO=static
- IPADDR=10.1.1.137
- NETMASK=255.255.255.0
4.修改主机名:(附带)
hostname xxx
vi /etc/sysconfig/network
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。