Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sav: added switchconfig, changed corerouter #890

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 51 additions & 7 deletions locations/sav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,66 @@ contacts:
ipv6_prefix: 2001:bf7:830:ae00::/56

hosts:

- hostname: sav-core
role: corerouter
model: x86-64
model: "mikrotik_routerboard-750gr3"
host__rclocal__to_merge:
- '#'
- '# This script adjusts the configuration of vlans. This is especially'
- '# useful with uswflex and custom port configs'
- '#'
- ' '
- '. /lib/functions.sh'
- ' '
- 'handle_vlans() {'
- ' # untag the vlans on different ports based on their id'
- ' local uci_section="$1"'
- ' '
- ' config_get vlan "$uci_section" vlan'
- ' config_get ports "$uci_section" ports'
- ' '
- ' '
- ' case "$vlan" in'
- ' 10)'
- ' # untag payload traffic for Wave to Emma'
- " port_config='wan lan2:t lan3:t lan4:t lan5:t' ;;"
- ' 40)'
- ' # untag DHCP on port 2'
- " port_config='wan:t lan2 lan3:t lan4:t lan5:t' ;;"
- ' 50)'
- ' # untag port 3 for local backup uplink'
- " port_config='wan:t lan2:t lan3 lan4:t lan5:t' ;;"
- ' *)'
- ' # do nothing for the other vlans'
- ' return'
- ' esac'
- ' '
- ' # abort if config is applied already'
- ' if [ "$ports" = "$port_config" ]; then'
- ' printf "Vlan %d applied already.\n" "$vlan"'
- ' return'
- ' fi'
- ' '
- ' printf "Port number: %d\n" "$vlan"'
- ' printf "Port config: %s\n" "$port_config"'
- ' '
- ' printf "Configuring %s... " "$uci_section"'
- ' uci_set network "$uci_section" ports "$port_config"'
- ' printf "Done.\n"'
- '}'
- ' '
- 'config_load network'
- ' '
- 'config_foreach handle_vlans "bridge-vlan"'
- ' '
- 'uci commit network'

snmp_devices:

- hostname: sav-emma
address: 10.31.174.242
snmp_profile: af60

networks:

- vid: 10
role: mesh
name: mesh_emma
Expand All @@ -38,7 +85,6 @@ networks:

- vid: 40
role: dhcp
untagged: true
inbound_filtering: true
enforce_client_isolation: true
prefix: 10.31.174.248/30
Expand All @@ -57,9 +103,7 @@ networks:
sav-emma: 2

- vid: 50
ifname: eth1
role: uplink
untagged: true

- role: tunnel
ifname: ts_wg0
Expand Down