Skip to content

Commit

Permalink
T1499: Allow for usage of systemd interface mappings (#103)
Browse files Browse the repository at this point in the history
* T1499: Allow for usage of systemd interface mappings

* T1499: Fix not working regex in ethernet interface parsing

(cherry picked from commit eebb654)
  • Loading branch information
runborg authored and c-po committed Jul 7, 2019
1 parent 059e215 commit 0beae43
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions sysconf/netdevice
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
lo loopback
eth ethernet
lan ethernet
eno ethernet
ens ethernet
enp ethernet
enx ethernet
ifb input
peth pseudo-ethernet
br bridge
Expand Down
3 changes: 2 additions & 1 deletion templates/interfaces/ethernet/node.def
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ type: txt
help: Ethernet interface name
allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=ethernet
val_help: <ethN>; Ethernet interface name
syntax:expression: pattern $VAR(@) "^(eth|lan)[0-9]+$" \
<en[ospx]N; Ethernet interface name
syntax:expression: pattern $VAR(@) "^((eth|lan)[0-9]+|(eno|ens|enp|enx).+)$" \
; "interface ethernet $VAR(@): not a valid name"

syntax:expression: exec \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type: txt
help: DHCP interface that supplies the local IP address for this tunnel
allowed:
local -a array ;
array=( /var/lib/dhcp/eth* /var/lib/dhcp/br* /var/lib/dhcp/bond* ) ;
array=( /var/lib/dhcp/en* /var/lib/dhcp/eth* /var/lib/dhcp/br* /var/lib/dhcp/bond* ) ;
echo -n ${array[@]##*/}
create:
sudo /opt/vyatta/sbin/vyatta-update-tunnel.pl --interface=$VAR(@) --tunnel=$VAR(../@) --option=create
Expand Down
2 changes: 1 addition & 1 deletion templates/system/ipv6/strict-dad/node.def
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ create:
delete:
sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/all/accept_dad"
sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/default/accept_dad"
for ifname in /sys/class/net/eth* ; do
for ifname in /sys/class/net/eth* /sys/class/net/en* ; do
if [ -d $ifname ]; then
ifname=${ifname#/sys/class/net/}
sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/$ifname/accept_dad"
Expand Down

0 comments on commit 0beae43

Please sign in to comment.