I have tried with this but can`t get it to work, the eth0 and wlan0 are already up and running so my setup is a lot easier.
wlan0 has a DHCP already enabled and is correctly assigning the IP to the client, eth0 is set to static, the client is connecting with a static IP.
These are the settings from ifconfig:
eth0 Link encap:Ethernet HWaddr 00:14:3E:9D:BA:57
inet addr:192.168.13.31 Bcast:192.168.13.255 Mask:255.255.255.0
inet6 addr: fe80::214:3eff:fe9d:ba57/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1600 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:74056 (72.3 KiB) TX bytes:3936 (3.8 KiB)
wlan0 Link encap:Ethernet HWaddr 64:69:4E:77:D5:2E
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::6669:4eff:fe77:d52e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:618 errors:0 dropped:0 overruns:0 frame:0
TX packets:656 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:72055 (70.3 KiB) TX bytes:87715 (85.6 KiB)
The client connected through wlan0 has IP 192.168.1.11 (dhcp) while the client connected on eth0 has 192.168.13.10 (static). I would like the two to communicate with each other, this below is the setup for the iptables:
sysctl -w net.ipv4.ip_forward=1
iptables --flush
iptables -I INPUT -j ACCEPT
iptables --table nat --flush
iptables --table nat --delete-chain
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o wlan0 -m state --state NEW -j ACCEPT
iptables -A INPUT -m udp -p udp --sport 67:68 --dport 67:68 -j ACCEPT
After this from the shell of the device I can still ping both clients but the client on the eth0 can`t ping the client on the wlan0 and viceversa.