This example shows you how to configure VIPA under static routing, and how to switch
adapters when an adapter outage occurs.
About this task
Figure 1 shows the network
adapter configuration that is used in the example.
Procedure
Define the real interfaces.
[server]# ip addr add 10.1.0.2/16 dev encf500
[server]# ip link set dev encf500 up
[server]# ip addr add 10.2.0.2/16 dev ence400
[server]# ip link set dev ence400 up
If the dummy component was not compiled into the kernel,
ensure that the dummy module was loaded.
If necessary,
load it by issuing:
[server]# modprobe dummy
Create a dummy interface with a virtual IP address 198.51.100.100
and a netmask 255.255.255.0:
[server]# ip addr add 198.51.100.100/24 dev dummy0
[server]# ip link set dev dummy0 up
Enable the network devices for this VIPA so that it accepts
packets for this IP address.
IPv4
example:
[server]# qethconf vipa add 198.51.100.100encf500
qethconf: Added 198.51.100.100 to /sys/class/net/encf500/device/vipa/add4.
qethconf: For verification please use "qethconf ipa list"
[server]# qethconf vipa add 198.51.100.100ence400
qethconf: Added 198.51.100.100 to /sys/class/net/ence400/device/vipa/add4.
qethconf: For verification please use "qethconf ipa list"
For IPv6, the address is specified in IPv6 format:
[server]# qethconf vipa add 2002::1235:5678 encf500
qethconf: Added 2002:0000:0000:0000:0000:0000:1235:5678 to
/sys/class/net/encf500/device/vipa/add6.
qethconf: For verification please use "qethconf ipa list"
[server]# qethconf vipa add 2002::1235:5678 ence400
qethconf: Added 2002:0000:0000:0000:0000:0000:1235:5678 to
/sys/class/net/ence400/device/vipa/add6.
qethconf: For verification please use "qethconf ipa list"
Ensure that the addresses are set:
[server]# qethconf vipa list
vipa add 198.51.100.100encf500
vipa add 198.51.100.100ence400
Ensure that your service (such as the Apache web server)
listens to the virtual IP address.
Set up a route to the virtual IP address (static routing)
so that VIPA can be reached through the gateway with address 10.1.0.2.
[router]# ip route add 198.51.100.100 via 10.1.0.2
What to do next
Now assume that an adapter outage occurs. You must then:
Delete the previously created route.
[router]# ip route del 198.51.100.100
Create the alternative route to the virtual IP address.
[router]# ip route add 198.51.100.100 via 10.2.0.2