CentOS network settings (manually configured by vim)

Source: Internet
Author: User

Commands related to CentOS network settings (manually configured by vim): >>> configure a fixed IP address <[root @ localhost ~] # Vi/etc/sysconfig/network-scripts/ifcfg-eth0 [root @ localhost ~] # Cat/etc/sysconfig/network-scripts/ifcfg-eth0 # Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] DEVICE = eth0BOOTPROTO = staticHWADDR = 00: 0C: 29: D1: A6: EDONBOOT = yesIPADDR = 192.168.160.11NETMASK = 255.255.255.0BROARDCAST = 192.168.160.255GATEWAY = 192.168.160.1 [root @ localhost ~] #/Etc/init. d/network restartShutting down interface eth0: [OK] Shutting down loopback interface: [OK] Bringing up loopback interface: [OK] Bringing up interface eth0: [OK] [root @ localhost ~] # Ifconfig eth0eth0 Link encap: Ethernet HWaddr 00: 0C: 29: D1: A6: ED inet addr: 192.168.160.11 Bcast: 192.168.160.255 Mask: 255.255.0 inet6 addr: fe80: 20c: 29ff: fed1: a6ed/64 Scope: Link up broadcast running multicast mtu: 1500 Metric: 1 RX packets: 13960 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 4796 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 3749651 (3.5 MiB) TX Bytes: 480572 (469.3 KiB) Interrupt: 75 Base address: 0x2000 >>>> configure DNS address <[root @ localhost ~] # Vi/etc/resolv. conf [root @ localhost ~] # Cat/etc/resolv. confsearch localdomainnameserver 192.168.160.1nameserver 202.101.172.46 >>>> modify the host name <[root @ localhost ~] # Vi/etc/sysconfig/network [root @ localhost ~] # Cat/etc/sysconfig/networkNETWORKING = yesNETWORKING_IPV6 = noHOSTNAME = leekwen. leekwen [root @ localhost ~] # Ifconfig eth0 [root @ localhost ~] # Vi/etc/resolv. conf [root @ localhost ~] # Cat/etc/resolv. confsearch localdomainnameserver 192.168.160.1nameserver 202.101.172.46
 

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.