LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Binding multiple IP Addresses to same NIC (https://www.linuxquestions.org/questions/linux-networking-3/binding-multiple-ip-addresses-to-same-nic-355429/)

Harlin 08-21-2005 04:50 AM

Binding multiple IP Addresses to same NIC
 
I have a nic, eth0. I would like to bind two IP Addresses to it:
192.168.115.21
10.10.1.21

How do I do this?

Thanks,

Harlin

umeshbabu 08-21-2005 06:22 AM

have a look at this link

http://www.linuxhomenetworking.com/l...work-linux.htm

Harlin 08-21-2005 01:47 PM

Thanks, this is exactly what I was looking for.

timsoft 09-22-2005 08:56 AM

Thanks. Just in case the link changes here is the info in brief... type
ifconfig eth0:0 xxx.xxx.xxx.xxx netmask yyy.yyy.yyy.yyy up
(obviously replace the x's with your second ip address, and the y's with the mask for it.). you can add this line to /etc/rc.d/rc.local so that it is run each time the pc starts.
no doubt if you want a thrid ip address you can use eth0:1
and if you want the second ip on eth1 use eth1:0

lockout 10-26-2005 05:10 AM

Hi!
I had done that by useing the IP command:
ip addr add xxx.xxx.xxx.xxx/nn brd + dev eth0 label eth0:0

where xxx - your IP
/nn - netmask

Works fine!


All times are GMT -5. The time now is 09:48 AM.