Assigning IPs to one NIC

Reply

Join Date: Jul 2004
Posts: 1,749
Reputation: nanosani is an unknown quantity at this point 
Solved Threads: 54
Team Colleague
nanosani's Avatar
nanosani nanosani is offline Offline
Unauthenticated Liar

Assigning IPs to one NIC

 
0
  #1
Feb 6th, 2006
How many IPs can I configure on Linux system on one NIC ??

If its different for freeBSD, Fedora and RedHat Linux then whats the exact figures for each ....
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: Assigning IPs to one NIC

 
0
  #2
Feb 7th, 2006
That's actually a tough question to answer. I can tell you, though, that Fedora and RedHat will likely be the same. You will probably have to manually configure them via the ifconfig command, rather than using the GUI tools, as they usually only support one address per interface.

I tried going through the source code for both FreeBSD and Linux, but really didn't find a way to go. Perhaps this would be a great question to pose to each the Linux and FreeBSD kernel developers' Network mailing lists?
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Aug 2003
Posts: 372
Reputation: TheOgre is a jewel in the rough TheOgre is a jewel in the rough TheOgre is a jewel in the rough 
Solved Threads: 6
TheOgre's Avatar
TheOgre TheOgre is offline Offline
Posting Whiz

Re: Assigning IPs to one NIC

 
0
  #3
May 29th, 2006
Originally Posted by alc6379
I tried going through the source code for both FreeBSD and Linux, but really didn't find a way to go. Perhaps this would be a great question to pose to each the Linux and FreeBSD kernel developers' Network mailing lists?
You'd want to use the 'alias' command with ifconfig, as described in the FreeBSD Handbook. You set this in /etc/rc.conf

Example:

alias_fxp0="inet 10.0.3.4 netmask 255.255.255.0"
If you spend more on coffee than on IT security, you will be hacked.
What's more, you deserve to be hacked.
-- former White House cybersecurity czar Richard Clarke
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 4
Reputation: hagcomcol is an unknown quantity at this point 
Solved Threads: 0
hagcomcol's Avatar
hagcomcol hagcomcol is offline Offline
Newbie Poster

Re: Assigning IPs to one NIC

 
0
  #4
Jun 1st, 2006
Originally Posted by nanosani
How many IPs can I configure on Linux system on one NIC ??

If its different for freeBSD, Fedora and RedHat Linux then whats the exact figures for each ....
Here's how we do it where I work. Just set up an alias for the ethernet port you want to apply multiple IP addresses to. Theoretically you could apply as many IP addresses to an ethernet port as you want. We typically have never used more than 4. We're also using RedHat Enterprise Linux Server v3/v4.

[ifcfg-eth1]
DEVICE=eth1
BOOTPROTO=none
HWADDR=00:D0:B7:4D:50:ED
ONBOOT=yes
USERCTL=no
PEERDNS=yes
TYPE=Ethernet
IPADDR=192.168.0.102
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
GATEWAY=192.168.0.1

[ifcfg-eth1:1]
DEVICE=eth1:1
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.0.121
NETMASK=255.255.255.0
USERCTL=no
IPV6INIT=no
PEERDNS=yes
GATEWAY=192.168.0.1
TYPE=Ethernet

These files are located in /etc/sysconfig/network-scripts. Configuring these through the GUI utilities will work almost as well as manually editing the files yourself.

Hope this helps.
--

Later...

"Wherever you go, there you are." -- Buckaroo Banzai
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 1,749
Reputation: nanosani is an unknown quantity at this point 
Solved Threads: 54
Team Colleague
nanosani's Avatar
nanosani nanosani is offline Offline
Unauthenticated Liar

Re: Assigning IPs to one NIC

 
0
  #5
Jun 5th, 2006
Originally Posted by hagcomcol
Here's how we do it where I work. Just set up an alias for the ethernet port you want to apply multiple IP addresses to. Theoretically you could apply as many IP addresses to an ethernet port as you want. We typically have never used more than 4. We're also using RedHat Enterprise Linux Server v3/v4.

[ifcfg-eth1]
DEVICE=eth1
BOOTPROTO=none
HWADDR=000:B7:4D:50:ED
ONBOOT=yes
USERCTL=no
PEERDNS=yes
TYPE=Ethernet
IPADDR=192.168.0.102
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
GATEWAY=192.168.0.1

[ifcfg-eth1:1]
DEVICE=eth1:1
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.0.121
NETMASK=255.255.255.0
USERCTL=no
IPV6INIT=no
PEERDNS=yes
GATEWAY=192.168.0.1
TYPE=Ethernet

These files are located in /etc/sysconfig/network-scripts. Configuring these through the GUI utilities will work almost as well as manually editing the files yourself.

Hope this helps.
And thats why I was asking ... how many aliases like these can I make in Linux?
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 4
Reputation: hagcomcol is an unknown quantity at this point 
Solved Threads: 0
hagcomcol's Avatar
hagcomcol hagcomcol is offline Offline
Newbie Poster

Re: Assigning IPs to one NIC

 
0
  #6
Jun 5th, 2006
Originally Posted by nanosani
And thats why I was asking ... how many aliases like these can I make in Linux?
Ok... here's what I have on the maximum number of IP aliases. According to my documentation, as of Linux kernel 2.0.3 and up the default maximum number of aliases is 256. This can be changed by updating or creating this file and putting the new maximum number...

/proc/sys/net/core/net_aliax_max

Does that answer your question?
--

Later...

"Wherever you go, there you are." -- Buckaroo Banzai
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 298
Reputation: Cain is an unknown quantity at this point 
Solved Threads: 2
Cain's Avatar
Cain Cain is offline Offline
Posting Whiz in Training

Re: Assigning IPs to one NIC

 
0
  #7
Jun 13th, 2006
One of the things not pointed out here was the ability of the alias
to exist on more than one subnet. Meaning eth0 is the first and eth:1
the second in traditionial fashion. This comes in really handy when merging
domains or for load balancing applications such as Oracle.

In the most basic sence, you can really name it anything as long as
the mac addresses are bound to the correct common device. You can
even go as far as to edit the scripts and files by hand in
/etc/sysconfig/network*.

just copy the initial eth0 files to the new name and edit appropriately.

after:

ifup eth0:1

or the like or simply:
service network restart

you can also use miitool or the current version, ethtool
to set persistant forced speeds, duplexing and whatnot.

gotta love it!
I used up all my money on you baby...
... and I want it BACK.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the *nix Software Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC