Hi everyone
I want to know configuration.
I’m trying to change any destination to appointed destination from local LAN → to Public IP.
(e.g source address 192.168.30.0/24 access [WAN(8.8.8.8,x.x.x.x) → appointed destination IP:Port Number that I wants.]
Please tell me
Thanks.
Absolutely.
Just use a dstnat chain rule which matches the traffic you want, and has the action=dst-nat to-addresses=x.x.x.x
(the to-ports is optional - if you leave it blank, the port will remain unchanged)
In routers, there really is no difference between ‘wan’ and ‘lan’ - that’s just a convention humans use to denote “outside network” and “inside network” for convenience, but the router doesn’t care. It just forwards packets where the routing table tells it to.
Routers also don’t distinguish between private and public IP addresses. Again, it’s just a convention humans use for various reasons, but a router will deal with “private” IP addresses no differently than “public” IP addresses.
In a sense, any IP address can be “private” - if the Internet doesn’t know to route it to your computer, it’s a ‘private’ IP address. The reason you don’t just pick any random IP address for ‘private’ use is that if you choose some address range that is actually in use on the Internet, you won’t be able to communicate with the legitimate network. (suppose you randomly assigned 8.8.8.0/24 to your LAN. You couldn’t use 8.8.8.8 as your DNS server unless you installed a DNS server on your network and gave it that IP address yourself, because your network will consider 8.8.8.* to be LOCAL and won’t go out to the real google DNS server.