Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Configure server with two IP addresses in one NIC

Spyros_
Advisor

Configure server with two IP addresses in one NIC

Hi all,

 

The problem is that i have one remaining lan interface at my server and i want to connect it through one switch to two different networks. 

I suppose the best solution is to create two different vlans in one NIC with different IPs, but i am new at HP-UX and i don't know how to configure this issue.

The OS version is HP-UX 11.11

 

Best regards,

Spyros
7 REPLIES
hzftk2
HPE Pro

Re: Configure server with two IP addresses in one NIC

Hello "Spyros_",

 

The more simply way is use "sam" (System Administration Manager)

  1. Logging with root to the server (via vTerm)
  2. In command line write sam [Enter]; a "menu" will be appear; move with [arrow keys]
  3. Go to " Networking and Communications ->" (Enter)
  4. Go to "Network Interface Cards" [Enter]
  5. Move with [arrow keys], select the Network Interface with [Spacebar]
  6. [tab key] for menu access; move to Actions menu with [arrow keys], [Enter]
  7. Select in the menu "Modify..." move with [arrow keys]; if you will assigned the first IP to the NIC or "Add IP Logical Interface..." move with [arrow keys]; if you will assigned and additional IP to the NIC
  8. When you finish, to go back to the previous menu, [tab key] for menu access; move to "File" menu with [arrow keys], [Enter], [Exit]
  9. In the previous menu you have the possibility to add the "Routers" for you additional IP, if required.

I hope this will help you, usually this acction required "trial and error" to obtain the expected result.

 

Regards,

     hzftk2

I work for HP. If this answer has been helpful and clarifies or resolves your problem, please mark the topic as solved and click my star next to give a kudo as thanks.
Spyros_
Advisor

Re: Configure server with two IP addresses in one NIC

hello hzftk2,

 

Thanks a lot for your useful informations. Based on your instruction guide i create two different lans on the same NIC. 

IP_ADDRESS[2]=192.168.1.2
SUBNET_MASK[2]=255.255.255.0
INTERFACE_NAME[2]=lan2
BROADCAST_ADDRESS[2]=192.168.1.255
INTERFACE_STATE[2]=up

 

IP_ADDRESS[7]=172.20.8.100
SUBNET_MASK[7]=255.255.255.0
INTERFACE_NAME[7]=lan2:1
BROADCAST_ADDRESS[7]=172.20.8.255
INTERFACE_STATE[7]=up

 

Now i want to sign the first one to vlan 100 and the second one to the 200.

Can you provide me instructions about these?

I have to add and the routes to the destination network?

 

I'm waiting your reply

 

Thanks in advance,

 

Best regards,

Spyros_

Patrick Wallek
Honored Contributor

Re: Configure server with two IP addresses in one NIC

I don't think that is going to work.  I don't think it is possible to have 1 switch port belong to 2 different VLANS.  To the best of my knowledge when you set the VLAN for a port on a switch, it is just one VLAN.  If you set the port to a 2nd VLAN, then it now is part of that one, but NOT the first one.

 

I also don't  think you can have 2 totally different networks assigned to the same lan card on the HP-UX server. 

 

If you truly need this server to be on 2 differnet networks, then you probably need to invest in a 2nd network card.

Spyros_
Advisor

Re: Configure server with two IP addresses in one NIC

Dear Patrick,

 

If you set one port of the switch as trunk port you can pass different vlan traffic from that port.

 

Secondly you can create two sub-interfaces on the same NIC. As you can see in my last reply i attached netconf file from the /etc/rc.config.d and i created  lan2 and lan:1.

 

Finally my problem is that there is no space to add another network card and all the other lan interfaces are full.

 

Best regards,

Spyros_

 

 

Patrick Wallek
Honored Contributor

Re: Configure server with two IP addresses in one NIC

I am no networking expert, so I was not familiar with the trunk port. 

 

I also had not seen a single NIC with 2 different subnets configured.  I have configured 1 NIC with  multiple IP's on the same subnet, but never different ones.

 

If the way you have it configured, both on the switch side and the HP-UX side, works for you that is great.

Laurent Menase
Honored Contributor

Re: Configure server with two IP addresses in one NIC

Patrick:

1) hpux can have as many different subnet as you want defined as vip of the same lan interface.


2) vlan is a different notion which means physical isolation of your different traffic.

 

3) you can have multiple vip in different subnets on the same vlan

 

 

When you have different subnet on the same lan/vlan, they  need a gateway to be able to communicate.

When you have same subnet on different vlan, they can't communicate except if there is a bridge

 

Vlan means physical isolation.

 

A broadcast (255.255.255.255) will be received by any system on the same vlan whatever be their vlan.

A subnet broadcast will be received by any system on the same subnet on the same vlan.

 

 

 

Matti_Kurkela
Honored Contributor

Re: Configure server with two IP addresses in one NIC

For configuring VLANs in HP-UX 11.11, please see "man 7 vlan" and "man lanadmin".

 

In a nutshell:

To access tagged VLAN(s) through a physical NIC, you must create a virtual NIC for each tagged VLAN and associate it with the physical NIC. (The physical NIC can still be configured as usual for untagged VLAN traffic, or left unconfigured if you only need tagged VLANs.)

 

The virtual NICs will have PPA id 5000 or above, so they will appear as "lan5000" or greater.

For example, to pass tagged traffic for VLAN 1234 through lan0, this command would be used to create the virtual NIC:

lanadmin -V create vlanid 1234 vppa 5000 0

This command will create a virtual NIC "lan5000", which can then be configured as a normal NIC, but will handle VLAN traffic tagged for VLAN 1234 on physical NIC lan0. You can assign multiple VLAN virtual NICs to a single physical NIC.

 

To make the VLAN configuration persist over reboots, you must edit /etc/rc.config.d/vlanconf or use SAM to configure VLANs.

 

You can display your existing VLAN configuration with:

lanadmin -V scan

 

MK