Sie sind auf Seite 1von 1

******************************************************************************** *** Linux IP aliasing ******************************************************************************** *** On a Linux server, one IP address is typically assigned to a NIC (Network Interf

ace Card), i.e. ethernet card. The IP address assigned to the NIC serves as the primary IP. In a situation where you'll need multiple IP addresses (that connect to a same network), you may use IP aliasing feature of the Linux to map multipl e IP addresses to a single NIC. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$ To set up an IP alias, execute the following command: # ifconfig eth0:0 192.168.1.3 netmask 255.255.255.0 up This assigns the IP address 192.168.1.3 to eth0:0 (where eth0 is the primary int erface address). If you look at the output of ifconfig, you'll see the distinct IP address for eth0 and another for eth0:0. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$ If you need to add another IP address, use the same command with an incremented alias number (i.e. eth0:1, eth0:2, and etc.). You may assign up to 256 IP aliase s on a given NIC. To make IP aliasing permanent (survive system reboots), you may configure IP ali asing by creating configuration file(s). On Red Hat, Mandrake and similar system s, you may create files in /etc/sysconfig/network-scripts/. In this directory, c reate a new file called ifcfg-eth0:0 that contains the following contents: IPADDR="192.168.1.3" NETMASK="255.255.255.0" On systems that do not use those network scripts, just add the ifconfig command (shown above) directly in the startup script (i.e., /etc/rc.d/rc.local).

Das könnte Ihnen auch gefallen