Run the following command to configure the static IP address and hostname in the Ubuntu network:

Source: Internet
Author: User
I learned about the Ubuntu network configuration. Here I will introduce the Ubuntu network configuration application in detail, I hope to use Ubuntu network configuration to include a very good translation and easy-to-use architecture. configure a DHCP address for the NIC: to configure a DHCP address, edit/etc/network/interfaces and enter the following lines (assume that your Nic is eth0 ): sudovi/etc/network/interface

I learned about the Ubuntu network configuration. Here I will introduce the Ubuntu network configuration application in detail, I hope to use Ubuntu network configuration to include a very good translation and easy-to-use architecture. configure a DHCP address for the NIC: to configure a DHCP address, edit/etc/network/interfaces and enter the following lines (assume that your Nic is eth0 ): sudo vi/etc/network/interfaces

# The primary network interface-use DHCP to find our address

Auto eth0

Iface eth0 inet dhcp // specify as dhcp

After entering these lines, run the following command to restart your network device: sudo/etc/init. d/networking restart

Configure a static IP address for the NIC

To configure a static IP address, edit/etc/network/interfaces and enter the following lines (assume that your Nic is eth0): sudo vi/etc/network/interfaces

# The primary network interface

Auto eth0

Iface eth0 inet static // specify as static

Address 192.168.3.90 // ip address

Gateway 192.168.3.1 // gateway

Netmask 255.255.255.0 // Subnet Mask

Network 192.168.3.0 // This ...... Network?

Broadcast 192.168.3.255 // broadcast

After entering these lines, run the following command to restart your network device: sudo/etc/init. d/networking restart

Set the second IP address or virtual IP address. If you are a server administrator or a common user, you can assign a second IP address to the system, edit the/etc/network/interfaces file (assuming your Nic is eth0 ):

Sudo vi/etc/network/interfaces

Auto eth0: 1

Iface eth0: 1 inet static

Address 192.168.1.60

Netmask 255.255.255.0

Network x. x

Broadcast x. x

Gateway x. x

After entering these lines, run the following command to restart your network device: sudo/etc/init. d/networking restart

Set the hostname of the Ubuntu network configuration system to change the hostname of the system using the following command format, or directly edit/etc/hostname sudo hostname newname

Set DNS

Sudo vi/etc/resolv. conf

Enter the following details

Search test.com

Nameserver 192.168.3.2

The above describes the Ubuntu network configuration.

Related Article

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.