Configuring a second interface to use the same IP stack:
First, check to ensure that both devices can be detected:
; ls '#l0'
'#l0/ether0'
; ls '#l1'
'#l1/ether1'
If the device cannot be detected, you will see:
; ls '#l2'
ls: #l2: no free devices
Next, bind the device to a new IP stack in /net.alt, then use ipconfig to add the address:
; bind -b '#l1' /net.alt
; bind -b '#I1' /net.alt
; ip/ipconfig -x /net.alt -g 198.51.100.1 ether /net.alt/ether1 add 198.51.100.2 255.255.255.0
Replace 198.51.100.1 with your actual default gateway, 198.51.100.2 with your public IP address, 255.255.255.0 with your subnet mask.
If configured properly, /net.alt/iproute should show routes similar to these:
; cat /net.alt/iproute
0.0.0.0 /96 198.51.100.1 4 none 0 198.51.100.0 /120
0.0.0.0 /96 198.51.100.1 4 none 0 198.51.100.2 /128
From another machine, ping the IP address 198.51.100.2:
another% ip/ping 198.51.100.2
Then, on the machine with 198.51.100.2, verify with snoopy that packets are received on the correct interface with correct ethernet and correct IP address:
cpu% snoopy -f 'icmp' /net.alt/ether1
after optimize: ether(ip(icmp))
001703 ms
ether(s=00907fa36c07 d=f2b2b3daeb64 pr=0800 ln=78)
ip(s=172.56.234.40 d=198.51.100.2 id=0000 frag=0000 ttl=230 pr=1 ln=64)
icmp(t=EchoReq c=0 ck=c851 id=d809 seq=2a65)
dump(1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b)
002209 ms
ether(s=00907fa36c07 d=f2b2b3daeb64 pr=0800 ln=78)
ip(s=172.56.234.40 d=198.51.100.2 id=0000 frag=0000 ttl=230 pr=1 ln=64)
icmp(t=EchoReq c=0 ck=c850 id=d809 seq=2a66)
dump(1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b)