Set ip scripts in linux

Source: Internet
Author: User
In linux, set the ip script-general Linux technology-Linux technology and application information. The following is a detailed description. In Debian, Nic settings can be performed through the/etc/network/interfaces file. There are three different configuration methods: Automatic DHCP acquisition, static IP Address allocation, and PPPoE broadband dialing.

The specific settings are as follows: Before configuration, first go to the/etc/network directory and edit the interfaces file:

The NIC automatically obtains the IP address through DHCP.

# This file describes the network interfaces available on your system
# And how to activate them. For more information, see interfaces (5 ).
#
# The loopback network interface (configure The loopback interface)
# Automatically activate lo at startup
Auto lo
# Configure the lo interface as a loopback interface
Iface lo inet loopback
#
# The primary network interface (configure The primary network interface)
# Enable the eth0 interface automatically upon startup
Auto eth0
# Configure the eth0 interface to automatically obtain DHCP
Iface eth0 inet dhcp

Nic static IP Address Allocation

# This file describes the network interfaces available on your system
# And how to activate them. For more information, see interfaces (5 ).
#
# The loopback network interface (configure The loopback interface)
# Automatically activate lo at startup
Auto lo
# Configure the lo interface as a loopback interface
Iface lo inet loopback
#
# The primary network interface (configure The primary network interface)
# Enable the eth0 interface automatically upon startup
Auto eth0
# Configure the eth0 interface to set static IP addresses
Iface eth0 inet static
Address 10.16.3.99
Netmask 255.255.255.0
Network 10.16.3.0
Broadcast 10.16.3.255
Gateway 10.16.3.1
# Dns-* options are implemented by the resolvconf package, if installed (DNS settings)
Dns-nameservers 61.153.177.196 61.153.177.197
Dns-search fireteam.org
Configure PPPoE bandwidth dialing for NICs

# This file describes the network interfaces available on your system
# And how to activate them. For more information, see interfaces (5 ).
#
# The loopback network interface (configure The loopback interface)
# Automatically activate lo at startup
Auto lo
# Configure the lo interface as a loopback interface
Iface lo inet loopback
#
# The primary network interface (configure The primary network interface)
# Enable the eth0 interface automatically upon startup
Auto eth0
# Configure the eth0 interface to set static IP addresses
Iface eth0 inet static
Address 10.16.3.99
Netmask 255.255.255.0
Network 10.16.3.0
Broadcast 10.16.3.255

After the configuration is complete, restart the computer or network service to configure the NIC. For PPPoE broadband dialing, you can run the pppoeconf command for configuration.

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.