Browse Source

ss-nat: Specify LAN interface with -I flag

pull/1584/merge
Zhuoyun Wei 7 years ago
committed by Max Lv
parent
commit
a46d2a1a83
1 changed files with 6 additions and 2 deletions
  1. 8
      src/ss-nat

8
src/ss-nat

@ -26,6 +26,7 @@ usage() {
-S <server_ip> ip address of shadowsocks remote UDP server
-L <local_port> port number of shadowsocks local UDP server
-i <ip_list_file> a file content is bypassed ip list
-I <interface> lan interface of nat, default: eth0
-a <lan_ips> lan ip of access control, need a prefix to
define access control mode
-b <wan_ips> wan ip of will be bypassed
@ -97,7 +98,7 @@ ac_rule() {
;;
esac
fi
IFNAME=eth0
IFNAME=${IFNAME:-eth0}
ipset -! -R <<-EOF || return 1
create ss_spec_lan_ac hash:net
$(for ip in ${LAN_AC_IP:1}; do echo "add ss_spec_lan_ac $ip"; done)
@ -166,7 +167,7 @@ EOF
return $?
}
while getopts ":s:l:S:L:i:e:a:b:w:ouUfh" arg; do
while getopts ":s:l:S:L:i:I:e:a:b:w:ouUfh" arg; do
case "$arg" in
s)
server=$OPTARG
@ -183,6 +184,9 @@ while getopts ":s:l:S:L:i:e:a:b:w:ouUfh" arg; do
i)
IGNORE_LIST=$OPTARG
;;
I)
IFNAME=$OPTARG
;;
e)
EXT_ARGS=$OPTARG
;;

Loading…
Cancel
Save