How Linux modifies IP addresses

Source: Internet
Author: User

Tag:os    file    io   re   c   linux    

1, search first, get the following explanation
IP IP address
Netmark Subnet mask
Gateway default gateway
HostName host name
DomainName domain name
DNS DNS IP
2, Files that need to be modified are often
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/resolv.conf
/etc/ Hosts
The following is my settings
/etc/sysconfig/network
Here is primarily a gateway
Networking=yes
Networking_ipv6=no
gateway= 192.168.1.1
Hostname=localhost.localdomain
/etc/sysconfig/network-scripts/ifcfg-eth0
Here the main designation is IP acquisition mode (static), IP address, subnet mask, network type
# Broadcom Corporation netxtreme BCM5721 Gigabit Ethernet PCI Express
DEVICE =eth0
#BOOTPROTO =dhcp
bootproto=static
ipaddr=192.168.1.21
netmask=255.255.255.0
Type=ethernet
hwaddr=xx:xx:xx:xx:xx:xx
Onboot=yes
/etc/resolv.conf
Specifies DNS (I ate a loss here, not set before the network address can not be resolved)
Search Localdomain
nameserver 192.168.1.1
/etc/hosts
I'm not set, it's used to define the hostname.

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.