Modify IP addresses in Linux

Source: Internet
Author: User
In Linux, modify the IP address. in Linux, edit the network configuration file and set the system IP address. of course, perform the following steps under the root permission: 1. switch the path to etcsysconfignetwork-scripts [root @ Compilenetwork-scripts] p. in Linux, modify the IP address in Linux, edit the network configuration file, and set the system IP address, of course, you must perform the following operations under the root permission: 1. switch the path to/etc/sysconfig/network-scripts [root @ Compile network-scripts] # pwd/etc/sysconfig/network-scripts2, view ifcfg-eth0 file properties, make sure you have the edit permission [root @ Compile network-scripts] # ls-l ifcfg-eth0-rw-r -- r --. 1 root 258 September 24 18:05 ifcfg-eth03, edit the file ifcfg-eth0, add the following information ONBOOT = yesBOOTPROTO = staticIPADDR = 192.168.30.175NETMASK = 255.255.255.0GATEWAY = 192.168.30.1 command: [root @ Compile network-scripts] # vi ifcfg-eth0DEVICE = eth0TYPE = EthernetUUID = bytes = yesNM_CONTROLLED = yesBOOTPROTO = staticHWADDR = 00: 23: AE: A8: D7: 1 EIPADDR = 192.168.30.175NETMASK = 255.255.255.0GATEWAY = 192.168.30.1IPV4 _ FAILURE_FATAL = yesIPV6INIT = noNAME = "System eth0" 4. restart network service [root @ Compile network-scripts] #/etc/init. d/network restart: closing the interface eth0: Device status: 3 (disconnect) [OK] disable the loopback interface: [OK] the loopback interface is displayed: [OK] eth0: active connection status: active connection path:/org/freedesktop/NetworkManager/ActiveConnection/2 [OK] 5. set the network IP address by using commands, [root @ Compile network-scripts] # ifconfig eth0 192.168.30.175 netmask 255.255.255.0 [root @ Compile network-scripts] # route add default gateway 192.168.30.1
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.