diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2024-11-28 13:44:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-28 13:44:46 +0200 |
commit | 37859ee69da3e78a85d741de5c20edf227c548bb (patch) | |
tree | c12a5bf932a99ca5b9e1f3b3217fe8dd760a3d24 | |
parent | 2ad3c2860cd19708118d3328106e51605f96c288 (diff) | |
download | vyos-1x-37859ee69da3e78a85d741de5c20edf227c548bb.tar.gz vyos-1x-37859ee69da3e78a85d741de5c20edf227c548bb.zip |
T6906: IPoE-server add start-session option (#4206)
Add the abbility to start IPoE session by unclassified-packet.
It allows the cases when subscriber configures the address manually
(static) and accel-ppp can start session on any packet.
By default start session on DHCPv4 Discover packet.
set service ipoe-server interface eth1 start-session unclassified-packet
-rw-r--r-- | data/templates/accel-ppp/ipoe.config.j2 | 4 | ||||
-rw-r--r-- | interface-definitions/service_ipoe-server.xml.in | 24 |
2 files changed, 27 insertions, 1 deletions
diff --git a/data/templates/accel-ppp/ipoe.config.j2 b/data/templates/accel-ppp/ipoe.config.j2 index a10dcf2c1..34dfa529a 100644 --- a/data/templates/accel-ppp/ipoe.config.j2 +++ b/data/templates/accel-ppp/ipoe.config.j2 @@ -59,7 +59,9 @@ lua-file={{ lua_file }} {% set relay = ',' ~ 'relay=' ~ iface_config.external_dhcp.dhcp_relay if iface_config.external_dhcp.dhcp_relay is vyos_defined else '' %} {% set giaddr = ',' ~ 'giaddr=' ~ iface_config.external_dhcp.giaddr if iface_config.external_dhcp.giaddr is vyos_defined else '' %} {% set username = ',' ~ 'username=lua:' ~ iface_config.lua_username if iface_config.lua_username is vyos_defined else '' %} -{{ tmp }},{{ shared }}mode={{ iface_config.mode | upper }},ifcfg=1,{{ range }}start=dhcpv4,ipv6=1{{ relay }}{{ giaddr }}{{ username }} +{% set start_map = {'dhcp': 'dhcpv4', 'unclassified-packet': 'up', 'auto': 'auto'} %} +{% set start = start_map[iface_config.start_session] %} +{{ tmp }},{{ shared }}mode={{ iface_config.mode | upper }},ifcfg=1,{{ range }}start={{ start }},ipv6=1{{ relay }}{{ giaddr }}{{ username }} {% if iface_config.vlan_mon is vyos_defined %} vlan-mon={{ iface }},{{ iface_config.vlan | join(',') }} {% endif %} diff --git a/interface-definitions/service_ipoe-server.xml.in b/interface-definitions/service_ipoe-server.xml.in index 27a654f92..39cfb7889 100644 --- a/interface-definitions/service_ipoe-server.xml.in +++ b/interface-definitions/service_ipoe-server.xml.in @@ -131,6 +131,30 @@ </properties> <defaultValue>shared</defaultValue> </leafNode> + <leafNode name="start-session"> + <properties> + <help>Start session options</help> + <completionHelp> + <list>auto dhcp unclassified-packet</list> + </completionHelp> + <valueHelp> + <format>auto</format> + <description>Start session with username as the interface name</description> + </valueHelp> + <valueHelp> + <format>dhcp</format> + <description>Start session on DHCPv4 Discover</description> + </valueHelp> + <valueHelp> + <format>unclassified-packet</format> + <description>Start session on unclassified-packet</description> + </valueHelp> + <constraint> + <regex>(auto|dhcp|unclassified-packet)</regex> + </constraint> + </properties> + <defaultValue>dhcp</defaultValue> + </leafNode> <leafNode name="client-subnet"> <properties> <help>Client address pool</help> |