Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

Muliple IP's

P Arumugavel
Respected Contributor

Muliple IP's

Hi Experts,

How can I assign multiple IP's to a single interface.
6 REPLIES
ani007
Super Advisor

Re: Muliple IP's

Hi,
yes you can assign multiple IP'S to a single interface.To assign a second IP address,you add a logical instance number to a LAN adapter name.

The following command adds a second IP address, 192.168.3.5, to lan3.
#ifconfig lan3:1 192.168.3.5 netmask 255.255.255.0 broadcast
192.168.3.255 up

# netstat -in
Name Mtu Network Address Ipkts Opkts
lan3 1500 192.168.3.0 192.168.3.1 0 0
lan0 1500 192.168.2.0 192.168.2.11 31740 32864
lo0 4136 127.0.0.0 127.0.0.1 303 303
lan3:1 1500 192.168.3.0 192.168.3.5 0 0
#

To make it permanent, you have to add its configuration the /etc/rc.config.d/netconf file.
Hakki Aydin Ucar
Honored Contributor

Re: Muliple IP's

Yes ,you can as other said that before;
The method is IP Multiplexing that means binding more than one IP address to a single network interface
P Arumugavel
Respected Contributor

Re: Muliple IP's

How to add it's configuration in /etc/rc.config.d/netconf file?
My current entry:

DEFAULT_INTERFACE_MODULES=""
INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=192.168.10.96
DHCP_ENABLE[0]=0
SUBNET_MASK[0]=255.255.255.0
ROUTE_MASK[0]=0.0.0.0
ROUTE_GATEWAY[0]=192.168.10.1
BROADCAST_ADDRESS[0]=""
ROUTE_COUNT[0]=1
ROUTE_DESTINATION[0]=default
ani007
Super Advisor

Re: Muliple IP's

To persist the configuration, modify /etc/rc.config.d/netconf. The format
should be like this:

EX:-
INTERFACE_NAME[0]="lan3"
IP_ADDRESS[0]=192.168.3.1
SUBNET_MASK[0]=255.255.255.0
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0

INTERFACE_NAME[1]="lan3:1"
IP_ADDRESS[1]=192.168.3.5
SUBNET_MASK[1]=255.255.255.0
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=""
DHCP_ENABLE[1]=0

Regards,
Ani
Chandrahasa s
Valued Contributor

Re: Muliple IP's

Hi,

It will be like:

NTERFACE_NAME[1]="lan3:1"
IP_ADDRESS[1]=192.168.3.5
SUBNET_MASK[1]=255.255.255.0
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=""
DHCP_ENABLE[1]=0

chandra
Ismail Azad
Esteemed Contributor

Re: Muliple IP's

Vel - UX,

This is the command for logical multiplexing.

ifconfig lan1:1 172.16.20.6 netmask 255.255.255.0 up
ifconfig lan1:2 172.16.20.8 netmask () up
on and on

Just remember lan1:0 is the same as lan1.
unplumb on a logically multiplexed interface (lan1:2) will not work.

Regards

Read, read and read... Then read again until you read "between the lines".....