OSDN Git Service

Merge remote-tracking branch 'x86/nougat-x86' into oreo-x86
[android-x86/device-generic-common.git] / ppp / ip-up
1 #!/system/bin/sh
2 export PATH=/system/bin
3
4 case $1 in
5     ppp1)
6         iptables --flush
7         iptables --table nat --flush
8         iptables --delete-chain
9         iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
10         iptables --append FORWARD --in-interface ppp1 -j ACCEPT
11         echo 1 > /proc/sys/net/ipv4/ip_forward
12         ;;
13     ppp0)
14         setprop "net.interfaces.defaultroute" "gprs"
15         ;;
16 esac
17
18 # Use interface name if linkname is not available
19 NAME=${LINKNAME:-"$1"}
20
21 setprop "net.dns1" "$DNS1"
22 setprop "net.dns2" "$DNS2"
23 setprop "net.$NAME.local-ip" "$IPLOCAL"
24 setprop "net.$NAME.gw" "$IPREMOTE"