Configuration of the network under "Linux" Linux

Source: Internet
Author: User
Tags nameserver

Configuration of the Linux network

First, configure the network
Vi/etc/sysconfig/network Configuring the Network
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device= "eth0:0"
Ipaddr= "192.168.1.100"
netmask= "255.255.255.0"
Second, modify the gateway
Vi/etc/sysconfig/network
Networking=yes
Hostname=aaron
gateway=192.168.1.1
Third, modify the DNS
The configuration file is below/etc/resolv.conf.
Vi/etc/resolv.conf
NameServer 202.109.14.5 #主DNS
NameServer 219.141.136.10 #次DNS
Search Localdomain
Four, restart the network (four methods)
1:root Account # Service Network restart
2:#/etc/init.d/network Restart
3:# Ifdown eth0
# ifup Eth0
4:# ifconfig eth0 Down
# ifconfig eth0 up

View the IP information of this machine ifconfig equivalent to the ipconfig of window

Check to see if the network is through. By pinging the IP address

VI Command
: Save the current file
: E filename: Open file filename for editing
: x: Save the current file and exit
: Q: Exit VI
: q!: Do not save the file and Exit VI

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.