andresmorago
Senior Member
Hello to All
I have been working on selective routing on my AC66U. So far, i got to this:
Enabled PPTP client
Enabled 5GHz guest network wl1.1
Routed all PPTP traffic via wl1.1
Routed all IPS regular traffic via eth1 and eth2 (Standard 2.4 and 5 wifi)
Here is my problem:
I currently have some DNS specific parameters on /jffs/configs/dnsmasq.conf.add which i need for my regular internet on eth1 and eth2 interfaces. These parameters routes DNS queries for these 2 websites through a specific server.
This works OK but all around my router![Frown :( :(](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f641.png)
My question:
Now that i have selective routing for my ppp5 interface, how can i configure dnsmasq to NOT route these 2 websites through 54.224.xxx.yy ?
I would like ALL ppp5 traffic go through 8.8.8.8 server but keeping the original parameters on /jffs/configs/dnsmasq.conf.add for my standard interfaces
Here is my selective routing script which is working OK so far.
I tried to add some extra code at the end of the DHCP Server section with no luck so far
I have been working on selective routing on my AC66U. So far, i got to this:
Enabled PPTP client
Enabled 5GHz guest network wl1.1
Routed all PPTP traffic via wl1.1
Routed all IPS regular traffic via eth1 and eth2 (Standard 2.4 and 5 wifi)
Here is my problem:
I currently have some DNS specific parameters on /jffs/configs/dnsmasq.conf.add which i need for my regular internet on eth1 and eth2 interfaces. These parameters routes DNS queries for these 2 websites through a specific server.
This works OK but all around my router
![Frown :( :(](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f641.png)
Code:
server=/ipinfo.io/54.224.xxx.yy
server=/pandora.com/54.224.xxx.yy
My question:
Now that i have selective routing for my ppp5 interface, how can i configure dnsmasq to NOT route these 2 websites through 54.224.xxx.yy ?
I would like ALL ppp5 traffic go through 8.8.8.8 server but keeping the original parameters on /jffs/configs/dnsmasq.conf.add for my standard interfaces
Here is my selective routing script which is working OK so far.
I tried to add some extra code at the end of the DHCP Server section with no luck so far
Code:
#!/bin/sh
####### Interface Specific Settings #######
WRLSS_IF=wl1.1 # Name of the wireless interface that will be used.
WRLSS_IF_NTWK_ADDR=10.0.1.0 # Network address that the wireless interface will be on.
WRLSS_IF_INET_ADDR=10.0.1.1 # IP address that will be assigned to the wireless interface.
WRLSS_IF_NETMASK=255.255.255.0 # Netmask of the wireless network to be added.
TUN_IF=ppp5 # Name of tunnel interface.
########## DHCP Specific Settings ###########
DHCP_OPT1=3 # dnsmasq option to specify router.
LS_TIME=86400s # Duration of the dhcp leases.
LS_START=10.0.1.10 # Start address of leases. This needs to be within the same network as above.
LS_END=10.0.1.20 # End address of leases. This needs to be within the same network as above.
######## Hide SSID of Guest Network ########
HIDE_SSID=0 # This option is to hide the SSID of a guest network if a guest network is used. Input 1 to hide and 0 to make it visible.
##########################################################################################################
##########################################################################################################
########################################## DHCP Server ###################################################
ifconfig $WRLSS_IF $WRLSS_IF_INET_ADDR netmask $WRLSS_IF_NETMASK
if [ `cat /etc/dnsmasq.conf | grep -c $WRLSS_IF` == 0 ]; then
killall dnsmasq
sleep 2
echo "interface=$WRLSS_IF" >> /etc/dnsmasq.conf
echo "server=8.8.8.8" >> /etc/dnsmasq.conf
echo "dhcp-range=$WRLSS_IF,$LS_START,$LS_END,$WRLSS_IF_NETMASK,$LS_TIME" >> /etc/dnsmasq.conf
echo "dhcp-option=$WRLSS_IF,$DHCP_OPT1,$WRLSS_IF_INET_ADDR" >> /etc/dnsmasq.conf
echo "interface=$TUN_IF" >> /etc/dnsmasq.conf
echo "server=8.8.8.8" >> /etc/dnsmasq.conf
dnsmasq --log-async
fi
sleep 2
### Check to see if tun interface is available ###
while [ ! -n "`ifconfig | grep $TUN_IF`" ]; do
sleep 1
done
############################################ IP ROUTING ##################################################
ip route delete default via 192.168.1.1 dev ppp5
route -n add -net 192.168.1.0 netmask 255.255.255.0 ppp5
ip route show table main | grep -Ev ^default | while read ROUTE; do
ip route add table 10 $ROUTE;
done
# Uncomment this line if you are not using the route-nopull option.
#ip route del 0.0.0.0/1 table main
# Many VPN service providers push this route to redirect internet traffic over the tunnel.
ip route add default dev $TUN_IF table 10
ip rule add dev $WRLSS_IF table 10
ip route flush cache
####################################### ETHERNET BRIDGE TABLES RULES #####################################
EBT_BRULE1="-p ipv4 -i $WRLSS_IF -j DROP"
EBT_BRULE2="-p arp -i $WRLSS_IF -j DROP"
if [ -n "$EBT_BRULE1" ] && [ `ebtables -t broute -L | grep -ice "$EBT_BRULE1"` != 1 ]; then
ebtables -t broute -I BROUTING $EBT_BRULE1
fi
if [ -n "$EBT_BRULE2" ] && [ `ebtables -t broute -L | grep -ice "$EBT_BRULE2"` != 1 ]; then
ebtables -t broute -I BROUTING $EBT_BRULE2
fi
############################################ IP TABLES RULES #############################################
if [ `iptables -L -v | grep -c $WRLSS_IF` == 0 ]; then
iptables -I INPUT -i $WRLSS_IF -m state --state NEW -j ACCEPT
iptables -I FORWARD -i $WRLSS_IF -o $TUN_IF -j ACCEPT
fi
if [ `iptables -t nat -L -v | grep -c $TUN_IF` == 0 ]; then
iptables -t nat -I POSTROUTING -s $WRLSS_IF_NTWK_ADDR/24 -o $TUN_IF -j MASQUERADE # Change /24 to the subnet that you will be using.
fi
############################################### HIDE SSID ################################################
if [ `nvram get "$WRLSS_IF"_closed` != 1 ] && [ $HIDE_SSID == 1 ]; then
nvram set "$WRLSS_IF"_closed=1
nvram commit
fi
if [ `nvram get "$WRLSS_IF"_closed` != 0 ] && [ $HIDE_SSID == 0 ]; then
nvram set "$WRLSS_IF"_closed=0
nvram commit
fi