Interesting Networking Question

Discuss Networking
Post Reply
X11
guru
guru
Posts: 676
Joined: Sun Jan 19, 2003 11:09 pm
Location: Australia
Contact:

Interesting Networking Question

Post by X11 »

I have a machine and I want to configure it so it has more then one IP Address (and Ethernet Address if possible) on the same interface (it runs Red-Hat 7.2).

It has a Intel 100B Network card.

This is pretty simple from what I have heard, any help would be appreciated.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main »

You can't assign more than one MAC address to an interface but you can easily assign multiple IP addresses to an interface:

To create a subinterface on your eth0 with IP address iii.iii.iii.iii and netmask of mmm.mmm.mmm.mmm you would:

# ifconfig eth0:0 iii.iii.iii.iii netmask mmm.mmm.mmm.mmm

To view it you would:

# ifconfig eth0:0

Then of course you could add a route with the "route" command if needed.

You can add more (eth0:1, eth0:2, etc). Before you do any of that you should notice that these subinterfaces already exist, just are not assigned IP addresses. Before setting an IP address with ifconfig just do this:

# ifconfig eth0:0
# ifconfig eth0:1

etc.

Depending on your distro would depend on how you would declare it in configuration files and graphical utilities but that is the way they all would do it on the command line.

Post Reply