OpenWrt Forum Archive

Topic: Problem by connecting in the private APN

The content of this topic has been archived on 24 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I have a problem when I want to connect a modem EHS6T LAN in private APN, for which it is necessary to enter a user name and password. In another private APN that has no radius and no need to enter a username and password, modem connect immediately. There are no problems too,  when requesting a connection to the public APN, which also has a requirement for a username and password!

If you have any ideas, please!


Fri Jun  2 10:32:15 2017 daemon.notice netifd: Interface '3gwan' is setting up now
Fri Jun  2 10:32:17 2017 user.notice ./3g.sh: MCCMNC: , APN: myAPN.si, USER: username, PWD: password, DNS: , SIMPIN:
Fri Jun  2 10:32:17 2017 daemon.notice pppd[4309]: pppd 2.4.7 started by root, uid 0
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: abort on (BUSY)
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: abort on (NO CARRIER)
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: abort on (ERROR)
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: report (CONNECT)
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: timeout set to 10 seconds
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: send (AT&F^M)
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: expect (OK)
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: AT&F^M^M
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: OK
Fri Jun  2 10:32:18 2017 local2.info chat[4311]:  -- got it
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: send (ATE1^M)
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: expect (OK)
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: ^M
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: ATE1^M^M
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: OK
Fri Jun  2 10:32:18 2017 local2.info chat[4311]:  -- got it
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: send (AT+CGDCONT=1,"IP","myAPN.si"^M)
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: timeout set to 30 seconds
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: expect (OK)
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: ^M
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: AT+CGDCONT=1,"IP","myAPN.si"^M^M
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: OK
Fri Jun  2 10:32:18 2017 local2.info chat[4311]:  -- got it
Fri Jun  2 10:32:18 2017 local2.info chat[4311]: send (ATD*99***1#^M)
Fri Jun  2 10:32:19 2017 local2.info chat[4311]: expect (CONNECT)
Fri Jun  2 10:32:19 2017 local2.info chat[4311]: ^M
Fri Jun  2 10:32:19 2017 local2.info chat[4311]: ATD*99***1#^M^M
Fri Jun  2 10:32:19 2017 local2.info chat[4311]: CONNECT
Fri Jun  2 10:32:19 2017 local2.info chat[4311]:  -- got it
Fri Jun  2 10:32:19 2017 local2.info chat[4311]: send ( ^M)
Fri Jun  2 10:32:19 2017 daemon.info pppd[4309]: Serial connection established.
Fri Jun  2 10:32:19 2017 kern.info kernel: [ 1598.700000] 3g-3gwan: renamed from ppp0
Fri Jun  2 10:32:19 2017 daemon.info pppd[4309]: Using interface 3g-3gwan
Fri Jun  2 10:32:19 2017 daemon.notice pppd[4309]: Connect: 3g-3gwan <--> /dev/ttyACM4
Fri Jun  2 10:32:20 2017 daemon.notice pppd[4309]: PAP authentication succeeded
Fri Jun  2 10:32:21 2017 daemon.info pppd[4309]: LCP terminated by peer
Fri Jun  2 10:32:22 2017 daemon.notice pppd[4309]: Modem hangup
Fri Jun  2 10:32:22 2017 daemon.notice pppd[4309]: Connection terminated.
Fri Jun  2 10:32:23 2017 daemon.info pppd[4309]: Exit.
Fri Jun  2 10:32:23 2017 daemon.notice netifd: Interface '3gwan' is now down


Miloš

Since the 3G modem is working correctly with some APNs, then I'd suggest checking if you can increase the log level of the pppd for the connection which doesn't work. While this doesn't immediately solve the problem at hand, it should give you more information on what exactly is going wrong.

To do this, append a

option pppd_options 'debug'

into your config in /etc/config/network, where you specify the username and password for the PPP connection. If you're using some other means of configuring the pppd,  find the appropriate place to embed the same option.

If you want to get up, close and familiar with PPP, here's a good read: http://www.tcpipguide.com/free/t_Pointt … colPPP.htm

Also, for more options that you can put to a 'pppd_options' field, check https://ppp.samba.org/pppd.html

(Last edited by Antek on 2 Jun 2017, 11:50)

Thanks for replay. Here are details:


Fri Jun  2 13:22:05 2017 daemon.debug pppd[3207]: Script USE_APN=myapn.si DIALNUMBER=*99***1# /usr/sbin/chat -t5 -v -E -f /etc/chatscripts/3g.chat finished (pid 3208), status = 0x0
Fri Jun  2 13:22:05 2017 daemon.info pppd[3207]: Serial connection established.
Fri Jun  2 13:22:05 2017 daemon.debug pppd[3207]: using channel 67
Fri Jun  2 13:22:05 2017 kern.info kernel: [  306.920000] 3g-3gwan: renamed from ppp0
Fri Jun  2 13:22:05 2017 daemon.info pppd[3207]: Using interface 3g-3gwan
Fri Jun  2 13:22:05 2017 daemon.notice pppd[3207]: Connect: 3g-3gwan <--> /dev/ttyACM4
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <auth pap> <magic 0x8c65830a> <pcomp> <accomp>]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x88839a26>]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: sent [LCP ConfRej id=0x1 <pcomp> <accomp>]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x88839a26>]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: rcvd [LCP ConfReq id=0x2 <asyncmap 0x0> <auth pap> <magic 0x8c65830a>]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: sent [LCP ConfAck id=0x2 <asyncmap 0x0> <auth pap> <magic 0x8c65830a>]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: sent [LCP EchoReq id=0x0 magic=0x88839a26]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: sent [PAP AuthReq id=0x1 user="username" password=<hidden>]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: rcvd [LCP EchoRep id=0x0 magic=0x8c65830a]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: rcvd [PAP AuthAck id=0x1 ""]
Fri Jun  2 13:22:06 2017 daemon.notice pppd[3207]: PAP authentication succeeded
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: sent [IPV6CP ConfReq id=0x1 <addr fe80::b072:3255:1277:9089>]
Fri Jun  2 13:22:07 2017 daemon.debug pppd[3207]: rcvd [LCP TermReq id=0x3]
Fri Jun  2 13:22:07 2017 daemon.info pppd[3207]: LCP terminated by peer
Fri Jun  2 13:22:07 2017 daemon.debug pppd[3207]: sent [LCP TermAck id=0x3]
Fri Jun  2 13:22:08 2017 daemon.notice pppd[3207]: Modem hangup
Fri Jun  2 13:22:08 2017 daemon.notice pppd[3207]: Connection terminated.
Fri Jun  2 13:22:09 2017 daemon.info pppd[3207]: Exit.
Fri Jun  2 13:22:09 2017 daemon.notice netifd: Interface '3gwan' is now down
Fri Jun  2 13:22:09 2017 daemon.notice netifd: Interface '3gwan' is setting up now
Fri Jun  2 13:22:11 2017 user.notice ./3g.sh: MCCMNC: , APN: myapn.si, USER: username, PWD: password, DNS: , SIMPIN:
Fri Jun  2 13:22:11 2017 daemon.notice pppd[3265]: pppd 2.4.7 started by root, uid 0


