laptop not routing if dhcp server is disabled
by peterg17 from LinuxQuestions.org on (#5NZB3)
I have a small embedded computer I use to run various things, printer, TV, and such, connected to my laptop via ethernet, which I then connect to the internet with wifi through my phone. My problem is the ethernet device configuration on the laptop.
Running nm-connection-editor, if I select the ipv4 option "shared to other computers", then upon enabling the interface, a dnsmasq process is started which configures some of the devices also connected to the ethernet LAN. However I do not wish this, as I am running an ISC dhcp server on the embedded system. I am able to connect to the internet via the laptop and phone from the embedded system.
If I select the ipv4 option "manual" for the ethernet device on the laptop, then dnsmasq is not started for the interface. However the embedded system cannot connect to the ethernet via the laptop/phone.
I have tried using tcpdump and ip route to investigate the problem, and see the difference in the laptop configuration between the working and non-working cases. /proc/sys/net/ipv4/ip_forward is set.
The following commands illustrate the routing table and a simulated routing.
The output of these commands is identical in working and non-working cases.
$ ip ro
default via 192.168.1.1 dev wlp0s20f3 proto dhcp metric 600
169.254.0.0/16 dev wlp0s20f3 scope link metric 1000
192.168.1.0/24 dev wlp0s20f3 proto kernel scope link src 192.168.1.171 metric 600
192.168.37.0/24 dev enp3s0 proto kernel scope link src 192.168.37.8 metric 100
$ ip route get to 192.168.1.1 from 192.168.37.1 iif enp3s0
192.168.1.1 from 192.168.37.1 dev wlp0s20f3
cache iif enp3s0
Using tcpdump, I am able to confirm that pings from the embedded system are arriving at the laptop. However it is not routing to the wifi/phone in the non-working case.
Running nm-connection-editor, if I select the ipv4 option "shared to other computers", then upon enabling the interface, a dnsmasq process is started which configures some of the devices also connected to the ethernet LAN. However I do not wish this, as I am running an ISC dhcp server on the embedded system. I am able to connect to the internet via the laptop and phone from the embedded system.
If I select the ipv4 option "manual" for the ethernet device on the laptop, then dnsmasq is not started for the interface. However the embedded system cannot connect to the ethernet via the laptop/phone.
I have tried using tcpdump and ip route to investigate the problem, and see the difference in the laptop configuration between the working and non-working cases. /proc/sys/net/ipv4/ip_forward is set.
The following commands illustrate the routing table and a simulated routing.
The output of these commands is identical in working and non-working cases.
$ ip ro
default via 192.168.1.1 dev wlp0s20f3 proto dhcp metric 600
169.254.0.0/16 dev wlp0s20f3 scope link metric 1000
192.168.1.0/24 dev wlp0s20f3 proto kernel scope link src 192.168.1.171 metric 600
192.168.37.0/24 dev enp3s0 proto kernel scope link src 192.168.37.8 metric 100
$ ip route get to 192.168.1.1 from 192.168.37.1 iif enp3s0
192.168.1.1 from 192.168.37.1 dev wlp0s20f3
cache iif enp3s0
Using tcpdump, I am able to confirm that pings from the embedded system are arriving at the laptop. However it is not routing to the wifi/phone in the non-working case.