I have the below setups. node1 & node2 are in a LAN. Both use the eth0 NIC to connect to LAN. Both are Debian systems.Additionally node1 is connected to the internet using wlan0 nic. Expectation is that both node1 & node2 can reach internet.With this setup, I am not able to access internet. The kernel IP showed the default rule to the routerBasically I am encountering with two issues.issue 1 :On Node 1With this setup, the node1:kernel ip table shows the default rule via eth0. hence connecting to router1/LAN.I tried ip route del & add new default rule device wlan0. ip table looks good(at least what I expected default rule via wlan0). but still, no internet connection.Question 1: Is this the right way to delete & add the default rule to change the system behaviour to which dev it should choose to send the packets out. Or some additional config I need.Now With curiosity, I just flipped the dev. Means the wlan0 nic is connected now to LAN & eth0 is to the router2(external net).ip table shows default rule to eth0. As this time eth0 connected to router2, I got the internet connection. could ping, browse & all.Question2: Is eth0 always used for default rule. How can I change to other nic. here wlan0.Issue 2:On node 2However this success could not last longer as from node-2, I do not get internet connection from node-2.It's static configuration, the GW is mentioned as ip addr of node-1. Question3: Is this correct. OR Do I need to do any SNAT or MASQRADE kind of config on node1 to be able to OR the router-2 should take care of that.. What I am missing here to get the internet connection.I am adding some clarity to the above scenario. & also clarification to some comments as I am not yet authorized to comment.Internet access to/from node2(if more systems on LAN also) should via node-1 only.the LAN router(router-1) is dhcp enaled and all nodes are client to it.Same with the internet router-2.So in this case do I need to do any special configuration on node-1.On node-1, ip route : default via  dev eth0On node-2, ip route : default via  dev eth0.another tricky question (but less important, I can live with it by using eth0 to my internet connected router), what I have already asked is : why the default is via eth0 always. How can I force it to use wlan0(in my case) connected GW. My del/add of default is not working.
Can not connect internet from LAN
lan