My problem is the computer under the WiFi network cannot connect to the computer under a Linux hotspot which is connecting to the same WiFi.
I am setting up a Linux hotspot under a WiFi network, there have 10 computers is connecting to the hotspot and the hotspot is connecting to a WiFi network. There also have computer is connecting directly to the WiFi network. Because both network share the ip 192.168.1.xxx The computer directly connect to the WiFi is using 192.168.1.100-199 and the computers under the Linux hotspot is using 192.168.1.10-99. The both using the gateway 192.168.1.1 Now i have configured the ARP and the kernel ip routing table of the Linux hotspot. Below is what i have done on the Linux hotspot configure.
net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
suppose i have a computer connecting the Linux hotspot with 192.168.1.20 and a computer directly connecting to the WiFi 192.168.1.110 and the Linux hotspot have is 192.168.1.120 the external mac address of the linux hotspot is 08:00:27:71:85:BD and the internal is 08:00:27:2A:30:14
arp -i wlan0 -s 192.168.1.20 08:00:27:71:85:BD pub
route add -host 192.168.1.20 wlan1
arp -i wlan1 -s 192.168.1.110 08:00:27:2A:30:14 pub
arp -i wlan1 -s 192.168.1.1 08:00:27:2A:30:14 pub
After these setup my computer under the linux hotspot is able to surf the internet and ping 192.168.1.1 ,also able to ping the computer under the WiFi network 192.168.1.110 and the Linux hotspot 192.168.1.120. But my problem is that i find the computer which is directly connect to the Wifi with ip 192.168.1.110 cannot ping 192.168.1.20 which is the computer under the Linux hotspot. Can anyone help me. Thanks a lot.