Ubuntu Server Network configuration file/etc/network/interfaces

Source: Internet
Author: User

The configuration of all network cards is basically /etc/network/interfaces in this file. If your IP address is obtained through DHCP , the default interfaces file should look like this:

wherein, the deviceLois aTCP/IPdefined byLoopbackvirtual network devices that enableTCP/IPTo be able to127.0.0.1thisIPAddress (the host name is typicallylocalhost) to access itself. eth0is the first NIC, if you have more than one network card, will beeth1,eth2and so on.

in the above configurationAutokeywords, so that the network device will start automatically when the system starts;Ifaceis aInterfacethe abbreviation, meaning"Interface"equipment. andDHCPThis means that the network device is going throughDHCPto getIPconfiguration information. If you want to specify manuallyIPaddress and other information, you will have toDHCPkeyword insteadStatic:

Auto Eth0iface eth0 inet static address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1

among them, Address keyword designation IP address, netmask Specify the subnet mask, Gateway Specifies the gateway.

After the file is configured, you need to restart the network for it to take effect:

$ sudo/etc/init.d/networking Restart

if you want to control a network card separately, you can use the Ifdown/ifup command:

$sudo Ifdown Eth0$sudo ifup eth0

Ubuntu Server Network configuration file/etc/network/interfaces

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.