fadern
21-01-2007, 16:51
Hello!
I've been trying to configure port forwarding for port 80 to my internal web server, yet when trying to connect to this I only get the webif2 interface (web interface for openWRT).
The internal server is listening on port 80, I can of course change this, doesn't matter which ports its listening on for me.
I've successfully configured ports for internal ssh-servers and it works like a charm, from both inside and outside the local network.
Current configuration:
Hardware: WL500gx
Firmware: OpenWRT WhiteRussian RC6
/etc/firewall.user:
#!/bin/sh
. /etc/functions.sh
WAN=$(nvram get wan_ifname)
LAN=$(nvram get lan_ifname)
iptables -F input_rule
iptables -F output_rule
iptables -F forwarding_rule
iptables -t nat -F prerouting_rule
iptables -t nat -F postrouting_rule
iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 80 -j DNAT --to 192.168.1.4:80
iptables -A forwarding_rule -i $WAN -p tcp --dport 80 -d 192.168.1.4 -j ACCEPT
/etc/config/firewall:
# Config for webserver ?
forward:proto=tcp dport=80:192.168.1.4:80
# Internal SSHD-server 1
forward:proto=tcp dport=47114:192.168.1.5:47114
# Internal SSHD-server 2
forward:proto=tcp dport=47113:192.168.1.4:47113
# Other needed ports
forward:dport=47371-47380:192.168.1.5
I've been trying some examples here in the forum, but they still only resulted in the routers web interface. Perhaps its only that I'm unfamiliar with ip-tables, the above was configured with the web interface.
Thank you for all the help, links, tutorials everything welcome.
//
Mattias
I've been trying to configure port forwarding for port 80 to my internal web server, yet when trying to connect to this I only get the webif2 interface (web interface for openWRT).
The internal server is listening on port 80, I can of course change this, doesn't matter which ports its listening on for me.
I've successfully configured ports for internal ssh-servers and it works like a charm, from both inside and outside the local network.
Current configuration:
Hardware: WL500gx
Firmware: OpenWRT WhiteRussian RC6
/etc/firewall.user:
#!/bin/sh
. /etc/functions.sh
WAN=$(nvram get wan_ifname)
LAN=$(nvram get lan_ifname)
iptables -F input_rule
iptables -F output_rule
iptables -F forwarding_rule
iptables -t nat -F prerouting_rule
iptables -t nat -F postrouting_rule
iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 80 -j DNAT --to 192.168.1.4:80
iptables -A forwarding_rule -i $WAN -p tcp --dport 80 -d 192.168.1.4 -j ACCEPT
/etc/config/firewall:
# Config for webserver ?
forward:proto=tcp dport=80:192.168.1.4:80
# Internal SSHD-server 1
forward:proto=tcp dport=47114:192.168.1.5:47114
# Internal SSHD-server 2
forward:proto=tcp dport=47113:192.168.1.4:47113
# Other needed ports
forward:dport=47371-47380:192.168.1.5
I've been trying some examples here in the forum, but they still only resulted in the routers web interface. Perhaps its only that I'm unfamiliar with ip-tables, the above was configured with the web interface.
Thank you for all the help, links, tutorials everything welcome.
//
Mattias