Modify the VBox DHCP server and statically configure front_addr.
authorMatt Birkholz <matt@birchwood-abbey.net>
Thu, 20 Nov 2025 22:39:00 +0000 (15:39 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Thu, 20 Nov 2025 22:39:00 +0000 (15:39 -0700)
Rather than let the test Front machine use DHCP to get some simulated
cloud-assigned IP address, statically configure it to the front_addr
(outside the DHCP server's pool).

README.org
private/core-wg0.conf
private/test-front-prep
public/vars.yml

index 74d36fb0e798b0d66123366b2810647a3aaad985..7ba676e733b5cb0486225a55fde0b55fd716dfe6 100644 (file)
@@ -747,7 +747,7 @@ the institute's Internet domain name.
 
 #+CAPTION: [[file:public/vars.yml][=public/vars.yml=]]
 #+BEGIN_SRC conf :tangle public/vars.yml
-front_addr: 192.168.15.3
+front_addr: 192.168.15.4
 #+END_SRC
 
 The example address is a private network address because the example
@@ -2143,7 +2143,7 @@ PostUp = resolvectl dns %i 192.168.56.1
 PostUp = resolvectl domain %i small.private
 
 [Peer]
-EndPoint = 192.168.15.3:39608
+EndPoint = 192.168.15.4:39608
 PublicKey = S+6HaTnOwwhWgUGXjSBcPAvifKw+j8BDTRfq534gNW4=
 AllowedIPs = 10.177.87.1
 AllowedIPs = 192.168.56.0/24
@@ -3637,7 +3637,7 @@ PostUp = wg set %i private-key /etc/wireguard/private-key
 
 # Front
 [Peer]
-EndPoint = 192.168.15.3:39608
+EndPoint = 192.168.15.4:39608
 PublicKey = S+6HaTnOwwhWgUGXjSBcPAvifKw+j8BDTRfq534gNW4=
 AllowedIPs = 10.177.87.1
 AllowedIPs = 10.177.87.0/24
@@ -6831,6 +6831,7 @@ VBoxManage natnetwork add --netname public \
                           --network 192.168.15.0/24 \
                           --enable --dhcp on --ipv6 off
 VBoxManage natnetwork start --netname public
+VBoxManage dhcpserver modify --network=public --lower-ip=192.168.15.5
 VBoxManage hostonlyif create # vboxnet0
 VBoxManage hostonlyif ipconfig vboxnet0 --ip=192.168.56.10
 VBoxManage hostonlyif create # vboxnet1
@@ -6840,14 +6841,14 @@ VBoxManage hostonlyif ipconfig vboxnet2 --ip=192.168.58.1
 #+END_SRC
 
 Note that only the NAT network ~public~ should have a DHCP server
-enabled, and it should not lease ~192.168.15.3~.  This works, so far.
-The VirtualBox DHCP service seems to start assigning IPs beginning
-with ~192.168.15.5~.  It is not simply disabled because Gate is
-expecting the service from its ISP.
+enabled (to simulate an ISP and cloud for ~gate~ and ~front~
+respectively).  Yet ~front~ is statically assigned an IP address
+outside the DHCP server's pool.  This ensures it gets ~front_addr~
+without more server configuration.
 
 Note also that actual ISPs and clouds will provide Gate and Front with
 public network addresses.  In this simulation "they" provide addresses
-on the private ~192.168.15.0/24~ NAT network.
+in ~192.168.15.0/24~, on the NAT network ~public~.
 
 ** The Test Machines
 
@@ -7101,7 +7102,7 @@ iface lo inet loopback
 # The primary network interface
 auto enp0s3
 iface enp0s3 inet static
-    address 192.168.15.3/24
+    address 192.168.15.4/24
     gateway 192.168.15.1
 
 # Testing interface
@@ -7385,7 +7386,7 @@ forwarding (and NATing).  On ~core~ (and ~gate~):
 
 #+BEGIN_SRC sh
 ping -c 1 8.8.4.4      # dns.google
-ping -c 1 192.168.15.3 # front_addr
+ping -c 1 192.168.15.4 # front_addr
 #+END_SRC
 
 ~gate~ and thus ~core~ should be able to resolve internal and public
@@ -7810,7 +7811,7 @@ seen.
 - Find it in =/home/dick/Maildir/new/=.
 - Re-configure Evolution on ~dick~.  Edit the ~dick@small.example.org~
   mail account (or create a new one?) so that the Receiving Email
-  Server name is ~192.168.15.3~, not ~mail.small.private~.  The
+  Server name is ~192.168.15.4~, not ~mail.small.private~.  The
   latter domain name will not work while the campus is disappeared.
   In actual use (with Front, not ~front~), the institute domain name
   could be used.
index 34d8734eb6d456c8911048a370435315b5b4090d..09519c4eccce0dc0ea01a36b13690aa84ccf3b50 100644 (file)
@@ -4,7 +4,7 @@ PostUp = wg set %i private-key /etc/wireguard/private-key
 
 # Front
 [Peer]
-EndPoint = 192.168.15.3:39608
+EndPoint = 192.168.15.4:39608
 PublicKey = S+6HaTnOwwhWgUGXjSBcPAvifKw+j8BDTRfq534gNW4=
 AllowedIPs = 10.177.87.1
 AllowedIPs = 10.177.87.0/24
index 69b3574260686b0c9308dfde5b04c5d37b08219a..ab3ca3873d00aa9bfdd0f2936ba1a8f539a0b11e 100755 (executable)
@@ -39,7 +39,7 @@ iface lo inet loopback
 # The primary network interface
 auto enp0s3
 iface enp0s3 inet static
-    address 192.168.15.3/24
+    address 192.168.15.4/24
     gateway 192.168.15.1
 
 # Testing interface
index 5a72f1f00c5df0e85541c3dd72f5d3abb93cea2a..0f8d819f5382f8fb1690a5dfc4e8e0c371bc440f 100644 (file)
@@ -1,6 +1,6 @@
 ---
 domain_name: small.example.org
 
-front_addr: 192.168.15.3
+front_addr: 192.168.15.4
 
 full_name: Small Institute LLC