IPv4 is the first protocol that is widely used to form the cornerstone of today's Internet technologies. In the Ubuntu system, we also need to set it up. If you are not sure how to set up friends, study this tutorial carefully.
Setting IPv4 is mainly to edit the two files /etc/network/interfaces and /etc/resolv.conf. The former sets the ip address, gateway, subnet mask, and the latter sets the attributes such as dns.
Example:
1. In DHCP arranged NIC
Edit file /etc /network /interfaces:
sudo vi /etc /Network/interfaces
and replace the line for eth0 with the following line:
# The primary network interface - use DHCP to find our address
auto eth0
iface eth0 inet dhcp
Use the following command to make the network settings take effect:
sudo /etc/init.d/networking restart
can also be directly from the command line Enter the following command to get the address
sudo dhclient eth0
2. Configure a static IP address for the NIC
Edit the file /etc/network/interfaces:
sudo vi /etc/network/interfaces
and replace the line for eth0 with the following line: # The primary network interface
auto eth0
iface eth0 inet static< Br>
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
#network 192.168.3.0
#broadcast 192.168.3.255
Change the above ip address and other information to yourself. Use the following command to make the network settings take effect:
sudo /etc/init. d/networking restart
3. Set the second IP address (virtual IP address)
Edit the file /etc/network/interfaces:
sudo vi /etc/Network/interfaces
Add the following line to the file:
auto eth0:1
iface eth0:1 inet static
address 192.168.1.60
netmask 255.255.255.0
network xxxx
broadcast xxxx
gateway xxxx
Fill in all the addresses such as address according to your situation. Netmask, network, broadcast, and gateways.
Use the following command to make the network settings take effect:
sudo /etc/init.d/networking restart
4. Configuration DNS
First, you can add some hostnames and IP addresses corresponding to these hostnames in /etc/hosts, which is a simple static query using this machine.
To access the DNS server for querying, you need to set the /etc/resolv.conf file.
Assuming the IP address of the DNS server is 192.168.3.2, the contents of the /etc/resolv.conf file should be :
nameserver 192.168.3.2
The above is about setting up IPv4 in Ubuntu system. Have you learned the tutorials of this tutorial? If you have more simple Method, welcome to interact with Xiaobian message.
In Linux systems, multiple network cards are usually bundled into one logical netwo
As a Linux geek, it is not enough to master some basic system knowledge. You need t
The compatibility between Linux and iPhone is not good. I want to mount the iPhone
Many users in the Linux system are exposed to shorter commands, and hadoop dfs commands are more dif
How to use the tail command guide under Linux
How to modify the color of the Linux system shell script output text
Summary of lftp usage in Linux system
Linux system how to configure multi-path
Ubuntu 12.04 installation Xen FAQ and solution
Linux forced to delete the U disk virus skills
The difference between Apache and Tomcat in Linux system is
How Linux distinguishes between install command and cp command
How to install different versions of Linux system on the same computer
How to configure network under Debian system
Linux system to find ways to replace non-UTF-8 encoded files
To delete the extra input method in Win7 system, tutorial
What should I do if Win10's UAC dialog box is unavailable?
How to change the desktop icon, XP replace the desktop icon (a)
Win8 right "this computer" management prompts the solution to find the file
AutoCAD Basic Tutorial: Interface Layout and Basic Concepts
Win7 system IE task bar how to pop up IE
How Win8 hides the navigation pane of File Explorer to protect privacy
How does win7 customize the color to protect your eyesight?
Win7 task manager does not show the process task manager display incomplete solution