Chapter 6. Virtual local area network support
6.7 HiperSockets VLAN in Linux on System z
This section demonstrates that Linux on System z can use VLAN in a HiperSockets network to logically subdivide a network. Start with a HiperSockets network as described in 3.1, “Test configuration” on page 30. You recall that the device addresses being assigned to the various systems are on the same CHPID, and therefore on the same HiperSockets network.
This section shows the commands needed to set up a VLAN for the environment shown in Figure 6-3 for the Red Hat Enterprise Linux (RHEL) and SUSE Linux Enterprise Server (SLES) guest servers.
Figure 6-3 VLAN test configuration
The only difference for the two Linux guest systems is specifying the VLAN number on the vconfig and ifconfig commands. The vconfig command defines VLAN 2 on the RHEL server, and VLAN 3 on the SLES server, to the HiperSockets interfaces.
The important thing to note in the examples is that the HiperSockets network is up before the VLAN is defined (that is, before the network is subdivided) and started. The other commands show the process of defining and starting the VLAN. Start with the LNXRH1 system.
6.7.1 Temporary VLAN for RHEL—VLAN 2 on LNXRH1
As described in 3.5.2, “Linux configuration example” on page 49, you have defined hsi0 as HiperSockets interface by using the znetconf command, or added it to the ifcfg-hsi0 file.
Example 6-11 shows the configuration of hsi0 at this point.
Example 6-11 Displaying HiperSockets network definition [root@lnxrh1 ~]# ifconfig hsi0
hsi0 Link encap:Ethernet HWaddr 06:00:F0:2E:00:06
inet addr:192.0.1.2 Bcast:192.0.1.255 Mask:255.255.255.0
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:830 (830.0 b)
To create the VLAN, follow these steps:
1. In addition to this standard HiperSockets interface, create a new interface for VLAN 2 by using the vconfig command, as shown in Example 6-12.
Example 6-12 Adding a VLAN interface [root@lnxrh1 ~]# vconfig add hsi0 2 Added VLAN with VID == 2 to IF
-:hsi0:-The new VLAN interface can be seen in the Linux VLAN configuration file and in the interface configuration, as shown in Example 6-13.
Example 6-13 Displaying the VLAN interface [root@lnxrh1 ~]# cat /proc/net/vlan/config VLAN Dev name | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD hsi0.2 | 2| hsi0
[root@lnxrh1 ~]# ifconfig hsi0.2
hsi0.2 Link encap:Ethernet HWaddr 06:00:F0:2E:00:06 BROADCAST MULTICAST MTU:8192 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
2. If you compare Example 6-13 with Example 6-11 on page 78, you will note the missing second and third lines, in addition to the fields missing from the fourth line from the hsi0 information. This is because hsi0.2 is defined only and needs to be started:
ifconfig hsi0.2 192.0.2.2 netmask 255.255.255.0 up
Now you see that the VLAN 2subnet is up and running. See Example 6-14.
Example 6-14 VLAN 2 is running [root@lnxrh1 ~]# ifconfig hsi0.2
hsi0.2 Link encap:Ethernet HWaddr 06:00:F0:2E:00:06
inet addr:192.0.2.2 Bcast:192.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::400:f0ff:fe2e:6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:8192 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:492 (492.0 b)
6.7.2 Temporary VLAN for SLES11—VLAN 3 on LNXSU1
Further subdivide the HiperSockets network on the LNXSU1 system by setting up another VLAN. Example 6-15 shows the existing HiperSockets interface.
Example 6-15 HiperSockets is up lnxsu1:~ # ifconfig hsi1
hsi1 Link encap:Ethernet HWaddr 06:00:F0:2E:00:0A
inet addr:192.0.1.3 Bcast:192.0.1.255 Mask:255.255.255.0 inet6 addr: fe80::400:f0ff:fe2e:a/64 Scope:Link
UP BROADCAST RUNNING NOARP MULTICAST MTU:8192 Metric:1 RX packets:4 errors:0 dropped:0 overruns:0 frame:0 TX packets:50 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000
RX bytes:336 (336.0 b) TX bytes:4800 (4.6 Kb)
To create a temporary VLAN, follow these steps:
1. Create a new interface for VLAN 3 by using the vconfig command, as shown in Example 6-16.
Example 6-16 Adding a VLAN lnxsu1:~ # vconfig add hsi1 3
Added VLAN with VID == 3 to IF
-:hsi1:-2. Define the network address for hsi1.3, as shown in Example 6-17.
Example 6-17 Defining a network address
lnxsu1:~ # ifconfig hsi1.3 192.0.3.3 netmask 255.255.255.0 up
3. Example 6-18 shows the new interface hsi1.3.
Example 6-18 Displaying the interface lnxsu1:~ # cat /proc/net/vlan/config VLAN Dev name | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD hsi1.3 | 3 | hsi1
lnxsu1:~ # ifconfig hsi1.3
hsi1.3 Link encap:Ethernet HWaddr 06:00:F0:2E:00:0A
inet addr:192.0.3.3 Bcast:192.0.3.255 Mask:255.255.255.0 inet6 addr: fe80::400:f0ff:fe2e:a/64 Scope:Link
UP BROADCAST RUNNING NOARP MULTICAST MTU:8192 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:210 (210.0 b)
6.7.3 Verifying your setup
Using ping, confirm that the VLAN addresses 192.0.2.2 and 192.0.3.3 cannot be reached by the other Linux guest. They both can reach the VLAN-defined IP addresses of the z/OS LPARs and the z/VM stack that were defined in the previous sections, if they are on the same HiperSockets network and the same VLAN.
Note that the two Linux guests can still communicate without VLAN: 192.0.1.2 and 192.0.1.3 can still ping each other. If you want to remove these non-VLAN interfaces, you can remove their IP addresses from the respective config files, as shown in the next sections.
6.7.4 Permanent VLAN definition for Red Hat Enterprise Linux
To define a permanent VLAN for RHEL, follow these steps:
1. To make your VLAN interface permanent, create a new file
/etc/sysconfig/network-scripts/ifcfg-hsi0.2, as shown in Example 6-19.
Example 6-19 Content of /etc/sysconfig/network-scripts/ifcfg-hsi0.2 DEVICE=hsi0.2
BOOTPROTO=static IPADDR=192.0.2.2 NETMASK=255.255.255.0 ONBOOT=yes
VLAN=yes
2. If you want to change the definition of the base interface in
/etc/sysconfig/network-scripts/ifcfg-hsi0, you can do so, as shown in Example 6-20.
Example 6-20 Content of /etc/sysconfig/network-scripts/ifcfg-hsi0 DEVICE=hsi0
BOOTPROTO=static NETTYPE=qeth ONBOOT=yes
SUBCHANNELS=0.0.7000,0.0.7001,0.0.7002 TYPE=Ethernet
3. Now only VLAN traffic is possible over the HiperSockets network, as shown in Example 6-21.
Example 6-21 Result of ifconfig [root@lnxrh1 ~]# ifconfig [...]
hsi0 Link encap:Ethernet HWaddr 06:00:F0:2E:00:06 inet6 addr: fe80::400:f0ff:fe2e:6/64 Scope:Link
UP BROADCAST RUNNING NOARP MULTICAST MTU:8192 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:10 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:780 (780.0 b)
hsi0.2 Link encap:Ethernet HWaddr 06:00:F0:2E:00:06
inet addr:192.0.2.2 Bcast:192.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::400:f0ff:fe2e:6/64 Scope:Link
UP BROADCAST RUNNING NOARP MULTICAST MTU:8192 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0
6.7.5 Permanent VLAN definition for SLES11
To define a permanent VLAN for SLES, follow these steps:
1. To make your VLAN interface permanent, create a new file
/etc/sysconfig/network/ifcfg-hsi1.3, as shown in Example 6-22.
2. If wanted, the IP address information for the base interface in
/etc/sysconfig/network/ifcfg-hsi can be commented out, as shown in Example 6-23.
Example 6-23 Contents of /etc/sysconfig/network/ifcfg-hsi1
3. Now only VLAN traffic is possible over the HiperSockets network, as shown in Example 6-24.
Example 6-24 Result of ifconfig
lnxsu1:/etc/sysconfig/network # ifconfig [...]
hsi1 Link encap:Ethernet HWaddr 06:00:F0:2E:00:0A inet6 addr: fe80::400:f0ff:fe2e:a/64 Scope:Link
hsi1.3 Link encap:Ethernet HWaddr 06:00:F0:2E:00:0A
inet addr:192.0.3.3 Bcast:192.0.3.255 Mask:255.255.255.0