Hi
@Xentrk,
Previously I use
x3mRouting 1 0 ipset_name=AstroGo autoscan=astro
and it auto generated ipset_name=AstroGo dnsmasq=amazonaws.com,cloudflare.net,com.my,vsscloud-astroprod.tv
Everything works fine. But then I find the ipset AstroGo keeps growing until I realized I am adding way more that what I needed to the ipset.
After redo again with more specific query, I trim it down to only 3 IP.
Update: I have change to manual ip mode like this now in nat-start.
Code:
#!/bin/sh
sh /jffs/scripts/x3mRouting/x3mRouting.sh server=2 client=1
sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 ipset_name=AstroGo ip=13.228.31.33,13.250.167.128,18.140.144.126
sh /jffs/scripts/x3mRouting/x3mRouting.sh server=2 ipset_name=AstroGo
sh /jffs/scripts/x3mRouting/x3mRouting.sh 1 0 WAN_IP dnsmasq=whatsmyip.com
sh /jffs/scripts/x3mRouting/x3mRouting.sh ALL 1 VPN_IP dnsmasq=whatismyipaddress.com
sh /jffs/scripts/x3mRouting/x3mRouting.sh ALL 2 DummyVPN2 dnsmasq=dummyvpn2.me
Everything is working fine.
Code:
RPDB Rules
0: from all lookup local
9990: from all fwmark 0x8000/0x8000 lookup main
9994: from all fwmark 0x2000/0x2000 lookup ovpnc2
9995: from all fwmark 0x1000/0x1000 lookup ovpnc1
10001: from 192.168.1.1 lookup main
10101: from 10.16.0.0/24 lookup ovpnc1
10102: from 192.168.1.2 lookup ovpnc1
10103: from 192.168.1.11 lookup ovpnc1
10104: from 192.168.1.21 lookup ovpnc1
10105: from 192.168.1.91 lookup ovpnc1
32766: from all lookup main
32767: from all lookup default
Client ovpnc1 port 1194 udp
default via 10.8.2.1 dev tun11
10.8.2.0/24 dev tun11 proto kernel scope link src 10.8.2.2
Client ovpnc2 port 443 tcp-client
default via 10.7.1.1 dev tun12
10.7.1.0/24 dev tun12 proto kernel scope link src 10.7.1.3
Client ovpnc3 port 1194 udp
Client ovpnc4 port 1194 udp
Client ovpnc5 NOT configured
Table main
default via 60.51.46.254 dev ppp0
FWMARK Tagging
Chain PREROUTING (policy ACCEPT 356 packets, 648K bytes)
num pkts bytes target prot opt in out source destination
1 0 0 MARK all -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set DummyVPN2 dst MARK or 0x2000
2 0 0 MARK all -- tun22 * 0.0.0.0/0 0.0.0.0/0 match-set AstroGo dst MARK or 0x8000
3 0 0 MARK all -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set AstroGo dst MARK or 0x8000
4 0 0 MARK all -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set WAN_IP dst MARK or 0x8000
5 0 0 MARK all -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set VPN_IP dst MARK or 0x1000
Here is a weird problem. I have nothing but a dummy in VPN Client 2. If I go to VPN page GUI Client 2 turn off and turn on the button everything is fine. In scMerlin, if I reset VPN Client 1, everything is working fine. Somehow whenever I use scMerlin to reset VPN Client 2, both AstroGo route will get deleted.
Code:
RPDB Rules
0: from all lookup local
9990: from all fwmark 0x8000/0x8000 lookup main
9994: from all fwmark 0x2000/0x2000 lookup ovpnc2
9995: from all fwmark 0x1000/0x1000 lookup ovpnc1
10001: from 192.168.1.1 lookup main
10101: from 10.16.0.0/24 lookup ovpnc1
10102: from 192.168.1.2 lookup ovpnc1
10103: from 192.168.1.11 lookup ovpnc1
10104: from 192.168.1.21 lookup ovpnc1
10105: from 192.168.1.91 lookup ovpnc1
32766: from all lookup main
32767: from all lookup default
Client ovpnc1 port 1194 udp
default via 10.8.2.1 dev tun11
10.8.2.0/24 dev tun11 proto kernel scope link src 10.8.2.2
Client ovpnc2 port 443 tcp-client
default via 10.7.2.1 dev tun12
10.7.2.0/24 dev tun12 proto kernel scope link src 10.7.2.2
Client ovpnc3 port 1194 udp
Client ovpnc4 port 1194 udp
Client ovpnc5 NOT configured
Table main
default via 60.51.46.254 dev ppp0
FWMARK Tagging
Chain PREROUTING (policy ACCEPT 862 packets, 167K bytes)
num pkts bytes target prot opt in out source destination
1 0 0 MARK all -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set WAN_IP dst MARK or 0x8000
2 0 0 MARK all -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set VPN_IP dst MARK or 0x1000
3 0 0 MARK all -- br0 * 0.0.0.0/0 0.0.0.0/0 match-set DummyVPN2 dst MARK or 0x2000
I am not sure why reset of VPN Client 2 in scMerlin will have such effect. I added iptables for AstroGo in vpnclient2-route-up which seems to solve the issue. I don't need this in vpnclient1-route-up script though.
Code:
admin@RT-AC86U-DBA8:/tmp/mnt/amtm/entware/tmp# more /jffs/scripts/x3mRouting/vpnclient2-route-up
#!/bin/sh
logger "VPN Client 2 coming up ..."
iptables -t mangle -D PREROUTING -i br0 -m set --match-set DummyVPN2 dst -j MARK --set-mark 0x2000/0x2000 2>/dev/null
iptables -t mangle -A PREROUTING -i br0 -m set --match-set DummyVPN2 dst -j MARK --set-mark 0x2000/0x2000
iptables -t mangle -D PREROUTING -i tun22 -m set --match-set AstroGo dst -j MARK --set-mark 0x8000/0x8000 2>/dev/null
iptables -t mangle -A PREROUTING -i tun22 -m set --match-set AstroGo dst -j MARK --set-mark 0x8000/0x8000
iptables -t mangle -D PREROUTING -i br0 -m set --match-set AstroGo dst -j MARK --set-mark 0x8000/0x8000 2>/dev/null
iptables -t mangle -A PREROUTING -i br0 -m set --match-set AstroGo dst -j MARK --set-mark 0x8000/0x8000