Raspbian restart network without reboot

Clash Royale CLAN TAG#URR8PPP
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
networking usb raspberry-pi raspbian 3g
|
show 2 more comments
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
networking usb raspberry-pi raspbian 3g
1
how exactly do you connect initially? Did you set up a configuration in/etc/network/interfacesor did you have to do more than that to connect in the first place?
– rudib
Dec 15 at 18:37
1
no config at all i have to do plug usb modem and it works like ethernet wire
– user1335838
Dec 15 at 19:17
Could you post the outputs ofifconfig -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 at 19:28
post edited with ifconfig
– user1335838
Dec 15 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 at 20:18
|
show 2 more comments
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
networking usb raspberry-pi raspbian 3g
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
networking usb raspberry-pi raspbian 3g
networking usb raspberry-pi raspbian 3g
edited Dec 16 at 13:34
Jeff Schaller
38.5k1053125
38.5k1053125
asked Dec 15 at 17:48
user1335838
112
112
1
how exactly do you connect initially? Did you set up a configuration in/etc/network/interfacesor did you have to do more than that to connect in the first place?
– rudib
Dec 15 at 18:37
1
no config at all i have to do plug usb modem and it works like ethernet wire
– user1335838
Dec 15 at 19:17
Could you post the outputs ofifconfig -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 at 19:28
post edited with ifconfig
– user1335838
Dec 15 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 at 20:18
|
show 2 more comments
1
how exactly do you connect initially? Did you set up a configuration in/etc/network/interfacesor did you have to do more than that to connect in the first place?
– rudib
Dec 15 at 18:37
1
no config at all i have to do plug usb modem and it works like ethernet wire
– user1335838
Dec 15 at 19:17
Could you post the outputs ofifconfig -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 at 19:28
post edited with ifconfig
– user1335838
Dec 15 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 at 20:18
1
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 at 18:37
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 at 18:37
1
1
no config at all i have to do plug usb modem and it works like ethernet wire
– user1335838
Dec 15 at 19:17
no config at all i have to do plug usb modem and it works like ethernet wire
– user1335838
Dec 15 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 at 19:28
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 at 19:28
post edited with ifconfig
– user1335838
Dec 15 at 20:12
post edited with ifconfig
– user1335838
Dec 15 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 at 20:18
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 at 20:18
|
show 2 more comments
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489174%2fraspbian-restart-network-without-reboot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f489174%2fraspbian-restart-network-without-reboot%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
how exactly do you connect initially? Did you set up a configuration in
/etc/network/interfacesor did you have to do more than that to connect in the first place?– rudib
Dec 15 at 18:37
1
no config at all i have to do plug usb modem and it works like ethernet wire
– user1335838
Dec 15 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 at 19:28
post edited with ifconfig
– user1335838
Dec 15 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 at 20:18