How to bind MANY IP address on ONE Ethernet Card?

How to bind MANY IP address on ONE Ethernet Card?

Post by Dic » Wed, 12 Mar 2003 12:50:58



Operating system: Red Hat Linux 7.0.
Ethernet NIC: D-Link 530FX  (It's the only one Ethernet Card on my
computer.)
I have install the driver of D-Link 530FX on Linux correctly, and I
have create the config file "ifcfg-eth0" as well.
Now I have allocate 130.136.0.100 to my Ethernet Network Card. (Mask:
255.255.0.0)

The question is:
I want the only Ethernet Card have more IP addresses. (130.136.0.101,
130.136.0.102... and so forth).

What should I do?

I would be appreciated if you can show me the detail.

Thanks a lot!

=============================================
* (CHN)

 
 
 

How to bind MANY IP address on ONE Ethernet Card?

Post by Dic » Wed, 12 Mar 2003 12:54:32


Operating system: Red Hat Linux 7.0.
Ethernet NIC: D-Link 530FX  (It's the only one Ethernet Card on my
computer.)
I have install the driver of D-Link 530FX on Linux correctly, and I
have create the config file "ifcfg-eth0" as well.
Now I have allocate 130.136.0.100 to my Ethernet Network Card. (Mask:
255.255.0.0)

The question is:
I want the only Ethernet Card have more IP addresses. (130.136.0.101,
130.136.0.102... and so forth).

What should I do?

I would be appreciated if you can show me the detail.

Thanks a lot!

=============================================
* (CHN)


 
 
 

How to bind MANY IP address on ONE Ethernet Card?

Post by Peet Grobl » Wed, 12 Mar 2003 13:32:53



Quote:>Operating system: Red Hat Linux 7.0.
>Ethernet NIC: D-Link 530FX  (It's the only one Ethernet Card on my
>computer.)
>I have install the driver of D-Link 530FX on Linux correctly, and I
>have create the config file "ifcfg-eth0" as well.
>Now I have allocate 130.136.0.100 to my Ethernet Network Card. (Mask:
>255.255.0.0)

>The question is:
>I want the only Ethernet Card have more IP addresses. (130.136.0.101,
>130.136.0.102... and so forth).

ifcfg eth0:0 130.136.0.102 up
ifcfg eth0:1 130.136.0.103 up
and so forth...

or, the cleaner way, (more permanent). cp the ifcfg-eth0 file as
ifcfg-eth0:0, and change the IP. RedHat will pickup this configuration
file when booting and start it.

>What should I do?

>I would be appreciated if you can show me the detail.

>Thanks a lot!

>=============================================
>Dick (CHN)


 
 
 

How to bind MANY IP address on ONE Ethernet Card?

Post by Kenneth A Kauffma » Thu, 13 Mar 2003 03:21:03


FYI peeps. This is called multihoming a card by setting up ip aliasing.

example output of "route":

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
192.168.0.0     *               255.255.255.0   U     0      0        0
eth0:1
192.168.0.0     *               255.255.255.0   U     0      0        0
eth0:2
127.0.0.0       *               255.0.0.0       U     0      0        0
lo
default         192.168.0.254   0.0.0.0         UG    0      0        0 eth0

My default route goes through card 1 (eth0).  You can also set up entries so
each card uses a specific gateway.  If they all use the same one, then
specify that also.  Also, if you are doing clustering that requires
multicasting, you will need to setup your multicast address in the router
tables also, such as:

route add -net 224.0.0.0 netmask 224.0.0.0 dev eth0
route add -net 224.0.0.0 netmask 224.0.0.0 dev eth0:1
route add -net 224.0.0.0 netmask 224.0.0.0 dev eth0:2

ken k


> [ Followup-To: comp.os.linux.networking ]



> >>I want the only Ethernet Card have more IP addresses. (130.136.0.101,
> >>130.136.0.102... and so forth).

> >ifcfg eth0:0 130.136.0.102 up
> >ifcfg eth0:1 130.136.0.103 up
> >and so forth...

