diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-11-13 10:18:27 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-11-13 10:20:43 +0100 |
commit | 62320efc3866fa582852258846c15bfa09a92720 (patch) | |
tree | e0a9979aff45a0b8d0135f0a7028e059af972ab8 | |
parent | 35bc7d9d0fc1b3fe2dd87915a65634ef66d7a3b9 (diff) | |
download | vyos-1x-62320efc3866fa582852258846c15bfa09a92720.tar.gz vyos-1x-62320efc3866fa582852258846c15bfa09a92720.zip |
wwan: T3065: add IPv6 support for wirelessmodem interfaces
-rw-r--r-- | data/templates/wwan/chat.tmpl | 4 | ||||
-rw-r--r-- | data/templates/wwan/peer.tmpl | 6 | ||||
-rwxr-xr-x | src/conf_mode/interfaces-wirelessmodem.py | 11 |
3 files changed, 15 insertions, 6 deletions
diff --git a/data/templates/wwan/chat.tmpl b/data/templates/wwan/chat.tmpl index a3395c057..386af37e6 100644 --- a/data/templates/wwan/chat.tmpl +++ b/data/templates/wwan/chat.tmpl @@ -1,6 +1,10 @@ ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT DELAYED '' AT OK ATZ +{% if ipv6 is defined and ipv6.address is defined and ipv6.address.autoconf is defined %} +OK 'AT+CGDCONT=1,"IPV4V6","{{ apn }}"' +{% else %} OK 'AT+CGDCONT=1,"IP","{{ apn }}"' +{% endif %} OK ATD*99# CONNECT '' diff --git a/data/templates/wwan/peer.tmpl b/data/templates/wwan/peer.tmpl index e23881bf8..2807a79a4 100644 --- a/data/templates/wwan/peer.tmpl +++ b/data/templates/wwan/peer.tmpl @@ -4,15 +4,19 @@ ifname {{ ifname }} ipparam {{ ifname }} linkname {{ ifname }} + {{ "usepeerdns" if no_peer_dns is defined }} # physical device {{ device }} lcp-echo-failure 0 115200 debug -debug mtu {{ mtu }} mru {{ mtu }} +{% if ipv6 is defined and ipv6.address is defined and ipv6.address.autoconf is defined %} ++ipv6 +ipv6cp-use-ipaddr +{% endif %} nodefaultroute ipcp-max-failure 4 ipcp-accept-local diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py index 2da1f0863..bce3405d0 100755 --- a/src/conf_mode/interfaces-wirelessmodem.py +++ b/src/conf_mode/interfaces-wirelessmodem.py @@ -42,6 +42,7 @@ def get_config(config=None): conf = Config() base = ['interfaces', 'wirelessmodem'] wwan = get_interface_dict(conf, base) + return wwan def verify(wwan): @@ -90,21 +91,21 @@ def generate(wwan): wwan['device'] = find_device_file(wwan['device']) # Create PPP configuration files - render(config_wwan, 'wwan/peer.tmpl', wwan) + render(config_wwan, 'wwan/peer.tmpl', wwan, trim_blocks=True) # Create PPP chat script - render(config_wwan_chat, 'wwan/chat.tmpl', wwan) + render(config_wwan_chat, 'wwan/chat.tmpl', wwan, trim_blocks=True) # generated script file must be executable # Create script for ip-pre-up.d render(script_wwan_pre_up, 'wwan/ip-pre-up.script.tmpl', - wwan, permission=0o755) + wwan, trim_blocks=True, permission=0o755) # Create script for ip-up.d render(script_wwan_ip_up, 'wwan/ip-up.script.tmpl', - wwan, permission=0o755) + wwan, trim_blocks=True, permission=0o755) # Create script for ip-down.d render(script_wwan_ip_down, 'wwan/ip-down.script.tmpl', - wwan, permission=0o755) + wwan, trim_blocks=True, permission=0o755) return None |