Let's say, I have a "network" of two machines, connected by an Ethernet cable. Let's say, machine M is a 'master' and machine S a 'slave'.I am giving them such names because only M has access to the outside world. In other words, S has only one network interface which is used to connect to M. M is Debian, S is Windows.
Now, M has eth0 that is taken up by S, wlan0 which is used to connect to a wireless router and ppp0 which I recently added for availability reasons. Technically speaking, wlan0 is wlx........ and eth0 is enp....., but I'm simplifying things.
First off, what works without any problems?
Everything, when M is connected through wlan0. In this case, S has full internet access (I enabled forwarding in M's kernel). I can access M (and S through M, if desired) from the outside, etc.
But now, I added ppp0 (CDMA modem). To be precise, before setting it up as an interface, I just set up pppd, and I could do pon/poff even before I had a "proper" interface that could be controlled with ifup/ifdown. Why did I set up an interface? Because I noticed a problem that is the point of this post. Setting up a "proper" interface didn't help, by the way.
What is the problem?
When M's ppp0 is up and wlan0 is down, S (yes, S, not M) has a weird problem with internet access. On the surface of it, it looks like nothing works - I can't use a web browser, can't ping an outside host, etc. But next, I ran 'tcpdump -n icmp' on M's ppp0 when pinging an outside host from both M and S - just to find out that when a ping is initiated by S, I can see all outgoing icmp packets, but no incoming ones! Please note that I'm talking about the interface that's facing the outside world - so, there's no incoming icmp reply packets on the modem!
Otherwise, PPP works as expected for M. All protocols. Importantly, when on PPP, the machine gets a proper global IP address - I can ssh into M from the outside and get a normal ssh session w/o any freezes or any other problems. But at the same time, S is ignored by outside hosts.
Would appreciate any suggestions.
'ip route' output:
1 wlan UP, ppp DOWN
default via 192.168.0.1 dev wlan0 onlink
10.42.0.0./24 dev eth0 proto kernel scope link src 10.42.0.1
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.xx
Comment: 192.168.0.1 is the wireless router. 192.168.0.xx is M's wlan0 10.42.0.1 is M's eth0
2 wlan DOWN, ppp UP
default dev ppp0 scope link
10.42.0.0/24 dev eth0 proto kernel scope link src 10.42.0.1
172.17.4.111 dev ppp0 proto kernel scope link src xxx.xxx.xxx.xxx
Comment: xxx.xxx.xxx.xxx is the global IP address that, in fact, makes M accessible from the outside.
'ip addr' for ppp0: inet xxx.xxx.xxx.xxx peer 172.17.4.111/32 scope global ppp0