<div dir="ltr"><div>Unfortunately, my ISP only accepts PAP authentication and as a result of PPPD's<br></div><div>natural behaviour, I am rendered unable to connect with my USB 3G modem onto<br>the network.<br><br></div>
<div>This patch is supposed to introduce a new configuration option for the 'mobile_ppp'<br>connection type:<br><br></div><div>Auth=<br><br></div><div>It is an array of authentication methods, those prefaced with '!' will become 'refuse-opt',<br>
and otherwise will become 'require', in the resulting 'options' file.<br><br></div><div>Something I've patched up that works, cheers!<br>---<br>diff --git a/docs/examples/mobile_ppp b/docs/examples/mobile_ppp<br>
index f3b0b8a..02be7a4 100644<br>--- a/docs/examples/mobile_ppp<br>+++ b/docs/examples/mobile_ppp<br>@@ -10,6 +10,9 @@ Connection=mobile_ppp<br> # Use DNS provided by the peer (default: true)<br> #UsePeerDNS=true<br> <br>
+# Force authentication method<br>+#Auth=('pap')<br>+<br> # The user and password are not always required<br> #User='<a href="mailto:example@yourprovider.com">example@yourprovider.com</a>'<br> #Password='very secret'<br>
diff --git a/docs/netctl.profile.5.txt b/docs/netctl.profile.5.txt<br>index b1ccde1..5b05ec7 100644<br>--- a/docs/netctl.profile.5.txt<br>+++ b/docs/netctl.profile.5.txt<br>@@ -361,6 +361,12 @@ type:<br> 'UsePeerDNS='::<br>
     Use the DNS provided by the peer (defaults to `true')<br> <br>+'Auth='::<br>+    Define disallowed and allowed authentication methods.<br>+    Those prefaced with ! will be refused, and specified will be<br>
+    required. E.g. `Auth=('!chap' 'eap')' will refuse CHAP, but require<br>+    EAP.<br>+<br> 'User=' and 'Password='::<br>     The username and password to connect with. These are unset by<br>
     default, as they are often not required.<br>diff --git a/src/lib/connections/mobile_ppp b/src/lib/connections/mobile_ppp<br>index b966390..daac9e5 100644<br>--- a/src/lib/connections/mobile_ppp<br>+++ b/src/lib/connections/mobile_ppp<br>
@@ -13,6 +13,10 @@ quote_word() {<br> mobile_ppp_up() {<br>     local cfg<br>     local chat<br>+    local auth_require=('chap' 'mppe' 'mppe-40' 'mppe-128' 'mschap' \<br>+                        'mschap-v2' 'eap' 'pap')<br>
+    local auth_refuse=('chap' 'mschap' 'mschap-v2' 'eap' 'pap')<br>+<br> <br>     mkdir -p "$STATE_DIR/mobile_ppp.${Interface}.${Profile}/"<br>     chmod 700 "$STATE_DIR/mobile_ppp.${Interface}.${Profile}/"<br>
@@ -48,6 +52,21 @@ EOF<br>         echo "usepeerdns" >> "${cfg}"<br>     fi<br> <br>+    # Generate authentication settings<br>+    for opt in ${Auth[@]}; do<br>+        for authmeth in ${auth_require[@]}; do<br>
+            if [[ $opt = "$authmeth" ]]; then<br>+                echo "require-$authmeth" >> "${cfg}"<br>+            fi<br>+        done<br>+<br>+        for authmeth in ${auth_refuse[@]}; do<br>
+            if [[ $opt = "!$authmeth" ]]; then<br>+                echo "refuse-$authmeth" >> "${cfg}"<br>+            fi<br>+        done<br>+    done<br>+<br>     # Writes username and password<br>
     echo "noauth" >> "${cfg}"<br>     echo "hide-password" >> ${cfg}<br>--<br></div></div>