diff options
-rw-r--r-- | data/templates/pppoe/ip-pre-up.script.tmpl | 1 | ||||
-rw-r--r-- | data/templates/pppoe/ip-up.script.tmpl | 14 | ||||
-rw-r--r-- | interface-definitions/protocols-bgp.xml.in | 18 | ||||
-rw-r--r-- | op-mode-definitions/connect-disconnect.xml | 2 | ||||
-rw-r--r-- | op-mode-definitions/show-interfaces-wirelessmodem.xml | 4 | ||||
-rwxr-xr-x | src/completion/list_wlm_peers.sh | 6 | ||||
-rwxr-xr-x | src/conf_mode/interfaces-ethernet.py | 2 | ||||
-rwxr-xr-x | src/op_mode/show_vpn_ra.py | 4 |
8 files changed, 24 insertions, 27 deletions
diff --git a/data/templates/pppoe/ip-pre-up.script.tmpl b/data/templates/pppoe/ip-pre-up.script.tmpl index 9a7ba7d57..6a2d2af94 100644 --- a/data/templates/pppoe/ip-pre-up.script.tmpl +++ b/data/templates/pppoe/ip-pre-up.script.tmpl @@ -2,7 +2,6 @@ # As PPPoE is an "on demand" interface we need to re-configure it when it # becomes up - if [ "$6" != "{{ intf }}" ]; then exit fi diff --git a/data/templates/pppoe/ip-up.script.tmpl b/data/templates/pppoe/ip-up.script.tmpl index 697ebcc20..eacc37e4e 100644 --- a/data/templates/pppoe/ip-up.script.tmpl +++ b/data/templates/pppoe/ip-up.script.tmpl @@ -7,13 +7,14 @@ if [ "$6" != "{{ intf }}" ]; then fi {% if not on_demand %} -# See https://phabricator.vyos.net/T2248 & T2220. Determine if we are enslaved -# to a VRF, this is needed to properly insert the default route. - # add some info to syslog DIALER_PID=$(cat /var/run/{{ intf }}.pid) logger -t pppd[$DIALER_PID] "executing $0" +{% if default_route != 'none' -%} +# See https://phabricator.vyos.net/T2248 & T2220. Determine if we are enslaved +# to a VRF, this is needed to properly insert the default route. + SED_OPT="^ip route" VRF_NAME="" if [ -d /sys/class/net/{{ intf }}/upper_* ]; then @@ -27,21 +28,22 @@ if [ -d /sys/class/net/{{ intf }}/upper_* ]; then VRF_NAME="vrf ${VRF}" fi -{% if 'auto' in default_route -%} +{% if default_route == 'auto' -%} # Only insert a new default route if there is no default route configured routes=$(vtysh -c "show running-config" | sed -n "/${SED_OPT}/,/!/p" | grep 0.0.0.0/0 | wc -l) if [ "$routes" -ne 0 ]; then exit 1 fi -{% elif 'force' in default_route -%} +{% elif default_route == 'force' -%} # Retrieve current static default routes and remove it from the routing table vtysh -c "show running-config" | sed -n "/${SED_OPT}/,/!/p" | grep 0.0.0.0/0 | while read route ; do vtysh -c "conf t" ${VTY_OPT} -c "no ${route} ${VRF_NAME}" done -{% endif %} +{% endif %} # Add default route to default or VRF routing table vtysh -c "conf t" ${VTY_OPT} -c "ip route 0.0.0.0/0 {{ intf }} ${VRF_NAME}" logger -t pppd[$DIALER_PID] "added default route via {{ intf }} ${VRF_NAME}" +{% endif %} {% endif %} diff --git a/interface-definitions/protocols-bgp.xml.in b/interface-definitions/protocols-bgp.xml.in index 2932d890e..8cab34141 100644 --- a/interface-definitions/protocols-bgp.xml.in +++ b/interface-definitions/protocols-bgp.xml.in @@ -375,7 +375,7 @@ </leafNode> <leafNode name="disable-connected-check"> <properties> - <help>Disable check to see if EBGP peer's address is a connected route</help> + <help>Disable check to see if eBGP peer address is a connected route</help> <valueless/> </properties> </leafNode> @@ -528,7 +528,7 @@ </leafNode> <leafNode name="port"> <properties> - <help>Neighbor's BGP port</help> + <help>Neighbor BGP port</help> <valueHelp> <format><1-65535></format> <description>Neighbor BGP port number</description> @@ -605,7 +605,7 @@ </valueHelp> <valueHelp> <format>0</format> - <description>Don't hold timer</description> + <description>Hold timer disabled</description> </valueHelp> <constraint> <validator name="numeric" argument="--range 0-65535"/> @@ -662,7 +662,7 @@ <regex>(en|eth|br|bond|gnv|vxlan|wg|tun)[0-9]+</regex> </constraint> </properties> - </leafNode> + </leafNode> </children> </tagNode> <node name="parameters"> @@ -940,7 +940,7 @@ </node> <leafNode name="enforce-first-as"> <properties> - <help>Require first AS in the path to match peer's AS</help> + <help>Require first AS in the path to match peer AS number</help> <valueless/> </properties> </leafNode> @@ -951,7 +951,7 @@ <children> <leafNode name="stalepath-time"> <properties> - <help>Maximum time to hold onto restarting peer's stale paths</help> + <help>Maximum time to hold onto restarting neighbors stale paths</help> <valueHelp> <format><1-3600></format> <description>Hold time in seconds</description> @@ -983,7 +983,7 @@ </leafNode> <leafNode name="no-fast-external-failover"> <properties> - <help>Disable immediate session reset if peer's connected link goes down</help> + <help>Disable immediate session reset on peer link down event</help> <valueless/> </properties> </leafNode> @@ -1054,7 +1054,7 @@ </leafNode> <leafNode name="disable-connected-check"> <properties> - <help>Disable check to see if EBGP peer's address is a connected route</help> + <help>Disable check to see if eBGP peer address is a connected route</help> <valueless/> </properties> </leafNode> @@ -1199,7 +1199,7 @@ </valueHelp> <valueHelp> <format>0</format> - <description>Don't hold routes</description> + <description>Do not hold routes</description> </valueHelp> <constraint> <validator name="numeric" argument="--range 0-65535"/> diff --git a/op-mode-definitions/connect-disconnect.xml b/op-mode-definitions/connect-disconnect.xml index cbce2d9ef..f0fcef5da 100644 --- a/op-mode-definitions/connect-disconnect.xml +++ b/op-mode-definitions/connect-disconnect.xml @@ -10,6 +10,7 @@ <help>Bring up a connection-oriented network interface</help> <completionHelp> <path>interfaces pppoe</path> + <path>interfaces wirelessmodem</path> </completionHelp> </properties> <command>sudo ${vyos_op_scripts_dir}/connect_disconnect.py --connect "$3"</command> @@ -26,6 +27,7 @@ <help>Take down a connection-oriented network interface</help> <completionHelp> <path>interfaces pppoe</path> + <path>interfaces wirelessmodem</path> </completionHelp> </properties> <command>sudo ${vyos_op_scripts_dir}/connect_disconnect.py --disconnect "$3"</command> diff --git a/op-mode-definitions/show-interfaces-wirelessmodem.xml b/op-mode-definitions/show-interfaces-wirelessmodem.xml index d9690f521..b21bb520c 100644 --- a/op-mode-definitions/show-interfaces-wirelessmodem.xml +++ b/op-mode-definitions/show-interfaces-wirelessmodem.xml @@ -8,7 +8,7 @@ <properties> <help>Show Wireless Modem (WWAN) interface information</help> <completionHelp> - <script>${vyos_completion_dir}/list_wlm_peers.sh</script> + <path>interfaces wirelessmodem</path> </completionHelp> </properties> <command>${vyos_op_scripts_dir}/show_interfaces.py --intf="$4"</command> @@ -17,7 +17,7 @@ <properties> <help>Show specified wirelessmodem interface statistics</help> <completionHelp> - <script>${vyos_completion_dir}/list_wlm_peers.sh</script> + <path>interfaces wirelessmodem</path> </completionHelp> </properties> <command>/usr/sbin/pppstats $4</command> diff --git a/src/completion/list_wlm_peers.sh b/src/completion/list_wlm_peers.sh deleted file mode 100755 index 12dd00650..000000000 --- a/src/completion/list_wlm_peers.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -if [ -d /etc/ppp/peers ]; then - cd /etc/ppp/peers - ls wlm* -fi diff --git a/src/conf_mode/interfaces-ethernet.py b/src/conf_mode/interfaces-ethernet.py index f45a77a3e..0d73a30f1 100755 --- a/src/conf_mode/interfaces-ethernet.py +++ b/src/conf_mode/interfaces-ethernet.py @@ -202,7 +202,7 @@ def apply(eth): e.dhcp.v6.options['dhcpv6_temporary'] = True if eth['dhcpv6_pd']: - e.dhcp.v6.options['dhcpv6_pd'] = e['dhcpv6_pd'] + e.dhcp.v6.options['dhcpv6_pd'] = eth['dhcpv6_pd'] # ignore link state changes e.set_link_detect(eth['disable_link_detect']) diff --git a/src/op_mode/show_vpn_ra.py b/src/op_mode/show_vpn_ra.py index 2323193b1..73688c4ea 100755 --- a/src/op_mode/show_vpn_ra.py +++ b/src/op_mode/show_vpn_ra.py @@ -24,8 +24,8 @@ from vyos.util import popen def get_sessions(): absent_pptp = False absent_l2tp = False - pptp_cmd = ["accel-cmd", "-p 2003", "show sessions"] - l2tp_cmd = ["accel-cmd", "-p 2004", "show sessions"] + pptp_cmd = "accel-cmd -p 2003 show sessions" + l2tp_cmd = "accel-cmd -p 2004 show sessions" err_pattern = "^Connection.+failed$" # This value for chack only output header without sessions. len_def_header = 170 |