1833780 Members
2412 Online
110063 Solutions
New Discussion

Re: 2 ip for lan0

 
SOLVED
Go to solution
j773303
Super Advisor

2 ip for lan0

How to configue 2 ipaddress in lan0?
Hero
7 REPLIES 7
RAC_1
Honored Contributor

Re: 2 ip for lan0

ifconfig lan0 ip_address -- first ip
ifconfig lan0:1 ip_Address -second ip.

(Both need to be on same subnet)

If you are using 10.x, you need to use ifalias command.

Check the man page for ifconfig.
There is no substitute to HARDWORK
T G Manikandan
Honored Contributor

Re: 2 ip for lan0

#ifconfig lan0:1 plumb
#ifconfig lan0:1 up

Also make the entries in the /etc/rc.config.d/netconf file to persist the logical ip after reboot

Thanks
Michael Tully
Honored Contributor

Re: 2 ip for lan0

To configure your lan card:

e.g.
# ifconfig lan0:1 10.20.30.50 255.255.0.0

see man ipconfig for further examples.

The /etc/rc.config.d/netconf must be updated so that the information remains for the next and subsequent reboots of your system.

e.g.
INTERFACE_NAME[0]="lan0"
IP_ADDRESS[0]=10.20.30.40
SUBNET_MASK[0]=255.255.0.0
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0

INTERFACE_NAME[1]="lan0:1"
IP_ADDRESS[1]=10.20.30.40
SUBNET_MASK[1]=255.255.0.0
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=""
DHCP_ENABLE[1]=0

Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome"
Anyone for a Mutiny ?
T G Manikandan
Honored Contributor

Re: 2 ip for lan0

The bunny is not showing up even after a 8 point assignment.
Radhakrishnan Venkatara
Trusted Contributor

Re: 2 ip for lan0

hi

u can do it using SAM -> networking and communications->network interface cards.

or do it using ifconfig command line(this is temp) or edit /etc/rc.config.d/netconf file.


radhakrishnan
Negative thinking is a highest form of Intelligence
j773303
Super Advisor

Re: 2 ip for lan0

but how to remove the lan0:1 entry from netstat -in?
Hero
T G Manikandan
Honored Contributor
Solution

Re: 2 ip for lan0

When you unconfigure the lan0:1 interface the entry will be automatically taken off.

#ifconfig lan0:1 inet 0.0.0.0

#netstat -in




Thanks