|
| <prev next> |
Re: Domain Forwarding on OpenWrt/Dnsmasq: msg#00051network.dns.dnsmasq.general
Christopher Parker wrote: Hello, If I've understood you correctly, then I think you need to step back a bit, and consider the larger problem. What you are trying to do: use a server behind a NAT router, is fairly common, but you cannot do it using DNS tricks only. There's only one IP, the router's WAN IP, which gets packets from the global internet to your box. No matter what you do to DNS, the names will be resolved to that IP in the end, and turn up at the router. The normal way to do this is port-forwarding: you tell network subsystem on the router to treat packets which are sent to the router's global IP address and a certain port (or ports) specially. Instead of receiving the packets, it changes their destination field to the (192.168,...) IP address of the internal machine, and sends them to that machine over the internal network. The magic to do this looks like this, which forwards port 8080 on the router to port 80 on 192.168.1.2 iptables -t nat -D PREROUTING -p tcp --destination-port 8080 \ -j DNAT --to-destination 192.168.1.2:80 If you run that command on the router, then you will be able to access the webserver on 192.168.1.2 as http://router.example.com:8080/ from anywhere. It's also possible to forward port 80 on the router to port 80 on the server, but be careful: that might also forward port 80 when accessing the router from the internal network, blocking access to the router config pages. I just re-read you message, and I see that you are using OpenWRT: that almost certainly has a config page to set up port-forwarding, so you won't need to run iptables commands directly: just fill in the web-form. HTH Simon. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Domain Forwarding on OpenWrt/Dnsmasq: 00051, Simon Kelley |
|---|---|
| Previous by Thread: | Re: Domain Forwarding on OpenWrt/Dnsmasqi: 00051, Simon Kelley |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |