From 25eb6f338bb111ff3d45e09c578aa2b219e3432a Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Fri, 22 Nov 2024 13:25:52 +0000 Subject: [PATCH] T6906: IPoE-server add start-session option 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 --- data/templates/accel-ppp/ipoe.config.j2 | 4 +++- .../service_ipoe-server.xml.in | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/data/templates/accel-ppp/ipoe.config.j2 b/data/templates/accel-ppp/ipoe.config.j2 index 81f63c53b0..3cdae3f950 100644 --- a/data/templates/accel-ppp/ipoe.config.j2 +++ b/data/templates/accel-ppp/ipoe.config.j2 @@ -55,7 +55,9 @@ verbose=1 {% set range = 'range=' ~ iface_config.client_subnet ~ ',' if iface_config.client_subnet is vyos_defined else '' %} {% 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 '' %} -{{ tmp }},{{ shared }}mode={{ iface_config.mode | upper }},ifcfg=1,{{ range }}start=dhcpv4,ipv6=1{{ relay }}{{ giaddr }} +{% set start_map = {'dhcpv4': '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 }} {% 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 25bc43cc65..c730a5f7d3 100644 --- a/interface-definitions/service_ipoe-server.xml.in +++ b/interface-definitions/service_ipoe-server.xml.in @@ -131,6 +131,30 @@ shared + + + Start session options + + dhcpv4 unclassified-packet + + + auto + Start session with username as the interface name + + + dhcpv4 + Start session on DHCPv4 Discover + + + unclassified-packet + Start session on unclassified-packet + + + (auto|dhcpv4|unclassified-packet) + + + dhcpv4 + Client address pool