Networking Forums

Networking Forums > Computer Networking > Linux Networking > setting muliple IP addresses on Single NIC

Reply
Thread Tools Display Modes

setting muliple IP addresses on Single NIC

 
 
kernel.lover
Guest
Posts: n/a

 
      02-08-2005, 10:40 AM
Hello,
I want to assign 2 static ip addresses to single NIC. How can
i do that? Also i want to be able to ping to both IP addresses whithin
LAN. I am using redhat 9.
Also can it be possible with setting eth0 as 10.0.0.100 and
172.16.1.100
regards,
cranium.
 
Reply With Quote
 
 
 
 
joy
Guest
Posts: n/a

 
      02-08-2005, 11:57 AM
kernel.lover wrote:
> Hello,
> I want to assign 2 static ip addresses to single NIC. How can
> i do that? Also i want to be able to ping to both IP addresses whithin
> LAN. I am using redhat 9.
> Also can it be possible with setting eth0 as 10.0.0.100 and
> 172.16.1.100
> regards,
> cranium.


you can add alias for network interface using ipconfig ex.:

ifconfig eth0 172.16.0.0 netmask 255.255.255.0 up
ifconfig eth0:1 10.0.0.1 netmask 255.255.255.240 up


bye
pep
 
Reply With Quote
 
Jose Maria Lopez Hernandez
Guest
Posts: n/a

 
      02-08-2005, 01:16 PM
joy wrote:
> kernel.lover wrote:
>
>> Hello,
>> I want to assign 2 static ip addresses to single NIC. How can
>> i do that? Also i want to be able to ping to both IP addresses whithin
>> LAN. I am using redhat 9.
>> Also can it be possible with setting eth0 as 10.0.0.100 and
>> 172.16.1.100
>> regards,
>> cranium.

>
>
> you can add alias for network interface using ipconfig ex.:
>
> ifconfig eth0 172.16.0.0 netmask 255.255.255.0 up
> ifconfig eth0:1 10.0.0.1 netmask 255.255.255.240 up


Today it's more advisable to use the command ip and
not aliases, with ip you can give "real" IPs to your
interface.

Regards.

>
> bye
> pep



--

Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
(E-Mail Removed)
bgSEC Seguridad y Consultoria de Sistemas Informaticos
http://www.bgsec.com
ESPAÑA

The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
-- Jack Kerouac, "On the Road"
 
Reply With Quote
 
Benway
Guest
Posts: n/a

 
      02-08-2005, 02:13 PM
On 8 Feb 2005 03:40:17 -0800, (E-Mail Removed) (kernel.lover)
wrote:

>Hello,
> I want to assign 2 static ip addresses to single NIC. How can
>i do that? Also i want to be able to ping to both IP addresses whithin
>LAN. I am using redhat 9.
> Also can it be possible with setting eth0 as 10.0.0.100 and
>172.16.1.100
>regards,
>cranium.


There is a kernel option requried to be compiled into the kernel
for this to work but i think it was already set in RedHat stock
kernels. I think it was CONFIG_IP_ALIAS. So you may need to recompile
the kernel but propably not.

Assuming the NIC device is eth0 copy
/etc/sysconfig/network-scripts/ifcfg-eth0 to
/etc/sysconfig/network-scripts/ifcfg-eth0:0

Then edit /etc/sysconfig/network-scripts/ifcfg-eth0:0
so the DEVICE=eth0:0 and set the IP/Netmask details accordingly
and do "ifup eth0:0"


--
Benway
Remove the SPAM
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding a single IP Address to two different MAC addresses Ramesh Linux Networking 6 02-20-2008 01:35 PM
multiple IP addresses on a single machine internetgoo@googlemail.com Linux Networking 8 10-09-2007 03:03 AM
[WinXP] How to Bind Multiple IP Addresses to Single NIC - Via DHCP? E11 Windows Networking 1 01-25-2007 01:59 PM
Multiple Static IP addresses through single DSL Modem C Newlin Windows Networking 2 06-29-2004 03:40 AM
create additional addresses on single nic Will Kubly Windows Networking 1 06-23-2004 10:50 PM



1 2 3 4 5 6 7 8 9 10 11