Configure the UbuntuServer network through the command line

Source: Internet
Author: User
To configure the ipvtuserver network in the command line, first configure your IP address and other information: Use vi to open/etc/network/interfaces: vi/etc/network/interfaces if you use a fixed ip address, enter the following content: autoeth0ifaceeth0inetstaticaddress192.168.0.2 # your ip address netmask424255.

Configure the Ubuntu Server network through the command line

First, configure your IP address and other information:

Use vi to open/etc/network/interfaces: vi/etc/network/interfaces

If you are using a fixed ip address, enter the following content:

Auto eth0

Iface eth0 inet static

Address 192.168.0.2 # your IP address

Netmask 255.255.255.0

Gatway 192.168.0.1

Use vi to create the file/etc/resolv. conf: vi/etc/resolv. conf

Enter the following content in the file:

Nameserver 202.117.0.20

Nameserver 202.117.0.21 # This is the backup Domain Name Server address.

After completing the above characters, enter sudo/etc/init. d/networking restart in the terminal. Generally, it will wait for several seconds. When [OK] is displayed, the configuration is successful.

For testing, you can enter the ping command in the terminal: ping www.linuxidc.com. If there is a response instead of network is unreachable, it indicates that the ping is successful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.