From 6d8cd3530fc4a7a0385f2923fff341cddab2889f Mon Sep 17 00:00:00 2001 From: Alex Denes Date: Sun, 15 Oct 2023 12:21:58 +0000 Subject: [PATCH] Fix some wrong fields and add dhcp definition --- bgpgate.sh | 9 +++++---- generic.sh | 1 + netdev.sh | 28 ++++++++++++++++++++++++---- router.sh | 5 +++-- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/bgpgate.sh b/bgpgate.sh index 938e8c1..cd44a21 100755 --- a/bgpgate.sh +++ b/bgpgate.sh @@ -20,7 +20,8 @@ new_if_vrf "$VRF" 20 if_bridge_property 'mcast_snooping' "$IFACE" '0' '' # TODO: Remove such entries when bridges play well with multicasting if_bridge_property 'mcast_querier' "$IFACE" if_bridge_property 'mcast_mld_version' "$IFACE" '2' '' - new_forward "$IFACE" + if_forward "$IFACE" + if_dhcp "$IFACE" if_slave "$IFACE" "vnet0" new_if_phys "vnet0" @@ -30,20 +31,20 @@ new_if_vrf "$VRF" 20 IFACE="tristan" if_slave "$VRF" "$IFACE" new_if_wg "$IFACE" - new_forward "$IFACE" + if_forward "$IFACE" if_ip_addr "$IFACE" "fe80::1/64" if_route_vrf_addr "$VRF" "$IFACE" "2a04:5b81:2010::/48" IFACE="gustav" if_slave "$VRF" "$IFACE" new_if_wg "$IFACE" - new_forward "$IFACE" + if_forward "$IFACE" if_ip_addr "$IFACE" "fe80::1/64" if_route_vrf_addr "$VRF" "$IFACE" "2a04:5b81:2011::/48" IFACE="caskd" if_slave "$VRF" "$IFACE" new_if_wg "$IFACE" - new_forward "$IFACE" + if_forward "$IFACE" if_ip_addr "$IFACE" "fe80::1/64" if_route_vrf_addr "$VRF" "$IFACE" "2a04:5b81:2060::/48" diff --git a/generic.sh b/generic.sh index 6d20009..e799479 100755 --- a/generic.sh +++ b/generic.sh @@ -11,4 +11,5 @@ new_if_bridge "$IFACE" if_bridge_property 'mcast_snooping' "$IFACE" '0' '' if_bridge_property 'mcast_querier' "$IFACE" if_bridge_property 'mcast_mld_version' "$IFACE" '2' '' + if_dhcp "$IFACE" if_slave "$IFACE" "eth0" diff --git a/netdev.sh b/netdev.sh index e8a5907..1a2b11e 100755 --- a/netdev.sh +++ b/netdev.sh @@ -231,7 +231,7 @@ new_if_wg() { new_link "$if" # Secondary service for loading config - wgconf "$if" + if_wg_conf "$if" } new_if_vrf() { @@ -239,7 +239,7 @@ new_if_vrf() { local table="${2:?missing table}" local sname="interface.$if.create" - ifprepare "$if" "$sname" + bundle_stage_step_configure "$if" "$sname" install -Dm644 <( header_eb @@ -266,7 +266,7 @@ new_if_vlan() { local parent="$(echo $if | cut -d'-' -f1)" local sname="interface.$if.create" - ifprepare "$if" "$sname" + bundle_stage_step_configure "$if" "$sname" install -Dm644 <( header_eb @@ -428,6 +428,26 @@ EOF depends "$sname" interface."$if".create } +if_dhcp() { + local if="${1:?missing if}" + + local sname="interface.$if.dhcp" + bundle_stage_step_ready "$if" "$sname" + + install -Dm755 <( + header_eb + header_path + header_if "$if" + cat <