2

When I am using raspbian with a 4g USB modem, sometimes the network goes down and there is no option to bring back the network unless I reboot the raspbian.

In such cases, I try:

service networking restart

with a cron every hour; this doesn't work.

I tried also ifdown -a && ifup -a -- not much better.

The thing is, when I execute these commands in a terminal, I get no output.

What is the solution to bring network as if I rebooted?

root@raspberrypi:/home/pi# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.100  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::48f5:e07c:1544:2d24  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:38:6e:29  txqueuelen 1000  (Ethernet)
        RX packets 23902  bytes 8949877 (8.5 MiB)
        RX errors 0  dropped 17  overruns 0  frame 0
        TX packets 30039  bytes 6388288 (6.0 MiB)
        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<host>
        loop  txqueuelen 1  (Boucle locale)
        RX packets 20996  bytes 8495857 (8.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20996  bytes 8495857 (8.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:6d:3b:7c  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
  • 1
    how exactly do you connect initially? Did you set up a configuration in /etc/network/interfaces or did you have to do more than that to connect in the first place? – rudib Dec 15 '18 at 18:37
  • 1
    no config at all i have to do plug usb modem and it works like ethernet wire – user1335838 Dec 15 '18 at 19:17
  • Could you post the outputs of ifconfig -a? In the case in which everything is handled by the usb device, power cycling the usb device might help, altough it might not be the best of solutions. – rudib Dec 15 '18 at 19:28
  • post edited with ifconfig – user1335838 Dec 15 '18 at 20:12
  • Did you do this while the modem was plugged in? Because it's not showing up. If it's showing up in the future I'd recommend editing out the ip address for security reasons. Right now, you seem to be connected to your local ethernet only. – rudib Dec 15 '18 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.