diff --git a/cmd/config.go b/cmd/config.go index b265615b..20a659a0 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -18,7 +18,7 @@ type Config struct { LoopbackIP string `required:"false" default:"10.0.0.11" desc:"set the loopback ip address that is used with BGP unnumbered" split_words:"true"` ASN string `required:"false" default:"420000011" desc:"set the ASN that is used with BGP"` SpineUplinks []string `required:"false" default:"swp31,swp32" desc:"set the ports that are connected to spines" envconfig:"spine_uplinks"` - ManagementGateway string `required:"false" default:"192.168.0.1" desc:"the default gateway for the management network" split_words:"true"` + ManagementGateway string `required:"false" default:"" desc:"the default gateway for the management network" split_words:"true"` ReconfigureSwitch bool `required:"false" default:"false" desc:"let metal-core reconfigure the switch" split_words:"true"` ReconfigureSwitchInterval time.Duration `required:"false" default:"10s" desc:"pull interval to fetch and apply switch configuration" split_words:"true"` AdditionalBridgeVIDs []string `required:"false" desc:"additional vlan ids that should be configured at the vlan-aware bridge" envconfig:"additional_bridge_vids"` diff --git a/cmd/internal/switcher/templates/test_data/dev/sonic_frr.conf b/cmd/internal/switcher/templates/test_data/dev/sonic_frr.conf index fb40ebce..d0c2b11e 100644 --- a/cmd/internal/switcher/templates/test_data/dev/sonic_frr.conf +++ b/cmd/internal/switcher/templates/test_data/dev/sonic_frr.conf @@ -53,7 +53,7 @@ router bgp 4200000010 neighbor swp3 interface peer-group FIREWALL ! address-family ipv4 unicast - redistribute connected route-map LOOPBACKS + redistribute connected route-map DENY_MGMT neighbor FIREWALL allowas-in 2 neighbor swp3 route-map fw-swp3-in in exit-address-family @@ -67,8 +67,9 @@ router bgp 4200000010 neighbor swp3 route-map fw-swp3-vni out exit-address-family ! -route-map LOOPBACKS permit 10 - match interface Loopback0 +route-map DENY_MGMT deny 10 + match interface eth0 +route-map DENY_MGMT permit 20 ! # route-maps for firewall@swp3 ip prefix-list fw-swp3-in-prefixes permit 10.0.2.1/32 le 32 diff --git a/cmd/internal/switcher/templates/test_data/lab/sonic_frr.conf b/cmd/internal/switcher/templates/test_data/lab/sonic_frr.conf index 249a096a..2738fe2a 100644 --- a/cmd/internal/switcher/templates/test_data/lab/sonic_frr.conf +++ b/cmd/internal/switcher/templates/test_data/lab/sonic_frr.conf @@ -53,7 +53,7 @@ router bgp 4200000010 neighbor swp3 interface peer-group FIREWALL ! address-family ipv4 unicast - redistribute connected route-map LOOPBACKS + redistribute connected route-map DENY_MGMT neighbor FIREWALL allowas-in 2 neighbor swp3 route-map fw-swp3-in in exit-address-family @@ -67,8 +67,9 @@ router bgp 4200000010 neighbor swp3 route-map fw-swp3-vni out exit-address-family ! -route-map LOOPBACKS permit 10 - match interface Loopback0 +route-map DENY_MGMT deny 10 + match interface eth0 +route-map DENY_MGMT permit 20 ! # route-maps for firewall@swp3 ip prefix-list fw-swp3-in-prefixes permit 10.0.2.1/32 le 32 diff --git a/cmd/internal/switcher/templates/test_data/notenants/sonic_frr.conf b/cmd/internal/switcher/templates/test_data/notenants/sonic_frr.conf index a68bf2c3..e784bf59 100644 --- a/cmd/internal/switcher/templates/test_data/notenants/sonic_frr.conf +++ b/cmd/internal/switcher/templates/test_data/notenants/sonic_frr.conf @@ -36,7 +36,7 @@ router bgp 4200000010 neighbor FIREWALL timers 2 8 ! address-family ipv4 unicast - redistribute connected route-map LOOPBACKS + redistribute connected route-map DENY_MGMT neighbor FIREWALL allowas-in 2 exit-address-family ! @@ -48,8 +48,9 @@ router bgp 4200000010 neighbor FIREWALL allowas-in 2 exit-address-family ! -route-map LOOPBACKS permit 10 - match interface Loopback0 +route-map DENY_MGMT deny 10 + match interface eth0 +route-map DENY_MGMT permit 20 ! ip route 0.0.0.0/0 192.168.0.254 nexthop-vrf mgmt ! diff --git a/cmd/internal/switcher/templates/tpl/sonic_frr.tpl b/cmd/internal/switcher/templates/tpl/sonic_frr.tpl index 79eff97d..2d81bdb5 100644 --- a/cmd/internal/switcher/templates/tpl/sonic_frr.tpl +++ b/cmd/internal/switcher/templates/tpl/sonic_frr.tpl @@ -58,7 +58,7 @@ router bgp {{ $ASN }} {{- end }} ! address-family ipv4 unicast - redistribute connected route-map LOOPBACKS + redistribute connected route-map DENY_MGMT neighbor FIREWALL allowas-in 2 {{- range $k, $f := .Ports.Firewalls }} neighbor {{ $f.Port }} route-map fw-{{ $k }}-in in @@ -76,8 +76,9 @@ router bgp {{ $ASN }} {{- end }} exit-address-family ! -route-map LOOPBACKS permit 10 - match interface Loopback0 +route-map DENY_MGMT deny 10 + match interface eth0 +route-map DENY_MGMT permit 20 ! {{- range $k, $f := .Ports.Firewalls }} # route-maps for firewall@{{ $k }}