diff --git a/src/ss-nat b/src/ss-nat index 7501004e..1dfcc77b 100755 --- a/src/ss-nat +++ b/src/ss-nat @@ -26,6 +26,7 @@ usage() { -S ip address of shadowsocks remote UDP server -L port number of shadowsocks local UDP server -i a file content is bypassed ip list + -I lan interface of nat, default: eth0 -a lan ip of access control, need a prefix to define access control mode -b 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 ;;