Skip to content

Commit

Permalink
T6906: IPoE-server add start-session option
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sever-sever committed Nov 22, 2024
1 parent b91aaed commit 25eb6f3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion data/templates/accel-ppp/ipoe.config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
24 changes: 24 additions & 0 deletions interface-definitions/service_ipoe-server.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,30 @@
</properties>
<defaultValue>shared</defaultValue>
</leafNode>
<leafNode name="start-session">
<properties>
<help>Start session options</help>
<completionHelp>
<list>dhcpv4 unclassified-packet</list>
</completionHelp>
<valueHelp>
<format>auto</format>
<description>Start session with username as the interface name</description>
</valueHelp>
<valueHelp>
<format>dhcpv4</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|dhcpv4|unclassified-packet)</regex>
</constraint>
</properties>
<defaultValue>dhcpv4</defaultValue>
</leafNode>
<leafNode name="client-subnet">
<properties>
<help>Client address pool</help>
Expand Down

0 comments on commit 25eb6f3

Please sign in to comment.