Operating System - HP-UX
1834454 Members
2503 Online
110067 Solutions
New Discussion

Different IP adresses on the same Ethernet port.

 
SOLVED
Go to solution
Simone Benzi_1
Frequent Advisor

Different IP adresses on the same Ethernet port.

Hello everybody,
Is it possible to configure two different IP addresses belonging to two different subnets on the same Ethernet card?

I mean a netconf file like this:

INTERFACE_NAME[0]="lan0"
IP_ADDRESS[0]="192.170.121.84"
SUBNET_MASK[0]="255.255.255.0"
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0

INTERFACE_NAME[1]="lan0"
IP_ADDRESS[1]="192.170.100.71"
SUBNET_MASK[1]="255.255.255.0"
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=""
DHCP_ENABLE[1]=0

where lan0 is the same: /dev/lan0

Thanks a lot!

Simone

7 REPLIES 7
Ralph Grothe
Honored Contributor

Re: Different IP adresses on the same Ethernet port.

Hi Simone,

wonder how you would use this NIC?

Do you use some sort of Y-cable? ;-)
Madness, thy name is system administration
Robert Binkhorst
Trusted Contributor
Solution

Re: Different IP adresses on the same Ethernet port.

Hi Simone,

Using lan0 twice will give you problems. How will HP-UX know which one is which if you specify lan0? You can make multiple virtual addresses by adding :1, :2 and so on.

So this should work:
INTERFACE_NAME[1]="lan0:1"
IP_ADDRESS[1]="192.170.100.71"
SUBNET_MASK[1]="255.255.255.0"
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=""
DHCP_ENABLE[1]=0

HTH,

Robert
linux: the choice of a GNU generation
Simone Benzi_1
Frequent Advisor

Re: Different IP adresses on the same Ethernet port.

Yes! I'll use lan0:1 lan0:2 and so on...
Since the subnets are different could it bring any problem?

Robert Binkhorst
Trusted Contributor

Re: Different IP adresses on the same Ethernet port.

Hi,

Oeh. Missed that one! Subnets need to be the same as far as I know. You can try this, make sure that your traffic can be routed, I don't see any other option I'm afraid...

Let me know how this works out?

Robert
linux: the choice of a GNU generation
MarkSyder
Honored Contributor

Re: Different IP adresses on the same Ethernet port.

I don't think the different subnets will cause a problem. Presumably the box will be acting as a router between two subnets?

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Sarvesh A Dhuri
Advisor

Re: Different IP adresses on the same Ethernet port.

Hi

You create subinterface like lan0:1 ,
and assign the IP address to this interface , you can assign the IP address of other subnet . I hope you must have shortcircuited the two subnet, which is not a good practice.


I have been betrayed by our own People
KapilRaj
Honored Contributor

Re: Different IP adresses on the same Ethernet port.

It is not a bad idea to assign two IP_Addresses to an interface as far as they are in the same logical network (L3).

Looking at your IP & Subnet mask I can see they are of two diffrent TCP/IP network !. How will you wire a single Ethernet interface to two Physical Networks ?.

What is your requirement here?.

Regds,

Kaps
Nothing is impossible