Configuring WPAR-specific routing
You can configure a WPAR to use its own routing table using the -i flag and the -I flag for the mkwpar command, the wparexec command, or the chwpar command.
By default, system and application workload partitions with active
network connections share the global system's routing table. To enable
WPAR-specific routing for a WPAR when
you are creating the WPAR,
add the -i flag to the command line of the mkwpar command
or the wparexec command. For system WPARs:
mkwpar -n wpar_name -N network_attributes -i ...
For application WPARs:
wparexec -N network_attributes -i ... -- /path/to/application arg1 arg2 ... argN
Using these commands will automatically create loopback, broadcast, and subnet routes appropriate to each configured address. If you do not specify any explicit routing table entries, the WPAR will only be able to communicate within its own subnets. You can configure explicit routing table entries with -I flag when you create the WPAR. You can configure zero or more explicit routing table entries. Each entry requires its own instance of the -I flag. Destination and gateway addresses can be specified by symbolic name or IP address.
For example, to configure a default route through a gateway with
symbolic name gateway.customer.com and a host route to myserver.customer.com
through gateway 192.168.1.1:
mkwpar -n wpar_name -N network_attributes -i -I rtdest=default rtgateway=gateway.customer.com \
-I rtdest=myserver.customer.com rttype=host rtgateway=192.168.1.1 ...
The netstat -r command can be used with the -@ flag
to view the WPAR-specific routing table for a WPAR at any time. If WPAR-specific
routing is disabled for the queried WPAR, the netstat -r command
will display the global routes. The output format is identical to
that of the netstat -r command without the -@ flag.
For example:
netstat -r -@ wpar_name
You can change the WPAR-specific routing characteristics for both
system WPARs and application WPARs using the chwpar command.
The changes can be performed on active WPARs or inactive WPARs. Changes
take effect immediately, and persist across system WPAR reboots. To disable
WPAR-specific routing, causing the affected WPAR to begin using the
global routing tables, use the following command:
chwpar -K -i wpar_name
To enable WPAR-specific routing and add a route for destinations
in subnet 224.128.9.0/24 through gateway 224.128.9.1 on interface
en4, use the following command::
chwpar -i -I rtdest=224.128.9.0 rtnetmask=255.255.255.0 rtgateway=224.128.9.1 rtinterface=en4 wpar_name
To delete an existing WPAR-specific route entry, you must provide
enough information to identify the entry being deleted. In most cases,
it is effective to use the same attributes provided when the route
was configured. For example, use the following command to remove the
route configured in the previous example:
chwpar -K -I rtdest=224.128.9.0 rtnetmask=255.255.255.0 rtgateway=224.128.9.1 rtinterface=en4 wpar_name