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

Implement Switchport Profiles #120

Open
spolack opened this issue Dec 20, 2021 · 3 comments
Open

Implement Switchport Profiles #120

spolack opened this issue Dec 20, 2021 · 3 comments

Comments

@spolack
Copy link
Member

spolack commented Dec 20, 2021

RFC

A switchport profile should be a hash of port config, which can be assigned to all or individual ports per device.

port_profile_name:
  networks: [network_name, ..]
  native_network: network_name
  poe_mode: type poe_mode

type poe_mode: [24_passive, 48_passive, af]

Following Profiles should be implicitly created. profile all is applied by default to every port

all:
  networks: [all networks]
  native_network: None
  poe_mode: af

all_24_passive:
  networks: [all networks]
  native_network: None
  poe_mode: 24_passive

{per network with vid}
$network_name:
  networks: [all networks]
  native_network: $network_name
  poe_mode: af
{end}

{per network with vid}
$network_name + "_24_passive":
  networks: [all networks]
  native_network: $network_name
  poe_mode: 24_passive
{end}

{per network with vid}
$network_name + "_mgmt":
  networks: [$network_name, mgmt]
  native_network: $network_name
  poe_mode: af
{end}

{per network with vid}
$network_name + "_mgmt_24_passive":
  networks: [$network_name, mgmt]
  native_network: $network_name
  poe_mode: 24_passive
{end}
@PolynomialDivision
Copy link
Contributor

Can you give a specif example, how a config would look like, for a site? I do not understand exactly each line of the template code you wrote.

@Noki
Copy link
Member

Noki commented Apr 17, 2022

Just wanted to point out two usecases:

  1. In a setup with a core router and multiple accesspoints that all have multiple LAN ports and a WAN port the WAN port could be used to connect the AP to the core router. All other LAN ports could be configured to use VLAN 40 so users could directly connect to the APs via cable and without having to deal with a VLAN configuration. This is a well known setup to most users. This could also be setup as private VLAN so all devices connected via LAN to an AP (pc, printer, nas, tv, ...) could communicate with each other but are isolated from the rest of the setup.
  2. Devices like a webcam or server that might not have or support VLAN tagging could be connected to a seperate LAN port that is assigned to a VLAN without filtering so it could be made accessible via Freifunk and the internet.

@spolack
Copy link
Member Author

spolack commented May 21, 2022

I just gave some different techniques to prepopulate the profiles a try and found a way to use loops in templates which doesnt feel too hackish. Not sure if they are better ways though.

Commit:
d2de94a

Resulting port_profiles variable for wilgu10 networks..

all:
  native_vlan: false
  poe_mode: af
  vlans: [10, 11, 20, 42, 40, 41, 50]
all_24_passive:
  mesh_sama: null
  native_vlan: 10
  poe_mode: af
  vlans: [10, 11, 20, 42, 40, 41, 50]
dhcp_24_passive:
  native_vlan: 40
  poe_mode: 24_passive
  vlans: [10, 11, 20, 42, 40, 41, 50]
dhcp_mgmt:
  native_vlan: 40
  poe_mode: af
  vlans: [40, 42]
dhcp_mgmt_24_passive:
  native_vlan: 41
  poe_mode: af
  prdhcp: null
  vlans: [10, 11, 20, 42, 40, 41, 50]
mesh_east_2g_24_passive:
  native_vlan: 20
  poe_mode: 24_passive
  vlans: [10, 11, 20, 42, 40, 41, 50]
mesh_east_2g_mgmt:
  native_vlan: 20
  poe_mode: af
  vlans: [20, 42]
mesh_east_2g_mgmt_24_passive:
  mgmt: null
  native_vlan: 42
  poe_mode: af
  vlans: [10, 11, 20, 42, 40, 41, 50]
mesh_sama_24_passive:
  native_vlan: 10
  poe_mode: 24_passive
  vlans: [10, 11, 20, 42, 40, 41, 50]
mesh_sama_mgmt:
  native_vlan: 10
  poe_mode: af
  vlans: [10, 42]
mesh_sama_mgmt_24_passive:
  mesh_zwingli: null
  native_vlan: 11
  poe_mode: af
  vlans: [10, 11, 20, 42, 40, 41, 50]
mesh_zwingli_24_passive:
  native_vlan: 11
  poe_mode: 24_passive
  vlans: [10, 11, 20, 42, 40, 41, 50]
mesh_zwingli_mgmt:
  native_vlan: 11
  poe_mode: af
  vlans: [11, 42]
mesh_zwingli_mgmt_24_passive:
  mesh_east_2g: null
  native_vlan: 20
  poe_mode: af
  vlans: [10, 11, 20, 42, 40, 41, 50]
mgmt_24_passive:
  native_vlan: 42
  poe_mode: 24_passive
  vlans: [10, 11, 20, 42, 40, 41, 50]
mgmt_mgmt:
  native_vlan: 42
  poe_mode: af
  vlans: [42, 42]
mgmt_mgmt_24_passive:
  dhcp: null
  native_vlan: 40
  poe_mode: af
  vlans: [10, 11, 20, 42, 40, 41, 50]
prdhcp_24_passive:
  native_vlan: 41
  poe_mode: 24_passive
  vlans: [10, 11, 20, 42, 40, 41, 50]
prdhcp_mgmt:
  native_vlan: 41
  poe_mode: af
  vlans: [41, 42]
prdhcp_mgmt_24_passive:
  native_vlan: 50
  poe_mode: af
  vlans: [10, 11, 20, 42, 40, 41, 50]
  w10host: null
w10host_24_passive:
  native_vlan: 50
  poe_mode: 24_passive
  vlans: [10, 11, 20, 42, 40, 41, 50]
w10host_mgmt:
  native_vlan: 50
  poe_mode: af
  vlans: [50, 42]
w10host_mgmt_24_passive:
  native_vlan: 50
  poe_mode: 24_passive
  vlans: [50, 42]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants