* Mon Dec 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-17.sme

- add vlan support on External Interface [SME: 12677]
This commit is contained in:
Jean-Philippe Pialasse 2024-12-23 01:05:02 -05:00
parent e3e3f2a823
commit 6547750d1e
6 changed files with 57 additions and 2 deletions

View File

@ -18,6 +18,15 @@ if (($c->get('EthernetDriver1')->value || 'unknown') eq 'dummy'){
if (($c->get('InternalInterface')->prop('NICBonding') || 'disabled') eq 'enabled'){ if (($c->get('InternalInterface')->prop('NICBonding') || 'disabled') eq 'enabled'){
push @adapters, "bond\tbond\t10:00:01:02:03:04\tBonding virtual Interface\tbond0"; push @adapters, "bond\tbond\t10:00:01:02:03:04\tBonding virtual Interface\tbond0";
} }
# if external VLAN is configured
if (($c->get('ExternalInterface')->prop('VLAN') || 'disabled') ne 'disabled'){
my $name= ($c->get('ExternalInterface')->prop('Name') eq "ppp0") ? $c->get('pppoe')->prop('PhysicalInterface') : $c->get('ExternalInterface')->prop('Name') ;
my $vlan=$c->get('ExternalInterface')->prop('VLAN');
$name=~ s/\.$vlan$//;
my ($newl) = grep ( /$name$/ , @adapters);
push @adapters, "$newl.$vlan";
}
#TODO if external virtual lan is configured
# Expand templates for every adapters found # Expand templates for every adapters found
foreach my $adapter (@adapters){ foreach my $adapter (@adapters){

View File

@ -0,0 +1,10 @@
{
$is_vlan = "no";
if ( ( exists $ExternalInterface{VLAN} && $ExternalInterface{VLAN} =~ /^\d+$/ ) && ($is_external || ( $ExternalInterface{Configuration} eq "pppoe") && $pppoe{PhysicalInterface} eq $THIS_DEVICE ) )
{
$ifup_this_device = "yes";
$is_vlan = "yes";
}
"";
}

View File

@ -0,0 +1,4 @@
{
return unless ($is_vlan eq "yes");
$OUT = "VLAN=yes\n";
}

View File

@ -0,0 +1 @@
8021q

View File

@ -559,9 +559,37 @@ ETHERNET_EXTERNAL:
goto ETHERNET_EXTERNAL; goto ETHERNET_EXTERNAL;
} }
goto ETHERNET_EXTERNAL_VLAN;# was SERVER_GATEWAY_DEDICATED;
}
#------------------------------------------------------------
ETHERNET_EXTERNAL_VLAN:
#------------------------------------------------------------
{
($rc, $choice) = $console->input_page
(
title => gettext("Select External Interface VLAN"),
text =>
gettext("Your ISP might have provided you a VLAN to use, if not leave empty."),
value => $db->get_prop('ExternalInterface', 'VLAN') || ""
);
goto ETHERNET_EXTERNAL unless ($rc == 0);
# sanitize if a previous VLAN is present
my $extIF = $db->get_prop('ExternalInterface', 'Name');
$extIF =~ s/\.\d+$//;
if ( $choice =~ /^\d+$/ )
{
$db->set_prop('ExternalInterface', 'VLAN', $choice );
$db->set_prop('ExternalInterface', 'Name', $extIF . ".$choice") unless $db->get_prop('ExternalInterface', 'Name') =~ /\.$choice$/;
}
else
{
$db->delete_prop('ExternalInterface', 'VLAN');
$db->set_prop('ExternalInterface', 'Name',$extIF);
}
goto SERVER_GATEWAY_DEDICATED; goto SERVER_GATEWAY_DEDICATED;
} }
#------------------------------------------------------------ #------------------------------------------------------------
SERVER_GATEWAY_DEDICATED: SERVER_GATEWAY_DEDICATED:
#------------------------------------------------------------ #------------------------------------------------------------

View File

@ -4,7 +4,7 @@ Summary: smeserver server and gateway - base module
%define name smeserver-base %define name smeserver-base
Name: %{name} Name: %{name}
%define version 11.0.0 %define version 11.0.0
%define release 16 %define release 17
Version: %{version} Version: %{version}
Release: %{release}%{?dist} Release: %{release}%{?dist}
License: GPL License: GPL
@ -184,6 +184,9 @@ fi
%changelog %changelog
* Mon Dec 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-17.sme
- add vlan support on External Interface [SME: 12677]
* Mon Dec 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-16.sme * Mon Dec 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-16.sme
- add kernel module support for rp-pppoe plugin [SME: 12678] - add kernel module support for rp-pppoe plugin [SME: 12678]
will allow faster fiber connexion when using multiple queue interface (RSS) will allow faster fiber connexion when using multiple queue interface (RSS)