It turns out that firestarter is playing a strange role. It is no wonder that the ping via the network cable will fail, affecting the judgment. Generally, you can configure an IP address, such as static or DHCP, by using the network tool provided by Ubuntu after inserting the network adapter. You do not need to manually modify the interfaces file. After plugging in the network cable, you can set the IP address of the corresponding Nic to ping each other from the client and the dual Nic host. If the ping fails, first check whether the firewall is installed and then check the network cable and interface. The main problem is how to achieve Internet sharing.
It turns out that firestarter is playing a strange role. It is no wonder that the ping via the network cable will fail, affecting the judgment.
Generally, you can configure an IP address, such as static or DHCP, by using the network tool provided by Ubuntu after inserting the network adapter. You do not need to manually modify the interfaces file.
After plugging in the network cable, you can set the IP address of the corresponding Nic to ping each other from the client and the dual Nic host. If the ping fails, first check whether the firewall is installed and then check the network cable and interface.
The main problem is how to achieve Internet sharing:
1. Modify the/etc/rc. local file and add
Iptables-F
Iptables-P INPUT ACCEPT
Iptables-P FORWARD ACCEPT
Iptables-t nat-a postrouting-s 192.168.0.0/24-o eth0-j MASQUERADE
The first sentence is to clear all previous iptables rules, the third sentence is to allow receiving and sending data packets, and the fourth sentence is to NAT on the eth0 network port. Note: Perform NAT on the network port with an external IP address.
2. Modify/etc/sysctl. conf and add the following line to the file: net. ipv4.ip _ forward = 1. NAT is enabled here. 1 indicates forwarding. If it is set to 0, it is not forwarded.
After reboot, connect to the Internet first, and then try the client to access the Internet.