hereis is the firewall policy /etc/firewall.user
iptables -F
iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.35.30/32 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.35.40/32 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.35.7/32 -j MASQUERADE
iptables --delete-chain forward
iptables --delete-chain forward_fule
iptables --delete-chain input
iptables --delete-chain input_rule
iptables --delete-chain output
iptables --delete-chain output_rule
iptables -A INPUT --src 127.0.0.1 -j ACCEPT
iptables -A INPUT --src 192.168.35.254 -j ACCEPT
### Eric
iptables -I OUTPUT 1 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p ICMP --icmp-type 8 -s 0.0.0.0/0 -j ACCEPT
iptables -A INPUT -p ICMP --icmp-type 11 -s 0.0.0.0/0 -j ACCEPT
### test for client access
iptables -P FORWARD ACCEPT
#iptables -t nat -A POSTROUTING -o eth1 -s 192.168.35.0/24 -j MASQUERADE
###
iptables -A OUTPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 53 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --dport 3128 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 3128 -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT
iptables -A INPUT --src 192.168.35.0/255.255.255.0 -p tcp -m multiport -i br-lan --destination-ports 22,23,53,80,3128 -j ACCEPT
iptables -A INPUT --src 192.168.35.0/255.255.255.0 -p tcp -m multiport -i br-lan --source-ports 37 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT --src 192.168.35.0/255.255.255.0 -p icmp -m limit --limit 90/second -i br-lan -j ACCEPT
iptables -A INPUT --src 192.168.35.0/255.255.255.0 -p icmp -i br-lan -j ACCEPT
iptables -A INPUT --src 192.168.35.0/255.255.255.0 -p icmp -i br-lan -j ACCEPT
ipset destroy bo_nets
ipset destroy bo_gws
ipset destroy bo_gw_nets
ipset -N bo_nets hash:net
ipset -N bo_gws hash:ip
ipset -N bo_gw_nets hash:net
ipset -A bo_gw_nets 27.105.68.0/24
ipset -A bo_gw_nets 27.105.100.0/24
ipset -A bo_gw_nets 219.84.236.0/24
ipset -A bo_gw_nets 219.85.24.0/24
ipset -A bo_gw_nets 61.56.138.0/24
ipset -A bo_gw_nets 219.85.36.0/24
ipset -A bo_gw_nets 219.85.16.0/24
ipset -A bo_gw_nets 61.64.120.0/24
ipset -A bo_nets 192.168.70.0/24
ipset -A bo_nets 192.168.60.0/24
ipset -A bo_nets 192.168.22.0/24
ipset -A bo_nets 192.168.34.0/24
ipset -A bo_nets 192.168.20.0/24
ipset -A bo_nets 192.168.25.0/24
ipset -A bo_nets 192.168.40.0/24
ipset -A bo_nets 192.168.0.0/24
ipset -A bo_nets 192.168.1.0/24
ipset -A bo_nets 192.168.28.0/24
ipset -A bo_nets 192.168.23.0/24
ipset -A bo_nets 192.168.11.0/24
ipset -A bo_nets 192.168.111.0/24
ipset -A bo_nets 192.168.80.0/24
ipset -A bo_gws 61.56.138.74
ipset -A bo_gws 219.84.236.179
ipset -A bo_gws 219.84.236.178
ipset -A bo_gws 27.105.100.19
ipset -A bo_gws 219.85.16.196
ipset -A bo_gws 27.105.68.44
ipset -A bo_gws 219.85.36.45
ipset -A bo_gws 61.64.120.160
ipset -A bo_gws 219.84.236.121
iptables -A INPUT -m set --match-set bo_gws src -i eth1 -p udp --sport 500 --dport 500 -j ACCEPT
iptables -A INPUT -m set --match-set bo_gws src -i eth1 -p 50 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 3128 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 3128 -m state --state ESTABLISHED -j ACCEPT
iptables -A FORWARD -m set --match-set bo_nets src -i ipsec0 -p icmp -m limit --limit=90/second -j ACCEPT
iptables -A INPUT -m set --match-set bo_nets src -i ipsec0 -p icmp -m limit --limit=90/second -j ACCEPT
iptables -A FORWARD -m set --match-set bo_nets dst -i br-lan -p icmp -m limit --limit=90/second -j ACCEPT
iptables -A FORWARD -m set --match-set bo_gw_nets src -i ipsec0 -p icmp -m limit --limit=90/second -j ACCEPT
iptables -A FORWARD -m set --match-set bo_gw_nets dst -i br-lan -p icmp -m limit --limit=90/second -j ACCEPT
iptables -A INPUT -m set --match-set bo_nets src -p tcp -m multiport -i ipsec0 --destination-ports 22,80 -j ACCEPT
iptables -A FORWARD -m set --match-set bo_nets src --dst 192.168.35.0/24 -p tcp -i ipsec0 -j ACCEPT
iptables -A FORWARD -m set --match-set bo_nets src --dst 192.168.35.0/24 -p udp -i ipsec0 -j ACCEPT
iptables -A FORWARD --src 192.168.35.0/24 -m set --match-set bo_nets dst -p tcp -i br-lan -j ACCEPT
iptables -A FORWARD --src 192.168.35.0/24 -m set --match-set bo_nets dst -p udp -i br-lan -j ACCEPT
that policy were configured 5 or 6 years ago , and nobody knows the logic now .
I try to ping from the router to other machine in vpn , always 100% packet loss ,
root@OpenWrt:~# ping 192.168.11.34
PING 192.168.11.34 (192.168.11.34): 56 data bytes
^C
--- 192.168.11.34 ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss
root@OpenWrt:~#
but I can ping from router to internet
root@OpenWrt:~# ping 168.95.1.1
PING 168.95.1.1 (168.95.1.1): 56 data bytes
64 bytes from 168.95.1.1: seq=0 ttl=245 time=7.744 ms
64 bytes from 168.95.1.1: seq=1 ttl=245 time=7.968 ms
64 bytes from 168.95.1.1: seq=2 ttl=245 time=9.032 ms
64 bytes from 168.95.1.1: seq=3 ttl=245 time=10.188 ms
^C
--- 168.95.1.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 7.744/8.733/10.188 ms
root@OpenWrt:~#
and other client in the same lan with the router can ping to the remote client
ping 192.168.11.34
PING 192.168.11.34 (192.168.11.34) 56(84) bytes of data.
64 bytes from 192.168.11.34: icmp_seq=1 ttl=60 time=14.1 ms
64 bytes from 192.168.11.34: icmp_seq=2 ttl=60 time=13.7 ms
64 bytes from 192.168.11.34: icmp_seq=3 ttl=60 time=13.6 ms
64 bytes from 192.168.11.34: icmp_seq=4 ttl=60 time=13.8 ms
^C
--- 192.168.11.34 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 13.664/13.841/14.105/0.186 ms
2019-03-13 16:10:22 [minion@jms007 ~]$
how should I change the policy to let the router can ping to other machines via VPN ?