diff --git a/debian/wit-network-config.postinst b/debian/wit-network-config.postinst index e14bd84..1147001 100755 --- a/debian/wit-network-config.postinst +++ b/debian/wit-network-config.postinst @@ -98,7 +98,7 @@ case "$1" in # gathering defined interfaces - for if in mgmt mgmtgw ipmigw feth up ibgp gre; do + for if in mgmt mgmtgw ipmigw feth up ibgp gre customer; do for i in {1..4}; do #### for now we support/count only to 4 interfaces of each type, we can just raise this to whatever number we want (exeption mgmt) ifname=${if}${i} ifalias=$(dig_txt name.${ifname}.${HOSTNAME}) || true ## still thinking how to do this cleaner @@ -152,7 +152,7 @@ case "$1" in echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="'${ifmac}'", ATTR{type}=="1", NAME="'${ifname}'"' >>$UDEVCONFIG - if [[ $ifname = up? ]]; then + if [[ $ifname = up? ]] || [[ $ifname = customer? ]]; then ipv4=$(dig_txt ipv4.$ifname.${HOSTNAME}) ipv6=$(dig_txt ipv6.$ifname.${HOSTNAME}) @@ -160,9 +160,13 @@ case "$1" in peerv6=$(dig_txt peerv6.$ifname.${HOSTNAME}) || true ## we dont know if we will always have both available - [ -z $peerv4 ] || FRR_EDGE_NEIGH=" !!! neighbor $peerv4 peer-group eBGPv4\n$FRR_EDGE_NEIGH" - [ -z $peerv6 ] || FRR_EDGE_NEIGH=" !!! neighbor $peerv6 peer-group eBGPv6\n$FRR_EDGE_NEIGH" - + if [[ $ifname = up? ]]; then + [ -z $peerv4 ] || FRR_EDGE_NEIGH=" !!! neighbor $peerv4 peer-group eBGPv4\n$FRR_EDGE_NEIGH" + [ -z $peerv6 ] || FRR_EDGE_NEIGH=" !!! neighbor $peerv6 peer-group eBGPv6\n$FRR_EDGE_NEIGH" + elif [[ $ifname = customer? ]]; then + [ -z $peerv4 ] || FRR_EDGE_NEIGH=" !!! neighbor $peerv4 peer-group CUSTOMERv4\n$FRR_EDGE_NEIGH" + [ -z $peerv6 ] || FRR_EDGE_NEIGH=" !!! neighbor $peerv6 peer-group CUSTOMERv6\n$FRR_EDGE_NEIGH" + fi cat <<-EOF >>$IFCONFIG auto $ifname