How to set up static IP in Linux

Source: Internet
Author: User

Study Address: http://blog.csdn.net/u011317027/article/details/70738246

After recently using VMware to install cent OS7, you need to upload some files to the virtual machine using the FTP appliance, but the IP addr command to see the IP is 127.0.0.1, so the dynamic IP needs to be set to static.

1, edit the ifcfg-eth* file, * is an indeterminate number, some may be 0, and my is 33,ifcfg-eth33, specifically what the number is uncertain, this does not matter. Some netizens said no ifcfg-eth0 on the new one, I think it is wrong, no ifcfg-eth0 to see there is no ifcfg-eth1 or IFCFG-ETHN,

Vim/etc/sysconfig/network-scripts/ifcfg-eth33

2, set the content:

Modify the original:

BOOTPROTO=DHCP changed to Static

onboot=yes# #开机启动

Then add

ipaddr=192.168.1.29# Static IP

gateway=192.168.28.1# #默认网关

netmask=255.255.255.0# #子网掩码

dns1=192.168.28.1# Configuring DNS

3, restart Network, use SYSTEMCTL or service.

Service Network restart

4, then you can use the IP addr command to view the modified IP, using the FTP tool to upload files smoothly!

How to set up static 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.