Skip to content

Commit

Permalink
Fix for PXE Vlan (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Sep 4, 2023
1 parent 68c5486 commit 32b105a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
7 changes: 4 additions & 3 deletions cmd/internal/switcher/templates/test_data/dev/sonic_frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions cmd/internal/switcher/templates/test_data/lab/sonic_frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
!
Expand All @@ -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
!
Expand Down
7 changes: 4 additions & 3 deletions cmd/internal/switcher/templates/tpl/sonic_frr.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down

0 comments on commit 32b105a

Please sign in to comment.