ref: 6e6ee9231bb2ef8e7fa2612a5866eba6efe45380
parent: ff7c9e61a2a2b208cd674dac9629845a3f80e411
author: jrmu <jrmu@cloud9p.org>
date: Thu Aug 1 08:02:09 EDT 2024
Add instructions for how to add a new interface to a new IP stack and add IP address, and also how to test it
--- a/ipconfig.ms
+++ b/ipconfig.ms
@@ -16,13 +16,39 @@
ls: #l2: no free devices
.P2
-Next, bind the device to the existing IP stack, then use ipconfig to add the address:
+Next, bind the device to a new IP stack in /net.alt, then use ipconfig to add the address:
.P1
-; bind -b '#l1' /net
-; ip/ipconfig ether /net/ether1 add 198.51.100.2 255.255.255.0
+; 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
.P2
-Replace 198.51.100.2 with your actual public IP address, and replace 255.255.255.0 with your actual subnet mask.
+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)