OpenWrt Forum Archive

Topic: Enable NAT for Fonera

The content of this topic has been archived on 2 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Can anyone show how to setup NAT for Fonera? Is there any document for this?

Here are settings:

/etc/config/network
config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface wan
        option ifname   eth0
        option proto    dhcp
        option hostname fonera

config interface lan
        option ifname   ath0
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

/etc/config/network
config wifi-device  wifi0
        option type      atheros
        option channel   5
        option diversity 0
        option txantenna 1
        option rxantenna 1
#       option distance  2000
# disable radio to prevent an open ap after reflashing:
#       option disabled 1


config wifi-iface
        option device   wifi0
        option mode     ap
        option ssid     fonera
        option hidden   0
#       option txpower  15
#       option bgscan   enable
        option encryption none

/etc/firewall.user
### Act as Router
iptables -A forwarding_rule -j ACCEPT

### Open port to WAN
## -- This allows port 22 to be answered by (dropbear on) the router
iptables -t nat -A prerouting_wan -p tcp --dport 22 -j ACCEPT
iptables        -A input_wan      -p tcp --dport 22 -j ACCEPT

(Last edited by nguyen on 10 Jul 2007, 18:48)

I have:

iptables -A INPUT -i ath0 -j ACCEPT
iptables -A INPUT -i eth0 -j ACCEPT
iptables -A OUTPUT -o ath0 -j ACCEPT
iptables -A OUTPUT -o eth0 -j ACCEPT
iptables -A FORWARD -i ath0 -o eth0 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

and it works well smile

The discussion might have continued from here.