Default Gateway does not work - Printable Version +- Hilscher Community Forum (https://forum.hilscher.com) +-- Forum: netPI 3 - Docker featuring Industrial Raspberry Pi 3 platform (https://forum.hilscher.com/forum-1.html) +--- Forum: Software (https://forum.hilscher.com/forum-5.html) +--- Thread: Default Gateway does not work (/thread-466.html) Pages:
1
2
|
Default Gateway does not work - lunz1 - July-31st-2019 I'm using a net PI Core (Firmware 1.0200.1368) in a LAN with a modem. The net PI is used to send mails via modem. The modem has the ip address 169.254.100.97. The net PI got following LAN settings. I'm using the docker container "hilschernetpi/netpi-debian-stretch:latest" and the network type of this container ist set up as host. These settings lead to the following routing table. It's possible to ping the gateway, in my case the modem. But I can't ping any address outside this network, e.g. 8.8.8.8. All other devices in my LAN can reach this address. Adding a static route has no effect. Has anybody some ideas ? Which setting is wrong ? Many thanks for your support in advance. RE: Default Gateway does not work - Armin@netPI - July-31st-2019 Hi there, we can't see you screen shots in your post. Please edit your post and add pictures as attachment and after inserted them as attachment you can select the option "insert into post". Thx Armin RE: Default Gateway does not work - Armin@netPI - July-31st-2019 What may be a problem is that when netPI CORE 3 receives an IP address through your DHCP it will receive also a default gateway. This gateway will have prio to any other additional LAN,Wifi ... USB modems. So you should try to setup a manual ethernet connection with the very same IP address and network mask as received through the DHCP server beore but this time without setting the default gateway. RE: Default Gateway does not work - lunz1 - August-1st-2019 (July-31st-2019, 02:26 PM)Armin@netPI Wrote: What may be a problem is that when netPI CORE 3 receives an IP address through your DHCP it will receive also a default gateway. This gateway will have prio to any other additional LAN,Wifi ... USB modems. The DHCP Server is running on the modem. It sets the default gateway as 169.254.100.97 RE: Default Gateway does not work - Armin@netPI - August-1st-2019 Ok now I am able to see your screen shots. When I am looking to your screen shot you made using the command Code: ip route show then I see a default gateway 169.254.100.97 which is pretty much the same as in your netPI's LAN settings page (screen shot 2). So this matches So my expectation is like you that whenever you ping to 8.8.8.8 for example you are getting a reply instantly. On the other hand you are telling me that you were able to pull the "hilscher debian container" which tells me also that the principle connection over your gateway works and also the DNS server must have been working correctly since pulling an image goes over the name https://registry-1.docker.io/v2/ internally always. My netPI here in the office network receives its IP over a gateway/server too and I think this is the case in 99% of all applications I know of with netP. I tried the same like you ... loading the debian stretch container ... starting it with host mode setting. Here is what I did Code: root@NTB827EBD50766:/# ip route show here it works as expected. Especially in "host mode" the container shares the TCP/IP stack of the host system so it runs 100% in the same context as the host ... and your host is able to pull images ... but the container is not able to ping an external IP address ... this really sounds weird to me and I defenitively cannot explain. Thx Armin RE: Default Gateway does not work - Armin@netPI - August-1st-2019 I tried my netPI at home connected to a Fritz.box as gateway/modem featuring DHCP support and I got the same result as in my previous post. No problem pinging 8.8.8.8 in a host mode driven container. Also I would expect that not even a "bridged driven container" should have a problem since Docker manages the routing between container and host in this case. This is Docker standard. RE: Default Gateway does not work - lunz1 - August-1st-2019 (August-1st-2019, 08:00 AM)Armin@netPI Wrote: Ok now I am able to see your screen shots. Maybe i explained not precise enough in which way i have pulled the container. Therefore i have changed the ip settings and connected the netPI to a completly different network. The setup with the modem had never access to the internet. I did another small test. I have changed the modem IP address to 192.168.178.1 and changed the netPI LAN settings as following. Then it is possible to ping devices at the internet. All is fine. When I change the modem IP sddress to 169.254.100.97 and don't touch the netPI's settings no connection to the internet is possible annymore. The netPI's IP address is set through DHCP at 169.254.100.70. I think the network 169.254.100.xxx creates the problems. I can't imagine what is the reason for this. But in I have to use this network in my appliication. RE: Default Gateway does not work - Armin@netPI - August-1st-2019 I setup my notebook (with internet connection) to work as a gateway using a second ethernet card. I setup the 2nd card with exactly your modem settings and IP 169.254.100.97 and my netPI with 169.254.100.123 and subnet 255.255.0.0 and DNS to 169.254.100.97. I am having now an equivalent network setup like yours.
Code: auto eth0 and guess what ... with my original Raspberry Pi I am having exactly the same issue. I am not able to ping 8.8.8.8 and there are no Eth frames coming out from it if I start recording it with Wireshark. So this an issue with Linux in general or a setting that I don't know right now. So it is not a specific netPI problem but a general problem. We have a network expert in the office, maybe he knows more. RE: Default Gateway does not work - lunz1 - August-1st-2019 Many thanks for your afford. I look forward to the findings of your network expert. RE: Default Gateway does not work - Armin@netPI - August-1st-2019 There is a little progress in my notebook setup and Raspberry Pi. I was specifically adding the gateway in the routing table using the command Code: ip route add 169.254.100.97 dev eth0 With this additional entry my Raspberry Pi is now sending out the ping command as intended. I was able to see in it Wireshark ... and I see with Wireshark my notebook sending out the same ping command out to the internet and I see the replay back to it too ... what I don't see is that my notebook routes back the ping reply back to my Raspberry Pi. So there is still something missing. |