Set network connectivity in Linux (Classic Edition)

Source: Internet
Author: User
Tags nameserver
Linux network connectivity (Classic Edition) 1 modify ipgatewaynetmask and other parameters # eth0 for the corresponding Nic # vim/etc/sysconfig/network-scripts/ifcfg-eth0DEVICE & quot; eth0 & quot; HWADDRONBOOTyesBOOTPROTOstatic # set network connectivity for BOOTPROTOdhc Linux (Classic Edition) 1 modify ip gateway netmask and other parameters # eth0 for the corresponding Nic # vim/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE = "eth0" HWADDR = "" ONBOOT = "yes" BOOTPROTO = static # BOOTPROTO = dhcp NETADDR = 192.168.0.185 NETMASK = 255.255.255. GATEWAY = 192.168.0.1 # This If dns is set, you do not need to modify the resolv. conf file below. it is best to use this file to configure dns. resolv. conf is often inexplicably modified by other programs. DNS1 = 202.117.112.3 DNS2 = 61.134.1.4 change the configuration file and restart #/etc/init. d/network restart check whether the IP settings take effect, and whether the LAN is interconnected to ping the dns system used by 192.168.0.1 2 # vim/etc/resolv. conf nameserver 202.117.112.3 nameserver 61.134.1.4 but this file is easy to be modified by other programs, so it is best to make changes in the ifcfg-eth0 file, this is post. Check whether the domain name server is valid # dig www.baidu.com 3 so far, you can already access the internet. if you want to further set your own host name, see the following. # Vim/etc/sysconfig/network NETWORKING = yes HOSTNAME = hongchangfirst. zhang # vim/etc/hosts 192.168.0.190 hongchangfirst. zhang: ping your host name first. # ping-c 3 hongchangfist. if zhang can ping, the configuration is correct and reboot is supported. In addition, the ports of various services in the system are configured in the/etc/services file.

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.