Set IP address, Gateway, DNS, and other network configurations in the Debian system

Source: Internet
Author: User
Note: System: debian6.0.4IP address: 192.168.21.166 subnet mask: 255.255.255.0 Gateway: 192.168.21.2DNS: 8.8.8.88.8.4.4 operation: System O & M reminder: qihang01 original content copyright, reprinted, please indicate the source and original article links 1. set the IP address, Gateway nano/etc/network/inte

Note:

System: debian 6.0.4
IP address: 192.168.21.166
Subnet mask: 255.255.255.0
Gateway: 192.168.21.2
DNS: 8.8.8.8
8.8.4.4

Operation:
System O & M reminder: qihang01 original content is copyrighted. For more information, see the source and original article links.
1. set IP addresses and gateways
Nano/etc/network/interfaces/etc/network/interfacesbak # back up the original configuration file
Nano/etc/network/interfaces # Edit the Nic configuration file
Auto lo
Auto eth0 # automatically connect to the network at startup
Iface lo inet loopback
Allow-hotplug eth0
Iface eth0 inet static # static indicates using a fixed ip address, and dhcp indicates using a dynamic ip address
Address 192.168.21.166 # set the IP address
Netmask 255.255.255.0 # set the subnet mask
Gateway192.168.21.2 # set the Gateway
Ctrl + o # save configuration
Ctrl + x # exit
2. set dns
Cp/etc/resolv. conf/etc/resolv. confbak # back up the original dns configuration file
Nano/etc/resolv. conf # Edit the configuration file
Nameserver 8.8.8.8 # set preferred dns
Nameserver 8.8.4.4 # Set backup dns
Ctrl + o # save configuration
Ctrl + x # exit

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.