When we use Linux to set up Web servers and FTP servers, we may encounter the need to implement multiple sites on a single service (virtual host), in which case we can increase the physical network card to solve. But how many extra slots do we have on our servers? So we can do this by binding multiple IP addresses to a network card, so let's look at how to bind multiple IP addresses to a single NIC. (IIS more than the virtual host set up, Apache under the IP based virtual host are all through this to achieve) Linux under the network card is the beginning of the ETH, network card configuration files stored in/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ETHX. Implementation method: 1 Copy the NIC configuration file, copy the ifcfg-eth0 into ifcfg-eth0:1-----------------------------------------------------[root@station ~] # cd/etc/sysconfig/network-scripts/
[Root@station network-scripts]# CP Ifcfg-eth0 ifcfg-eth0:1
-----------------------------------------------------2) To modify a new profile:-----------------------------------------------------[root@station network-scripts]# vim Ifcfg-eth0:1
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
Device=eth0:1//Modified into eth0:1
Bootproto=static//IP address fetching mode, static, or none
ipaddr=192.168.1.11//New IP address
netmask=255.255.255.0//Mask
Onboot=yes//Boot auto Load
------------------------------------------------------the configuration file as above, keep it as above, and other deletions. 3 Activate the equipment, test the unicom situation, reboot and test. ------------------------------------------------------
[Root@station network-scripts]# ifup eth0:1
[Root@station network-scripts]# Ping 192.168.1.11
PING 192.168.1.11 (192.168.1.11) bytes of data.
Bytes from 192.168.1.11:icmp_seq=1 ttl=64 time=0.584 ms
Bytes from 192.168.1.11:icmp_seq=2 ttl=64 time=0.336 ms
---192.168.1.11 ping statistics---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
RTT Min/avg/max/mdev = 0.336/0.460/0.584/0.124 ms
------------------------------------------------------
This is the addition of an IP, then add one more? Let's Test it together!
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/