可用网络有usb0(4g dongle), 可以访问公网;和作为共享热点的wlan0:
为防止WLAN为随意使用,但只想开放WLAN特定端口5060可以访问公网如何实现呢?
当前系统的route config如下:
root@doordu:/ # busybox route -n
busybox route -nKernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.224.30.249 0.0.0.0 UG 0 0 0 usb0
10.224.30.248 0.0.0.0 255.255.255.248 U 0 0 0 usb0
10.224.30.249 0.0.0.0 255.255.255.255 UH 0 0 0 usb0
74.125.23.100 10.224.30.249 255.255.255.255 UGH 0 0 0 usb0
74.125.23.101 10.224.30.249 255.255.255.255 UGH 0 0 0 usb0
74.125.23.102 10.224.30.249 255.255.255.255 UGH 0 0 0 usb0
74.125.23.138 10.224.30.249 255.255.255.255 UGH 0 0 0 usb0
192.168.43.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
想实现限制192.168.43.1~192.168.43.255对公网的访问,请问谁用iptables或者route 能实现?
已经有解,用iptables可以实现,
iptables -i wlan0 -I FORWARD -p tcp -j DROP
iptables -i wlan0 -I FORWARD -p tcp --dport 5060 -j ACCEPT