2

Problem: eth1 has no internet (interface created by modem). usb_modeswitch is installed. But I can ping it

Setup: - Raspberry Pi 3 B+ (Raspbian Stretch Lite 2018-11-13 Kernel version:4.14) - Huawei 4G modem N3372

lsusb

Bus 001 Device 006: ID 12d1:14dc Huawei Technologies Co., Ltd.
Bus 001 Device 004: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:44:06:be brd ff:ff:ff:ff:ff:ff
    inet 192.168.88.247/24 brd 192.168.88.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::6616:ffb8:a84c:4010/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b8:27:eb:11:53:eb brd ff:ff:ff:ff:ff:ff
4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 0c:5b:8f:27:9a:64 brd ff:ff:ff:ff:ff:ff
    inet 192.168.42.100/24 brd 192.168.42.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::1aaf:f54b:26b9:acae/64 scope link
       valid_lft forever preferred_lft forever

ip route

default via 192.168.88.1 dev eth0 src 192.168.88.247 metric 202
default via 192.168.42.1 dev eth1 src 192.168.42.100 metric 204
192.168.42.0/24 dev eth1 proto kernel scope link src 192.168.42.100 metric 204
192.168.88.0/24 dev eth0 proto kernel scope link src 192.168.88.247 metric 202

Update 1:

 curl --interface eth1 google.com

Got timeout error

 curl --interface eth1 192.168.42.1

Got empty html tag. I think it's modem's webinterface protected from headless browsers or raw requests.

Modem on Windows 10 works fine without any configuration.

  • 1
    You say you don't have Internet. How did you come to this conclusion? Was there an error message? This might help finding out the root cause. – oh.dae.su Jan 26 at 12:41
  • Does the modem has a web interface? The modem should have established a 4G connection to your provider. Then please edit your question and add the output of this command: ip route. Please address me with @Ingo, otherwise I won't see your reply. – Ingo Jan 26 at 20:14
  • @Ingo updated, check – Flaks Jan 27 at 7:44
  • What's about your problem? No idea? – Ingo Sep 21 at 19:52
0

As far as I can see your RasPi is connected to a local area network 192.168.88.0/24 by interface eth0. On this subnet there is a router 192.168.88.1 but it does not have a connection to the internet. The internet connection is made by the modem. Packages to the internet will be send to the default route. You have two default routes:

default via 192.168.88.1 dev eth0 src 192.168.88.247 metric 202
default via 192.168.42.1 dev eth1 src 192.168.42.100 metric 204

It can only one route be used. What route to use is determined by the metric. The route with the lowest metric is used so you try to connect to the internet on interface eth0.

You should avoid setting two default routes. For a quick test you can delete the wrong route with:

rpi ~$ sudo ip del default via 192.168.88.1 dev eth0 src 192.168.88.247 metric 202

I don't know something about your network setup so you have to look how to disable setting the default route on eth0 (or give it a higher metric). For example if you use dhcpcd you should not have an entry static routers=192.168.88.1 in /etc/dhcpcd.conf.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.