1. Use the proxy server to access the Internet
To use machine A to access the Internet through machine B, use the following methods: 1. First, make sure that machine B can access the Internet.
2. install squid software on machine B, $ sudo apt-Get install squid. After installation is complete, a squid configuration file squid is put down on the Internet. conf, and then overwrite the file with the same name under/etc/squid /.
3. test the proxy server on machine B. If you see squid start/running and process 1726 (process number will be different) in $ sudo service squid start, run sudo service squid stop, execute $ sudo service squid start and $ sudo service squid restart when you see squid stop/waiting. if you see squid start/running twice, process 1726 indicates that it is basically OK.
4. Set the network proxy on machine A and change the original proxy to the IP address of machine B, and change the port number to 3128. You can view IP addresses in $ ifconfig.
5. Open a webpage on machine A. If it cannot be opened, delete the squid and reinstall it. $ Sudo apt-Get autoremove squid
PS: the proxy server can be started without a password.
2. Set static IP addresses
The network configuration information of Ubuntu is saved in the/etc/Network/interfaces file. Use Vim to open the configuration file. By default, the configuration of the IP address is automatically obtained as follows:
# The primary network interface
Auto Lo
Iface lo Inet loopback
Next we will set it to a static IP.
Step 1: Disable the settings for Automatically Obtaining IP addresses
Auto lo blocks this line
Iface lo Inet loopback shields this line
The modified content is as follows:
# The primary network interface
# Auto Lo
Auto eth0
# Iface eth0 Inet DHCP
Step 2: Add static IP information
# The primary network interface
Iface eth0 Inet static
Address 45.111.38.58
Netmask 255.255.255.0
Gateway 45.111.38.254
PS: The address must not be the IP address assigned to others.
Restart the network: sudo/etc/init. d/networking restart
After completing the preceding steps, you only need to re-enable the network.