Miloš

Add this line to your configuration and try again:

option 'pppd_options' 'noipdefault'

In configuration /etc/config/network is:

config interface '3gwan'
    option proto '3g'
    option device '/dev/ttyACM4'
    option service 'umts'
    option 'pppd_options' 'noipdefault'
    option pppd_options 'debug'
    option apn 'myapn.si'
    option username 'myusername'
    option password 'mypassword'
    option delegate '0'

and i have no luck jet.

Move the 'noipdefault' to the same line with the 'debug'

option pppd_options 'debug noipdefault'

This ensures that both options are in effect.

Also, from your log:

Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
Fri Jun  2 13:22:06 2017 daemon.debug pppd[3207]: sent [IPV6CP ConfReq id=0x1 <addr fe80::b072:3255:1277:9089>]
Fri Jun  2 13:22:07 2017 daemon.debug pppd[3207]: rcvd [LCP TermReq id=0x3]

The peer is terminating the session immediately after receiving your request for IPV6CP. Try disabling IPV6CP on the pppd by modifying the pppd options appropriately:

option pppd_options 'debug noipdefault noipv6'

See if these help.

(Last edited by Antek on 2 Jun 2017, 14:55)

Hello,
progress is shown. Now the script looks like this:

     config interface '3gwan'
          option proto '3G'
          option device '/ dev / ttyACM4'
          option service 'UMTS'
          option pppd_options 'debug noipdefault noipv6'
          option APN 'myapn.si'
          option username 'myusername'
          option password 'mypassword'
          option demand '10'
          Keepalive option '2 5'

Modem is now connected, but the problem is, because modem do not get a wright IP address. Now the IP is 10.64.64.64 it should be 10.247.149.6!?

Here is log:

Mon Jun  5 09:07:13 2017 daemon.notice netifd: Interface '3gwan' is setting up now
Mon Jun  5 09:07:15 2017 user.notice ./3g.sh: MCCMNC: , APN: myapn.si, USER: myusername, PWD: mypassword, DNS: , SIMPIN:
Mon Jun  5 09:07:15 2017 daemon.notice pppd[1580]: pppd 2.4.7 started by root, uid 0
Mon Jun  5 09:07:15 2017 daemon.info pppd[1580]: Using interface 3g-3gwan
Mon Jun  5 09:07:15 2017 daemon.notice pppd[1580]: local  IP address 10.64.64.64
Mon Jun  5 09:07:15 2017 daemon.notice pppd[1580]: remote IP address 10.112.112.112
Mon Jun  5 09:07:15 2017 kern.info kernel: [ 1395.470000] 3g-3gwan: renamed from ppp0

