Move campus host config into /etc/network/interfaces

Make hosts/campus-host{1,2}_interfaces the source of truth for the
campus host IP and default route, and have clab simply invoke 'ifup
eth1' at container start to apply it. Previously the bound interfaces
file was unused and the real config lived in the YAML exec block,
which was misleading.

BusyBox ifup in the network-multitool image needs 'address' plus
'netmask' rather than a CIDR, so split the address accordingly. Also
add 'post-up ip route replace default via <fabric-gw>' so the fabric
default overrides the management DHCP default even when one is already
installed.
This commit is contained in:
2026-04-23 16:20:29 +00:00
parent 97fbc1cebe
commit 46c68b42bd
3 changed files with 8 additions and 8 deletions

View File

@@ -277,9 +277,7 @@ topology:
binds:
- hosts/campus-host1_interfaces:/etc/network/interfaces
exec:
- ip link set dev eth1 up
- ip addr add 10.60.60.101/24 dev eth1
- ip route replace default via 10.60.60.1
- ifup eth1
campus-host2:
kind: linux
@@ -290,9 +288,7 @@ topology:
binds:
- hosts/campus-host2_interfaces:/etc/network/interfaces
exec:
- ip link set dev eth1 up
- ip addr add 10.60.70.102/24 dev eth1
- ip route replace default via 10.60.70.1
- ifup eth1
links:
# =====================================================