Not sure if I can articulate this right, so I beg your tolerance.
I am not an OpenWRT developer, at least not yet - don't feel competent to be one, yet. But I'd appreciate it if someone could point me towards the correct source file to look at.
I'm playing with a router behind a router. Suppose, for example, I'm having a party, and I want to provide my guests internet access while permitting or restricting access to my home network.
So, I have an inner lan, with it's router WAN connected to my home LAN, and it's router connected to my ISP. Both routers are NATting. Machines on the inner LAN get out to the internet just fine. The inner router itself pings wherever desired - of course, it's on the outer lan. i.e. The issue below is not the router itself, but when transiting the router.
Sometimes these inner lan machines can ping the outer lan machines, sometimes not. There is a pattern here that I'm not entirely getting, which is to say, a ruleset I would like to better understand the specifics of. This 'ruleset' seems to revolve around the IP addresses being used. For example, if I set my inner lan to use bogon addresses, pings work fine. If I return to my normal network, they do not. Depending upon the particular set of guests, one day I may want those guests to have access to my home / outer lan, another day I might not. I'd like to better understand the rules in effect - and I presume I need to go to the source to accomplish that. (I tried to google on this topic, but can't find appropriate search terms.)
It seems to me that OpenWRT code is probably typical of the industry, in the sense of behaviour in this area. I'm guessing I could extrapolate from OpenWRT behaviour to the behaviour of most typical home internet routers.
What source file should I examine to find out what rules apply to this traffic - e.g. private vs. public addresses do / don't get passed.
TIA.