First, preface
Requirements: Due to the LVS walkthrough, two Linux OS NICs need to be configured and different network segments.
Get ready:
Physical machine: Single NIC
Vmware:centos 6.8
Second, the configuration of the first step: new virtual Machine Vmware,centos 6.8, the default one card eth0. Configured NAT mode,
The network segment I set up here in NAT mode is the 192.168.229.0/24 network segment.
Step two: Add a NIC. The mode is bridged, and the same as the physical machine network segment is the 192.168.1.0/24 network segment.
Here, add up.
The third step, configuration
After the CentOS boot, only one card eth0 information, copy a eth0 configuration file:
[[email protected] network-scripts] #cd/etc/sysconfig/network-scripts
[[email protected] network-scripts] #cp ifcfg-eth0 ifcfg-eth1
To modify the configuration file Ifcfg-eth1:
[Email protected] network-scripts]# cat/etc/udev/rules.d/70-persistent-net.rules# This file is automatically Generated by the/lib/udev/write_net_rules# program, run by the persistent-net-generator.rules rules file.## C An modify it, as long as you keep each rule on a single# line, and change only the value of the name= key.# PCI de Vice 0x8086:0x100f (e1000) subsystem== "NET", action== "Add", drivers== "? *", attr{address}== "00:0c:29:df:72:dd", attr{type}== "1", kernel== "eth*", name= "eth0"# PCI device 0x8086:0x100f (e1000) subsystem== "NET", action== "add" , drivers== "? *", attr{address}== "00:0c:29:df:72:e7", attr{type}== "1", kernel== "eth*", name= "eth1 "
As you can see, the MAC address of eth1 is: 00:0c:29:df:72:e7, modify/etc/sysconfig/network-scripts/ifcfg-eth1 as follows:
[email protected] network-scripts]# cat ifcfg-eth1 device=eth1hwaddr=00:0c:29:df:72: e7type= ethernetuuid=a5370cfe-c84a-4b11-97ee-a96f34db9bbaonboot=yesnm_controlled=yesbootproto=static ipaddr=192.168.1.111netmask=255.255.255.0gateway=192.168.1.1
Restart the network card: Service network restart.
[Email protected] network-scripts]# Service Network Restart shutting down interface eth0: [OK] closing interface eth1: [OK] close loopback interface: [OK] popup loopback interface: [OK] Popup interface eth0: Is deciding the IP information of eth0. Complete [OK] Popup interface eth1:determining If IP address 192.168.1.111 is alreadyDevice eth1 ... Determine [Email protected] network-scripts]# IP a1:lo: <LOOPBACK,UP,LOWER_UP> MTU 16436 Qdisc noqueue State UNKNOWN link/loopback 00:00:00:00:00:00 BRD 00:00:00:00:00:00 inet 127.0.0.1/8 Scope host lo inet6:: 1/128 Scope host Valid_lft forever Preferred_lft Forever2:eth0: &L T Broadcast,multicast,up,lower_up> MTU Qdisc Pfifo_fast State up Qlen link/ether 00:0c:29:df:72:d D BRD Ff:ff:ff:ff:ff:ff inet 192.168.229.133/24 BRD 192.168.229.255 scope global eth0 inet6 fe 80::20C:29FF:FEDF:72DD/64 scope link Valid_lft forever preferred_lft forever3:eth1: <broadcast,multicast,up, Lower_up> MTU Qdisc Pfifo_fast State up Qlen- link/ether 00:0c:29:df:72: E7 BRD ff:ff:ff:ff:ff:ff
inet
192.168.1.111/24 BRD 192.168.1.255 scope global
eth1 inet6 FE80::20C:29FF:FEDF : 72E7/64 Scope link Valid_lft forever preferred_lft forever
As you can see, the two NICs are configured successfully.
VMware configures different network segment dual NICs.