Raspbianは再起動せずにネットワークを再起動します。

Raspbianは再起動せずにネットワークを再起動します。

4g USBモデムでRaspbianを使用すると、ネットワークがダウンしてRaspbianを再起動しない限り、復元できません。

この場合は、以下を試してください。

service networking restart

毎時間cronを実行すると動作しません。

私もそうしてifdown -a && ifup -aみましたがあまり良くありませんでした。

問題は、端末でこのコマンドを実行しても出力がないことです。

ネットワークを再起動する方法はありますか?

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

Raspbianで動作する唯一のことは次のとおりです。

sudo ifconfig wlan0 down && sleep 5 && sudo ifconfig wlan0 up

おすすめ記事