Running multiple instances of the TCP/IP stack
If your system has more than one Network Interface Card, you may need to run multiple instances of the TCP/IP stack.
If the NICs are the same type, you have to specify their PCI indexes (which you can determine by using the pci-tool command) when you start io-pkt. You can use stack instance numbers and prefixes to identify the instances of the stack. For example, let's start two stacks using the fictitious devnp-abc100 driver:
io-pkt-v4-hc -d abc100 pci=0x0
io-pkt-v4-hc -i2 -d abc100 pci=0x1 -ptcpip prefix=/sock2
In the second command line:
- The -i option tells io-pkt-v4-hc to use a stack instance number of 2 and to register itself as io-pkt2.
- The prefix option causes the stack to be registered as /sock2/dev/socket instead of the default, /dev/socket.
TCP/IP applications that wish to use the second stack must specify the SOCK environment variable. If you don't specify SOCK, the command uses the first TCP/IP stack. For example:
- SOCK=/sock2 telnet 10.59
- SOCK=/sock2 netstat -in
- SOCK=/sock2 ifconfig if_name 192.168.2.10 (where if_name is the interface name that the driver uses)
- SOCK=/sock2 pfctl -p /sock2/dev/pf... (Note that for pfctl you also need to use the -p option to identify the device.)
If you're using mount, you can add the stack instance number to the name of the manager. For example, to load lsm-pf-v4.so into the second instance of the stack, type:
mount -Tio-pkt2 lsm-pf-v4.so
