Network Interface Information File of debian or ubuntu
Source: Internet
Author: User
The Network Interface Information File of debian or ubuntu-Debian information for the Linux release. For details, refer to the following section. Author: Love and destiny in Wuhan
Root @ havp :~ # Cat/etc/network/interfaces
# The local loopback interface auto indicates that the interface is automatically enabled upon startup.
Auto lo
Iface lo inet loopback
# Eth0 settings
Auto eth0
Iface eth0 inet static
Address 192.168.1.250 # IP address
Netmask 255.255.255.0 # Subnet Mask
Network 192.168.1.0 # network no.
Broadcast 192.168.1.255 # broadcast address
Gateway 192.168.1.1 # gateway address
Dns-nameservers 202.103.0.117 202.103.24.68 # dns address, which is generally set in/etc/resolv. conf
# Set the second Nic information. Note that all network interfaces of debian or other debian versions are in one file, which is more convenient than # redhat.
# Sub-interface settings, used to set multiple ip addresses for one Nic
Auto eth0: 1
Iface eth0: 1 inet static
Address 202.103.24.5
Netmask 255.255.255.0
Network 202.103.24.0
Broadcast 202.103.0.255
# The mac address of the NIC is customized. In some special cases, the NIC or machine is changed, but the mac address still needs to be a previous one, as shown below:
Auto eth3
Iface eth3 inet static
Pre-up ifconfig eth3 hw ether xx: xx # check whether this sentence is added. Check whether eth3 corresponds to the preceding statement.
Address 192.168.3.250 # xx: xx is the specified mac
Netmask 255.255.255.0
Network 192.168.3.0
Broadcast 192.168.3.255
# Obtain the address through dhcp, which is the easiest to configure
Auto eth4
Iface eth4 inet dhcp
# If you do not need to write anything else, the dhcp server will automatically obtain the ip address when it is started.
# Enable Configuration
# After the configuration is modified, you can run the following command to update the configuration or restart the machine.
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.