【问题标题】:Settingup router vpn while exluding Netflix在排除 Netflix 时设置路由器 vpn
【发布时间】:2018-08-06 19:23:23
【问题描述】:

我有一个已激活 OpenVPN 服务的 DD-WRT 路由器。我创建了以下启动脚本,希望将 Netflix 从 VPN 隧道中排除。但是,我还没有成功。当我在 whatsmyip.org 上查找 ip 时,我仍然得到 VPN 服务器的 ip,而不是我自己的。你能看出哪里不对吗?

SCRIPT_DIR="/tmp/etc/config" 
SCRIPT="$SCRIPT_DIR/add-routes.wanup" 
mkdir -p $SCRIPT_DIR 

cat << "EOF" > $SCRIPT 
#!/bin/sh 

# dd-wrt selective domain routing 
WAN_GWAY="0.0.0.0"
while [ $WAN_GWAY == "0.0.0.0" ]; do
sleep 3
WAN_GWAY=`nvram get wan_gateway`
done 

# list domains for selective routing 
for domain in \ 
"netflix.com" \ 
"ichnaea.netflix.com" \ 
"movies.netflix.com" \ 
"www.netflix.com" \ 
"nflxext.com" \ 
"cdn1.nflxext.com" \ 
"nflximg.com" \ 
"nflxvideo.net" \ 
"ipv4_1.cxl0.c145.sjc002.ix.nflxvideo.net" \ 
"amazonaws.com" \ 
"whatsmyip.org" 
do 
  # extract ip addresses 
  for ip in $(nslookup $domain | awk '/^Name:/,0{if (/^Addr/)print $3}'); do 
    # add class c route for each ip address to wan gateway 
    ip route add `echo $ip | cut -d . -f 1,2`.0.0/16 via $WAN_GW 
  done 
done 

# flush cache 
ip route flush cache 
EOF 

chmod +x $SCRIPT 
sleep 60 
$SCRIPT

【问题讨论】:

    标签: openvpn dd-wrt


    【解决方案1】:

    尝试使用它。而不是直接使用该列表指定路线。

    #!/bin/sh 
    # specify your own route(s), then place this script in the startup script 
    ( 
    set -x # comment/uncomment to disable/enable debug mode 
    WANUP_DIR="/tmp/etc/config" 
    WANUP_SCRIPT="$WANUP_DIR/add-routes.wanup" 
    mkdir -p $WANUP_DIR 
    cat << "EOF" > $WANUP_SCRIPT 
    #!/bin/sh 
    ip route add 199.199.199.199 via $(nvram get wan_gateway) 
    ip route add 177.177.177.0/24 via $(nvram get wan_gateway) <-- Change ips to what you want
    EOF 
    chmod +x $WANUP_SCRIPT 
    ) 2>&1 | logger -t $(basename $0)[$$]
    

    了解更多信息以及我在哪里找到的 https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=313324&sid=c64a45234a73595b6e912a7e35f484ea

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-24
      • 1970-01-01
      • 1970-01-01
      • 2015-03-14
      • 2016-08-18
      • 2018-03-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多