Temporary, permanent modification of IP in Linux

Source: Internet
Author: User

Temporarily modify IP

Enter the command in Linux: ifconfig eth0 192.168.1.1 netmask 255.255.255.0 Enter

Here the 192.168.1.1 is the temporary ip,netmask is the subnet mask, this temporary IP will be changed after you restart the network card to the previous IP


Permanently modify IP

Entering commands in Linux

# Vim/etc/sysconfig/network-scripts/ifcfg-eth0, new or modified in Ifcfg-eth0 file

ipaddr=192.168.1.1

netmask=255.255.255.0

# wq!

Restart the NIC after saving

# Service Network Restart

# ifconfig

Now that the IP address is 192.168.1.1, if you find that your IP address is still unchanged, go to the Ifcfg-eth0 file to view

bootproto= ' DHCP ' dynamic acquisition of IP

Revision changed to

bootproto= ' static ' to obtain IP statically

# Service Network Restart

# ifconfig

At this time the IP address should already be 192.168.1.1


Note the point:

  1. The temporary IP will restart the network card, the IP is restored to the previous

  2. Permanent IP modification requires a network card restart







This article is from the "12779418" blog, please be sure to keep this source http://12789418.blog.51cto.com/12779418/1914635

Temporary, permanent modification of IP in Linux

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.