mmilos wrote:

Modem is now connected, but the problem is, because modem do not get a wright IP address. Now the IP is 10.64.64.64 it should be 10.247.149.6!?

Please elaborate a little bit. Why do you think the modem should get the 10.247.149.6 address? Nothing in your logfiles or configs indicate that things should be so.

The local IP address can be specified by a command-line option, or it can be deduced automatically from the hostname of your local device. The latter occurs when the 'noipdefault' option is not present.

When the 'noipdefault' option is present, it configures pppd so that the peer will supply an IP address for you. So, in this specific case, the peer has assigned the IP address 10.64.64.64 for your host. You can check 'ifconfig' output after the link is established to ensure that this address was indeed assigned to the interface.

On the other side I have a Radius server that assigns SIM card fixed IP address, which must be in my case 10.247.149.6!

Then I'd look for the problem from the server end. If the client informs the dial-in server that it wants the dial-in server to assign itself an IP address, does the dial-in server fetch the address properly from the Radius server?

Perhaps the IPCP implementation of your server end is buggy? You can try changing the 'noipdefault' option to read 'noip' on the OpenWRT router's config. This disables IPCP completely. You can then add the desired local IP address as first item in the pppd_options string.

Before doing that, I'd first look into the IPCP config of your server end, and see if all the necessary bells and whistles are in place in order for it to use RADIUS as the source of the connection-related details.

When I insert SIM card in another device, connection establishing immediately and always with the same IP addres, so i think there is no problem on server end.

Can you describe me the solution, how to enter IP Address detailed?

Your configuration also doesn't specify the SIM-card's pincode. Perhaps that is part of the problem? If the SIM card is locked, the modem dials into the network without identification, and this might be the reason why the RADIUS doesn't assign the correct IP.

To test this, you can try the following config:

config interface '3gwan'
          option proto '3G'
          option device '/dev/ttyACM4'
          option pincode 'yourpincode'
          option service 'UMTS'
          option pppd_options 'debug noipv6'
          option APN 'myapn.si'
          option username 'myusername'
          option password 'mypassword'
          option demand '10'
          option keepalive '5'

And if that doesn't work, you should be able to force the local IP address with the following config:

config interface '3gwan'
          option proto '3G'
          option device '/dev/ttyACM4'
          option service 'UMTS'
          option pppd_options '10.247.149.6 debug noip noipv6'
          option APN 'myapn.si'
          option username 'myusername'
          option password 'mypassword'
          option demand '10'
          option keepalive '5'

Read more from https://wiki.openwrt.org/doc/recipes/3gdongle and https://wiki.openwrt.org/doc/uci/networ … ts_or_gprs

If i try to force IP i get this log:

Mon Jun  5 13:49:32 2017 daemon.notice netifd: Interface '3gwan' is setting up now
Mon Jun  5 13:49:34 2017 user.notice ./3g.sh: MCCMNC: , APN: myapn.si, USER: myusername, PWD: mypassword, DNS: , SIMPIN: 1111
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2740): SIM ready
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2740): PIN set successfully
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757): /usr/sbin/pppd: unrecognized option '10.249.143.6'
Mon Jun  5 13:49:35 2017 daemon.err pppd[2757]: unrecognized option '10.249.143.6'
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757): pppd version 2.4.7
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757): Usage: /usr/sbin/pppd [ options ], where options are:
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757):     <device>    Communicate over the named device
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757):     <speed>        Set the baud rate to <speed>
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757):     <loc>:<rem>    Set the local and/or remote interface IP
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757):             addresses.  Either one may be omitted.
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757):     asyncmap <n>    Set the desired async map to hex <n>
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757):     auth        Require authentication from peer
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757):         connect <p>     Invoke shell command <p> to set up the serial line
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757):     crtscts        Use hardware RTS/CTS flow control
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757):     defaultroute    Add default route through interface
Mon Jun  5 13:49:35 2017 daemon.notice netifd: 3gwan (2757):     file <f>    Take options from file <f>
Mon Jun  5 13:49:35 2017 daemon.notice netifd: Interface '3gwan' is now down

Apparently you cannot force the local IP address through the pppd_options then. So, the second config doesn't work at all.

You'll need to look into the details of why the SIM and IP address mapping doesn't work correctly in the server end. Can the server-side provide any logs on why it assigned a specific IP address to a client? Did you try the first config with the pincode? Did it change anything?

Yes, i try the first config, but result is the same i still get default IP 10.64.64.64)!
The problem is, because i do not have access to the log file on server end.

I'm out of ideas then. Maybe you can monitor the traffic generated by the other device, where things seem to work correctly? See if it's debug output looks similar to the one generated by OpenWRT, spot the differences and work out from there.

The discussion might have continued from here.