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
  • Host A gets IP by DHCP from Router A which has an IP of on the Wifi side, gateway given by DHCP is
  • Linux server has an interface connected to router A via connection 2
  • Linux server has a static IP 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 on the Internet router to route to Router A (

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: (Router A) -> (Linux Server) -> (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 UH    0      0        0 vlan2   U     0      0        0 vlan2   U     0      0        0 br0     U     0      0        0 br0         UG    0      0        0 vlan2

Linux Server:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 eth1   U     0      0        0 eth0         UG    0      0        0 eth0

Internet Router:

Destination     Gateway         Genmask         Flags Metric Iface
<External IP> UH    0      pppoa0   U     0      br0     UG    0      br0         U     0      pppoa0
  • Can you get to the Internet from "PC" and does the PC use a address from the Linux server (i.e. are you sure the NAT is working on the Internet router)? Also I think there is a typo in your question: the static route for on the Internet router does not point to Router A but to the Linux Router (, right? Where does the Internet router get it's IP from? The Linux router via DHCP? – scherand Apr 11 '13 at 8:49
  • PC can access the internet and is a address. Linux server can access the internet. Internet router is statically assigned. WRT the static route - this might be where the problem is, I don't know. I thought with a static route you specified the next router hop. So if I have a packet on the side of connection (1) trying to get to then the next hop is the IP address of interface 1 on the linux server as this is the router to the network. – Cycling Engineer Apr 12 '13 at 9:14
  • Yes, in a static routing entry you define the next hop. And yes, this is the Linux router (but you state it's Router A in your question). The fact that you can ping the Internet router from Host A proofs that your route is working. Can you provide the routing table of Host A? Maybe the default route on Host A is not correct. Its default gateway should be the WiFi interface of Router A ( which you state it is but it seems to be worth checking. – scherand Apr 13 '13 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.