iptables forward rule not working in openwrt

Posted by Udit Gupta on Server Fault See other posts from Server Fault or by Udit Gupta
Published on 2013-10-25T00:07:49Z Indexed on 2013/10/25 3:57 UTC
Read the original article Hit count: 399

I am trying to apply some iptables forwarding rules in openwrt.

Here is my scenario -

My server has two cards ath0 and br-lan. br-lan is connected to internet and ath0 to private network.

The other m/c in n/w also has ath0 that connects with this server's ath0 and they are able to ping each other.

Now, I want other m/c in network to use internet using br-lan of server so I thought of using iptables forwarding rule-

Here is what I tried -

Server :

$ ping 1.1.1.6 // <ath0-ip of client> works fine
$ iptables -A FORWARD -i ath0 -o br-lan -j ACCEPT
$ /etc/init.d/firewall restart

Client :

$ ping 1.1.1.5 // <ath0-ip of server>  works fine
$ ping 132.245.244.60 // <br-lan ip of server> (not working)

I am new to iptables stuff and openwrt. What I am doing wrong here ??

Any other help if anyone could suggest for my scenario

Edit- m/c - machine n/w - network

© Server Fault or respective owner

Related posts about iptables

Related posts about firewall