Internet, Tech

Port-Forwarding in OpenWRT

Port forwarding can be enabled in OpenWRT by editing the firewall config file /etc/firewall.config.

forward:dport=5022:192.168.1.106:22

This is a typical entry in the firewall config implying that incoming connections from the WAN on port 5022 will be forwarded to port 22 on the machine 192.168.1.106.

Note:

The above method works on Kamikaze. For White Russian, check out the comment below.

Advertisements
Standard

3 thoughts on “Port-Forwarding in OpenWRT

  1. The above rule does not work on White Russian (0.9)

    Try:
    iptables -t nat -A prerouting_wan -p tcp –dport 8080 -j DNAT –to 192.168.1.2:80
    iptables -A forwarding_wan -p tcp –dport 80 -d 192.168.1.2 -j ACCEPT

  2. babayota says:

    How about Backfire r32751 ?
    part of my /etc/config/firewall
    .
    .
    .
    config ‘redirect’
    option ‘_name’ ‘tosat’
    option ‘src’ ‘wan’
    option ‘proto’ ‘tcpudp’
    option ‘src_dport’ ‘20000’
    option ‘dest_ip’ ‘192.168.0.219’
    option ‘dest_port’ ‘20000’
    option ‘target’ ‘DNAT’
    option ‘dest’ ‘lan’

    192.168.0.219 is my sat receiver but sharing do not work

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s