After receiving a client's server, the Ubuntu system was found to have been started. at that time, I was a little depressed and thought that I had not configured the ubuntu system. the client was still there, and I felt a little nervous, as a result, I began to search for various methods for configuration on the Internet, and finally configured the IP address and connected the client for mounting and debugging. now I will share with you the configuration method;
After receiving a client's server, the Ubuntu system was found to have been started. at that time, I was a little depressed and thought that I had not configured the ubuntu system. the client was still there, and I felt a little nervous, as a result, I began to search for various methods for configuration on the Internet, and finally configured the IP address and connected the client for mounting and debugging. now I will share with you the configuration method;
There are two IP address configuration methods:
1,Directly configure using commands
Sudo ifconfig eth0 IP address netmask subnet mask ------ configure IP address location
Sudo route add default gw gateway ------------ add default route
Vi/etc/resolv. conf configuration file add nameserver DNS ---- configure DNS
Sudo/etc/init. d/networking restart ----------- restart Nic configuration
However, the configuration information can only be temporarily modified. after the server is restarted, the configuration information is lost. in the second method, the configuration file is directly modified. after the server is restarted, the configuration information is not lost;
2,Directly modify the configuration file
The Ubuntu system configuration file is at:/etc/network/interfaces
Edit the configuration file: sudo vi/etc/network/interfaces
Replace eth0 with the following rows:
# The primary network interface
Auto eth0
Iface eth0 inet static
Address IP address
Gateway
Netmask subnet mask
# Network 192.168.2.0
# Broadcast 192.168.2.255
Fill in all information such as address, netmask, network, broadcast, and gateways according to your situation:
Sudo/etc/init. d/networking restart -- restart the NIC to make the configuration take effect.
After configuring the IP address, you need to configure DNS as follows;
Sudo vi/etc/resolv. conf
Search chotim.com
Nameserver DNS server address
Sudo/etc/init. d/networking restart -- restart the Nic service.