HELLO_wORLD
Very Senior Member
I have a technical question for experts like @R. Gerrits
Let’s say I am connected to the WAN with a static subnet 2.0.0.100/24
Let’s say I have have a device on the WAN side of the router, that has for IP 192.168.10.1 is only accessible (ping and http on port 80) from the subnet 192.168.10.0/24
I want to be able to access it from the router (and ideally from my LAN).
Here is what I do:
ip addr add 192.168.10.2/24 dev brwan
That adds the secondary subnet 192.168.10.0/24 to my brwan interface and assigns to it the IP 192.168.10.2
It also adds a route for it
using ping or wget -o- 192.168.10.1, from the router, I get no route to host, even with --bind-address 192.168.10.2
Then, I add this iptables rule:
iptables -t nat -I POSTROUTING -o brwan -d 192.168.10.0/24 -j SNAT --to 192.168.10.3
And using ping or wget -o- 192.168.10.1 now results in a timeout (from LAN as well).
I am not sure the device is answering (timeout might be normal), so I just want to know if the rules I use should work or not or if I am forgetting a step?
Let’s say I am connected to the WAN with a static subnet 2.0.0.100/24
Let’s say I have have a device on the WAN side of the router, that has for IP 192.168.10.1 is only accessible (ping and http on port 80) from the subnet 192.168.10.0/24
I want to be able to access it from the router (and ideally from my LAN).
Here is what I do:
ip addr add 192.168.10.2/24 dev brwan
That adds the secondary subnet 192.168.10.0/24 to my brwan interface and assigns to it the IP 192.168.10.2
It also adds a route for it
Code:
## ADDR
14: brwan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
inet 2.0.0.100/22 brd 2.0.0.255 scope global brwan
inet 192.168.10.2/24 scope global brwan
## ROUTE
default via 2.0.0.254 dev brwan
2.0.0.0/22 dev brwan scope link src 2.0.0.100
192.168.0.0/24 dev br0 scope link src 192.168.0.1
192.168.10.0/24 dev brwan scope link src 192.168.10.2
using ping or wget -o- 192.168.10.1, from the router, I get no route to host, even with --bind-address 192.168.10.2
Then, I add this iptables rule:
iptables -t nat -I POSTROUTING -o brwan -d 192.168.10.0/24 -j SNAT --to 192.168.10.3
And using ping or wget -o- 192.168.10.1 now results in a timeout (from LAN as well).
I am not sure the device is answering (timeout might be normal), so I just want to know if the rules I use should work or not or if I am forgetting a step?
Last edited: