Recent server changes to work, but a lot of information is still on the previous server, and two servers in different network segments, if directly change the IP address of the server, will undoubtedly to other users of the same server also affect, so think like windows, for the server to add a network segment, This allows me to share information with the previous servers without affecting the work of other colleagues. Now the record is as follows:
operating system : CentOS Releas5 (Kernel 2.6.16-53.1.14.el5)
Current system IP:
First, add a single IP network segment method:
1.1. Add the network profile script to the system
# cd/etc/sysconfig/network-scripts
# CP Ifcfg-eth0 ifcfg-eth0:0
1.2, modify the newly added network configuration script file as follows:
# VI ifcfg-eth0:0
device=eth0:0 #此处添加: 0, network node name to be the same as network device name
Onboot=yes #是否开机激活
Bootproto=static #静态IP, please enter DHCP if you need DHCP access
hwaddr=00:0c:29:57:35:8e
netmask=255.255.255.0 #子网掩码根据你的实际情况作修改
ipaddr=192.168.1.16 #此处修改为要添加的IP
gateway=192.168.1.1
Type=ethernet
1.3, 1.3, start a new network segment node
/etc/init.d/network Reload
1.4, with ifconfig to see whether the new IP has been added
second, the bulk add IP address:
2.1. Create Range Profile
# cd/etc/sysconfig/network-scripts
# CP Ifcfg-eth0 IFCFG-ETH0-RANGE0 2.2, Configuring destination IP address Segment
# VI IFCFG-ETH0-RANGE0
device=eth0:0 #此处添加: 0, network node name to be the same as network device name
Onboot=yes #是否开机激活
Bootproto=static #静态IP, if you want dynamic IP, DHCP
hwaddr=00:0c:29:57:35:8e
netmask=255.255.255.0 #子网掩码根据你的实际情况作修改
ipaddr=192.168.1.16 #此处修改为要添加的IP
gateway=192.168.1.1
Type=ethernet
ipaddr_start=192.168.1.2 #起始IP
ipaddr_end=192.168.1.254 #结束IP
Clonenum_start=1 #表示这段IP网卡号从eth0:1 start
2.3, start a new network configuration
/etc/init.d/network Reload
Third, ubuntu add network segment
Method Ditto, except that the modified profile is different.
sudo vi/etc/network/interfaces
Add the following later :
Auto eth0:0
Iface eth0:0 inet Static
Name Ethernet alias LAN card
Address 192.168.2.13
Netmask 255.255.255.0
Broadcast 192.168.2.255
Network 192.168.2.0
Reboot to make configuration effective :
sudo/etc/init.d/networking restart