> I have a follow-up - question:

> How can I use those adresses for *out*-going traffic?

> I want to start a handfull instances of one program [*] to
> connect to one external system with different source-IP's.

> asking a simple question, Holger

> [*] The program is "pr3287" from the X3270-suite. C-Source ist
>     available. The externel system is behind a Cisco-Router ma-
>     king NAT; if that place would be simpler?

 
 
 

How to bind MANY IP address on ONE Ethernet Card?

Post by Whoeve » Thu, 13 Mar 2003 05:10:10



> [ Followup-To: comp.os.linux.networking ]



> >>I want the only Ethernet Card have more IP addresses. (130.136.0.101,
> >>130.136.0.102... and so forth).

> >ifcfg eth0:0 130.136.0.102 up
> >ifcfg eth0:1 130.136.0.103 up
> >and so forth...

Or if you have the IPROUTE2 package installed:

/sbin/ip addr add ....

Note that when using the IPROUTE2 commands, you always refer to the
interface as "eth0", not "eth0:0", etc.

 
 
 

How to bind MANY IP address on ONE Ethernet Card?

Post by fishb.. » Thu, 13 Mar 2003 05:14:20



Quote:>I want to start a handfull instances of one program [*] to
>connect to one external system with different source-IP's.

>asking a simple question, Holger

It's not really simple to answer though.  Basically, you're asking for
source address routing, and that's somewhat more complicated than
ip-aliases and the usual routing arrangement.  

You might be able to do it with ipchains (or iptables), rewriting
outgoing packets, together with some routing tricks.  Read the
Advanced Routing and the IP-Masq HOWTO's.

--

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

How to bind MANY IP address on ONE Ethernet Card?

Post by Holger Peterse » Thu, 13 Mar 2003 06:00:31



Quote:>FYI peeps. This is called multihoming a card by setting up ip aliasing.
>route add -net 224.0.0.0 netmask 224.0.0.0 dev eth0
>route add -net 224.0.0.0 netmask 224.0.0.0 dev eth0:1
>route add -net 224.0.0.0 netmask 224.0.0.0 dev eth0:2

But HOW do I get one instance of a program to use the IP-
Adress of eth0:1 as it's source adress and another instan-
ce of the same programm shall use the adress of eth0:2?

Both to the same destination behind some router?

yours, Holger

 
 
 

1. Linux-Multiple ip address bound to one ethernet card?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I've never seen a/the 'howto', but I learned by:
- ---
cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-eth0:1
<editor> ifcfg-eth0:1 (change the IP address and interface number as you wish)
./ifup ifcfg-eth0:1
- ---

If you have support for multiple IP's in your kernel, then it should work
without a hitch (and they automatically come up on reboot, too...you
don't have to ./ifup them every time.)

I've gone as far as having about 200 different IP's on one machine, but
cut it back to 128 per machine now (this, under intel processors and high
traffic/load...you may experience better performance with better (alpha)
processors/less traffic).  

- ----------------------------------------------------------------------
 Brent Alexander Oswald           /\      http://www.io.com/~buzzboy

     Webmaster                  /____\        NIC: BO525
       FNORD!                                
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.0 (GNU/Linux)
Comment: Made with pgp4pine

iD8DBQE4c/kBNf8s5Tx0R64RAh9EAJ4stkUkUtbhj+UCDf8Pvj+dzRfWBwCffN8f
CKOAjUw6qHA8ak7uhAMhetg=
=RrM1
-----END PGP SIGNATURE-----

2. 8th bit stripping problem

3. Creative CDRW reported as DVD too

4. How to bind MANY IP address on ONE Ethernet Card?

5. IBM Graphics Library

6. More than one IP address on one ethernet card?

7. Frame Buffer Problem - kernel panics upon exiting X

8. Listening to more than one IP address from one ethernet card

9. More than one IP address on one ethernet card?

10. How do I bind two IP addresses to one card?

11. How do I bind multiple IP addresses to 1 ethernet card

12. Multiple IP address for one ethernet card.