Access subnet behind DD-WRT
Below diagram illustrates the network design and layout of my testing environment:
In office, I have two LAN ports and the IPs are assigned by the DHCP server. Therefore, I cannot assign static IPs to the servers. I decided to use the retired router to setup a subnet, so that I can allocate static IP address to the server attached to the router.
PC (Win 10)
Add the route to the subnet (192.168.1.1/24)
C:\Users\calviny>route add 192.168.1.0 mask 255.255.255.0 10.1.12.139
C:\Users\calviny>route print -4
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.1.12.1 10.1.12.139 25
10.1.12.0 255.255.255.0 On-link 10.1.12.139 281
10.1.12.139 255.255.255.255 On-link 10.1.12.139 281
10.1.12.255 255.255.255.255 On-link 10.1.12.139 281
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
192.168.1.0 255.255.255.0 10.1.12.135 10.1.12.139 26
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 10.1.12.139 281
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 10.1.12.139 281
DD-WRT router
- Network setup of the router (Setup -> Basic Setup)
- Change the Operating Mode to Router (Setup -> Advanced Routing)
- Add a new firewall rule to allow the traffic to be forwarded according (Administration -> Commands)
iptables -I FORWARD -j ACCEPT
Testing
C:\Users\calviny>ping 192.168.1.192
Pinging 192.168.1.192 with 32 bytes of data:
Reply from 192.168.1.192: bytes=32 time=1ms TTL=63
Reply from 192.168.1.192: bytes=32 time=1ms TTL=63
Reply from 192.168.1.192: bytes=32 time<1ms TTL=63
Reply from 192.168.1.192: bytes=32 time=1ms TTL=63
Ping statistics for 192.168.1.192:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
It is done. I can access the subnet behind DD-WRT router now.