15.12 IP Multiplexing

     

We have looked at applying a single IP address to a single LAN interface. In some situations only, hosting a single IP address on a single LAN interface would be too restrictive , e.g., you are an ISP and you are hosting hundreds of IP addresses and host/domain names . When we want to support more than one IP address per LAN interface, we enter the world of IP multiplexing. From HP-UX 11.0 onward, this has been a built-in feature to the networking software. Prior to HP-UX 11.0, we needed to apply a patch to use a separate command called ifalias . This is no longer the case. We simple use ifconfig . In effect, each LAN interface can support multiple IP addresses that can belong to different subnets. The number of logical interfaces supported appears to be limited only by the amount of memory your system has. (The device_name is stored as a character string whose length is stored in an integer; effectively, you would be limited to a device name that is 2 32 or 2 64 characters long.) I wrote a script that applied an IP address of this form:

192.[1 255].[1 255].1

This effectively gives me 60,525 logical interfaces on a single physical LAN interface. This should give even the busiest Web server enough flexibility to host enough domain names. All we need to worry about is how to configure multiple IP address. The way this is done is to use a logical interface number appended to the name of the physical interface card:

nameX[:logical_interface_number]

name is the class of the interface. Valid names include lan (Ethernet LAN, Token Ring, FDDI, or Fibre Channel links), snap (IEEE802.3 with SNAP encapsulation), atm (ATM), du (Dial-up), ixe (X.25), and mfe (Frame Relay).

X is the Physical Point of Attachment (PPA). This is a numerical index for the physical card in its class. For LAN devices, the lanscan command displays the concatenated name and PPA number in the " Net-Interface NamePPA " field.

logical_interface_number is an index that corresponds to the logical interface for the specified card. The default is 0. The interface name lan0 is equivalent to lan0:0 , lan1 is equivalent to lan1:0 , and so on.

The first logical interface for a card type and interface is known as the initial interfac e. You must configure the initial interface for a card/encapsulation type before you can configure subsequent interfaces for the same card/encapsulation type. For example, you must configure lan2:0 (or lan2 ) before configuring lan2:1 . Once you have configured the initial interface , you can configure subsequent interfaces in any order.

This makes life really easy. Here's an example of setting up /etc/rc.config.d/ netconf to support IP multiplexing:

 

 root@hpeos001[] #  vi /etc/rc.config.d/netconf  INTERFACE_NAME[0]=lan0 IP_ADDRESS[0]=192.168.0.67 SUBNET_MASK[0]=255.255.255.224 BROADCAST_ADDRESS[0]="" INTERFACE_STATE[0]="" DHCP_ENABLE[0]=0 INTERFACE_NAME[1]=lan0:1 IP_ADDRESS[1]=200.200.10.10 SUBNET_MASK[1]=255.255.255.0 BROADCAST_ADDRESS[1]="" INTERFACE_STATE[1]="" DHCP_ENABLE[1]=0 INTERFACE_NAME[2]=lan0:2 IP_ADDRESS[2]=150.17.35.100 SUBNET_MASK[2]=255.255.0.0 BROADCAST_ADDRESS[2]="" INTERFACE_STATE[2]="" DHCP_ENABLE[2]=0 

The resulting ifconfig commands would be of this form:

 

 root@hpeos001[] #  ifconfig lan0:1 200.200.10.10 netmask 255.255.255.0  root@hpeos001[] #  ifconfig lan0:2 150.17.35.100 netmask 255.255.0.0  

And like any other interface, we can view its state with netstat :

 

 root@hpeos001[] #  netstat -in  Name          Mtu Network            Address                 Ipkts      Opkts   lan0:1       1500 200.200.10.0       200.200.10.10              22         44     lan0:2       1500 150.17.0.0         150.17.35.100              22         44   lan0         1500 192.168.0.64       192.168.0.67             1499       1550 lo0          4136 127.0.0.0          127.0.0.1                 298        298 root@hpeos001[] # root@hpeos001[] #  netstat -rn  Routing tables Destination           Gateway            Flags   Refs Interface  Pmtu 127.0.0.1             127.0.0.1          UH        0  lo0        4136 150.17.35.100         150.17.35.100      UH        0  lan0:2     4136 200.200.10.10         200.200.10.10      UH        0  lan0:1     4136 192.168.0.67          192.168.0.67       UH        0  lan0       4136 192.168.0.64          192.168.0.67       U         4  lan0       1500 200.200.10.0          200.200.10.10      U         4  lan0:1     1500 150.17.0.0            150.17.35.100      U         4  lan0:2     1500 192.168.0.32          192.168.0.66       UG        0  lan0          0 127.0.0.0             127.0.0.1          U         0  lo0           0 root@hpeos001[] # 

Remember to add these additional IP addresses to your host's database identifying the hostname of this server as home to that IP address.



HP-UX CSE(c) Official Study Guide and Desk Reference
HP-UX CSE(c) Official Study Guide and Desk Reference
ISBN: N/A
EAN: N/A
Year: 2006
Pages: 434

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net