Cannot to SSH while PPP activated

Hi

I successfully get an IP with the script “sudo pon” as stated in the tutorials.

The raspberry is connected both to wlan0 and ppp0 at this time.

eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether dc:a6:32:bf:e0:8b txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.210.129.47 netmask 255.255.255.255 destination 10.64.64.64
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 4 bytes 52 (52.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10 bytes 370 (370.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.3 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::e2e0:312f:d055:1029 prefixlen 64 scopeid 0x20
inet6 2a01:e0a:9c7:a320:5212:de61:e90c:9e5 prefixlen 64 scopeid 0x0
ether dc:a6:32:bf:e0:8c txqueuelen 1000 (Ethernet)
RX packets 18183 bytes 2655130 (2.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 41723 bytes 50793035 (48.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Once done, I cannot access anymore the RPI through ssh connection, which is NAT routed from outside my LAN

ssh pi@serveur.solidarlink.com -p 223

If I switch it off via “sudo poff”, everything goes back to normal

If I force the routes like this

sudo pon && sudo ifmetric ppp0 100 && sudo ifmetric wlan0 0 && sleep 10 && sudo ifmetric ppp0 100

(I HAVE to do it twice, do not know why, multiple trials and errors here), I can get my SSH connexion back BUT … after a certain amount of time, the routes goes back to favor ppp0.

What should I change in the “pon” script ? Or elsewhere ?

Can somebody help me understand ?

Regards

Hello,

Could you please share your provider and chat-script?

Yes, where can I find them ?

The paths are
/etc/chatscripts/chat-connect
/etc/ppp/peers/provider

Please find attached the two files


#/etc/chatscripts/chat-connect
ABORT “BUSY”
ABORT “NO CARRIER”
ABORT “NO DIALTONE”
ABORT “ERROR”
ABORT “NO ANSWER”
TIMEOUT 30
“” AT
OK ATE0
OK AT+CPIN?
OK AT+CSQ
OK AT+CREG?
OK AT+CGREG?
OK AT+COPS?
OK AT+CGDCONT=1,“IP”,"\T",0,0
OK ATD*99#
CONNECT


#/etc/ppp/peers/provider
/dev/ttyS0 115200
#The chat script, customize your APN in this file
connect ‘chat -s -v -f /etc/chatscripts/chat-connect -T matooma.m2m’
#The close script
disconnect ‘chat -s -v -f /etc/chatscripts/chat-disconnect’
#Hide password in debug messages
hide-password
#The phone is not required to authenticate
noauth
persist
#Debug info from pppd
debug
#If you want to use the HSDPA link as your gateway
defaultroute
#pppd must not propose any IP address to the peer
noipdefault
#No ppp compression
novj
novjccomp
noccp
ipcp-accept-local
ipcp-accept-remote
local
#For sanity, keep a lock on the serial line
lock
modem
dump
updetach
#Hardware flow control
nocrtscts
remotename 3gppp
ipparam 3gppp
ipcp-max-failure 30
#Ask the peer for up to 2 DNS server addresses
usepeerdns

Under the defaultroute add replacedefaultroute then try sudo pon again