[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Multiple IPs on a single network interface



This is definitely not a Solaris only feature. I don't know about Solaris that much, though.

Here's the relevant part from my /etc/network/interfaces:

auto lo eth0 eth1eth0:1 eth1:1

iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0

iface eth1:1 inet static
address 192.168.0.100
netmask 255.255.255.0

Note that without including an interface the "auto" line, you'll have to bring it up yourself:

ifup [interface]

or

ifconfig [interface] up


Here's the relevant part from ifconfig:

eth1      Link encap:Ethernet  HWaddr 00:...
         inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:1641124 errors:32 dropped:0 overruns:0 frame:36
         TX packets:1756695 errors:0 dropped:0 overruns:0 carrier:42
         collisions:40861 txqueuelen:100
         RX bytes:556431159 (530.6 MiB)  TX bytes:1737110125 (1.6 GiB)
         Interrupt:9 Base address:0xfc80

eth1:1 Link encap:Ethernet HWaddr 00:... inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         Interrupt:9 Base address:0xfc80


Hope this helps, and if not, just ask for more.


David De Graff wrote:

Johan,

This method's not working for me, have tried a few variations but no luck.
Have you done this with Debian? It looks more like something for Solaris.

Dave

----- Original Message -----
From: "Johan Ehnberg" <johan@ehnberg.net>
To: "David De Graff" <debian@platformglobal.com>;
<debia-user@lists.debian.org>
Sent: Thursday, August 08, 2002 1:18 AM
Subject: Re: Multiple IPs on a single network interface


Just a little note:
Configuring this is easy:
look at your /etc/network/interfaces:

iface eth0 inet static
address    192.168.0.1    (IP of interface)
netmask    255.255.255.0
[other relevant lines, if needed]

Configuring your alias/virtual interface is done the same way:

iface eth0:0 inet static
address    192.168.0.2    (IP of virtual interface)
netmask    255.255.255.0
[other relevant lines, if needed]


David De Graff wrote:

That's it! Thanks - simple, direct, and on target.

Now if we can just make the relevant docs more like that...

Dave

----- Original Message -----
From: "Cameron Hutchison" <camh+dl@xdna.net>
To: "Debian User List" <debian-user@lists.debian.org>
Sent: Thursday, August 08, 2002 12:32 AM
Subject: Re: Multiple IPs on a single network interface


Once upon a time David De Graff said...

I need to configure a woody server to run multiple IPs on a single

ethernet

interface. Have been digging and digging through the web and various

docs,

and don't see a clear answer.

I'd appreciate any pointers to clear docs on this, or an explanation of

how

to configure it.

I believe all you need to do is configure the interface ethx:1.

eg. if you want to add another IP address to eth0, run this:
# ifconfig eth0:1 192.168.0.2 netmask 255.255.255.0

Substitute interface names and IP addresses accordingly.

If you need another IP address, configure interface ethx:2, etc.

This all works for me on unstable with kernel 2.4.18.

--
Cameron Hutchison (camh+dl@xdna.net) | Onward To Mars


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact

listmaster@lists.debian.org















Reply to: