The ethernet card location eth0 3G Nic is ppp0
1. Set the Ethernet port to a static IP Address:
IP: 192.168.1.1 255.255.255.0
GW: 192.168.1.1 DNS: 202.101.172.35
2. Test the notebook IP settings:
IP: 192.168.1.2 255.255.255.0
GW: 192.168.1.1 DNS: 202.101.172.35
3. Connect the network over Ethernet and 3G network. Ping 192.168.1.1 from the notebook to confirm that the notebook is connected to the Android device.
4. Check the current route status through busybox route.
You can see that the current default route is 192.168.1.1 and you need to manually modify the route.
Run the following command
# Busybox route del default GW 192.168.1.1
Busybox route del default GW 192.168.1.1
# Busybox route add default GW 10.64.64.64
Busybox route add default GW 10.64.64.64
View Gateway:
# Iptables-T Nat-A postrouting-O ppp0-J Masquerade
Iptables-T Nat-A postrouting-O ppp0-J Masquerade
# Iptables-T Nat-A postrouting-O eth0-J Masquerade
Iptables-T Nat-A postrouting-O eth0-J Masquerade
# Echo "1">/proc/sys/NET/IPv4/ip_forward
Echo "1">/proc/sys/NET/IPv4/ip_forward
5. Ping www. Baidu. com on the test laptop. You can see that ping is successful.