I am doing a bit of experimentation with my home network and have the following setup:
+---------+ +----------+ +-----------+ +----------+
| Host A |_WiFi_| Router A =1)___(2= Linux =1)___(1= Internet =)_____ *** Internet **
| | | | | Server | | Router |
+---------+ +----------+ +-----------+ +----------+
|
+----------+
| PC |
+----------+
- Router A (DDWRT) provides NAT and DHCP and has a static IP on connection 1 of 10.0.0.2
- Host A gets IP 10.1.0.2 by DHCP from Router A which has an IP of 10.1.0.1 on the Wifi side, gateway given by DHCP is 10.1.0.1
- Linux server has an interface 10.0.0.1 connected to router A via connection 2
- Linux server has a static IP 192.168.0.2 on connection 1, which is connected to the internet router
- Linux server provides DHCP & DNS etc for 192.168.0.* network
I have setup the route tables on the Linux server such that it seems internal traffic is routed fine. I have also setup a static route for 10.0.0.0/16
on the Internet router to route to Router A (192.168.0.2
).
So I can ping from Host A as far as the Internet router. If I do a traceroute on an external IP like google.com from Host A I get the following:
10.1.0.1 (Router A) -> 10.0.0.1 (Linux Server) -> 192.168.0.1 (Internet Router)
So what do I need to set on the Internet router (which is doing NAT etc) to get it to route the internet traffic correctly?
Bit of context/secondary question: The overall aim (and I know this is a pretty nuts way to go about it) is to try and segregate off the WiFi traffic from the rest of the network. Is this possible with this setup using firewall configuration on the Linux Server? And so to require anyone on WiFi to VPN into the linux server if they wanted access to the wired network (192.168.0.*
).
FYI here are the route tables:
Router A:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 vlan2
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 vlan2
10.1.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 br0
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 vlan2
Linux Server:
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
Internet Router:
Destination Gateway Genmask Flags Metric Iface
<External IP> 0.0.0.0 255.255.255.255 UH 0 pppoa0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 br0
10.0.0.0 192.168.0.2 255.255.0.0 UG 0 br0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 pppoa0