Modify IP address information in Linux

Source: Internet
Author: User
Modify the IP address immediately effective: www.2cto.com # ifconfigeth0192.168.0.20netmask00000000255.0 start effective: modify/etc/sysconfig/network-scripts/ifcfg-eth0 modify defaultgateway that... modify IP address effective immediately: www.2cto.com # ifconfig eth0 192.168.0.20 netmask 255.255.255.0 start effective: modify/etc/sysconfig/network-scripts/ifcfg-eth0 modify default gateway effective immediately: # route add default gw 192.168.0.254 start effective: modify/etc/sysconfig/network-scripts/ifcfg-eth0 modify dns www.2cto.com modify/etc/ Resolv. the change of conf takes effect immediately. The change of host name takes effect immediately after startup: # hostname fc2 takes effect immediately after startup: modify/etc/sysconfig/network to start the network configuration/etc/init. d/network restart premise: Redhat system ip address, mask: edit/etc/sysconfig/network-script/ifcfg-eth0 IPADDR = 192.168.0.1 NETMASK = 255.255.255.0 Gateway: edit/etc/sysconfig/network NETWORKING = yes HOSTNAME = xx GATEWAY = 192.168.0.100 DNS: www.2cto.com/etc/resolv. conf NAMESERVER = 202.96.209.5 note: The above IP addresses must be changed to the IP address corresponding to your network configuration.. In Linux, it is recommended to modify the IP address vi/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE = eth0 BOOTPROTO = none BROADCAST = 192.168.1.255 IPADDR = 192.168.1.33 NETMASK = 255.255.255.0 NETWORK = 192.168.1.0 ONBOOT = yes USERCTL = no PEERDNS = no TYPE = Ethernet vi/etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE = eth1 ONBOOT = yes BOOTPROTO = none IPADDR = 192.168.2.34 NETMASK = 255.255.255.0 www.2cto.com USERCTL = no PEERDNS = no TYPE = Ethernet NETWORK = 192.168.2.0 BROADCAST = 192.168.2.255 2 modify GATEWAY vi/etc/sysconfig/network NETWORKING = yes HOSTNAME = Aaron GATEWAY = 192.168.1.1 3 restart the network configuration/etc/init. d/network restart ------------------------ modify the configuration file/etc/sysconfig/network-scripts/under the configuration file such as File: ifcfg-eth0 represents the actual Ethernet NIC 0 configuration file such as File: ifcfg-eth0: 1 indicates the configuration file of the actual Ethernet NIC 0. domain name server configuration file:/etc/resolv. conf modify IP address www.2cto.com effective immediately: # ifconfig eth0 192.168.0.20 netmask 255.255.255.0 effective start: modify/etc/sysconfig/network-scripts/ifcfg-eth0 modify default gateway effective immediately: # route add default gw 192.168.0.254 start effective: modify/etc/sysconfig/network-scripts/ifcfg-eth0 modify dns modify/etc/resolv. conf www.2cto.com can take effect immediately after modification. the modification of host name also takes effect immediately after startup: # hostname fc2 takes effect immediately after startup: modify/etc/sysconfig/network author linux_loajie
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.