LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Ip Aliasing On Reboot ???? (https://www.linuxquestions.org/questions/linux-newbie-8/ip-aliasing-on-reboot-240285/)

lionking_x 10-08-2004 12:15 PM

Ip Aliasing On Reboot ????
 
Hey guys ,

I setup DNS on my system , everything works fine. So i went ahead and tried to setup IP aliasing , ie i have 1 ethernet card and i was giving it multiple IP addresses with the following command ,
my eth0 has 192.168.0.2 as the IP , and i add new IP's via

ifconfig eth0 add 192.168.0.3
ifconfig eth0:1 add 192.168.0.4
ifconfig eth0:2 add 192.168.0.5

The above adds the ip addresses , i update DNS settings and can dig the above IP's.

But when i reboot or restart the network service the changes for the new addresses are gone ,
How do i make these permanent ??

thanks
spk

Mikhail_16 10-08-2004 12:21 PM

if you are running RH, the files you need are in /etc/sysconfig/network-scripts
[root@~]$ ls /etc/sysconfig/network-scripts/
ifcfg-eth0 ....

that ifcfg-eth0 file contains the info for your current IP, so you just copy it into:
ifcfg-eth0:1, ifcfg-eth0:2, etc, and modify what you need in there., simple enough.

[root@~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=IP
NETMASK=255.255.255.0
GATEWAY=GATE
[root@~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE=eth0:1
ONBOOT=yes
BOOTPROTO=static
IPADDR=IP
NETMASK=255.255.255.0
GATEWAY=GATE

IP and GATE changed from original values for obvious reasons.


All times are GMT -5. The time now is 06:01 AM.