Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question
    
Can you get to the Internet from "PC" and does the PC use a 192.168.0.0/24 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 10.0.0.0/16 on the Internet router does not point to Router A but to the Linux Router (192.168.0.2), right? Where does the Internet router get it's 192.168.0.1 IP from? The Linux router via DHCP? –  scherand Apr 11 '13 at 8:49
    
PC can access the internet and is a 192.168.0.0/24 address. Linux server can access the internet. Internet router 192.168.0.1 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 10.0.0.0/16 then the next hop is the IP address of interface 1 on the linux server as this is the router to the 10.0.0.0 network. –  Paul Hampson 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 10.0.0.0/16 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 (10.1.0.1) which you state it is but it seems to be worth checking. –  scherand Apr 13 '13 at 10:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.