Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

RHEL7.x version, 3 ways to set IP address, gateway and DNS

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

In the RHEL7.x version, the naming of the network card has changed from eth0,1,2 to enoxxxx. En stands for enthernet (Ethernet card) and o represents onboard (built-in). That string of numbers is automatically generated by the index number of the motherboard. Compared with the original naming method, the disadvantage is that it is too long and difficult to remember, and the advantage is that the number is unique and it is not easy to make mistakes when the system is migrated. How do you set up ip addresses, gateways, and dns? Three commonly used methods are described below.

Method 1:

Modify the network card configuration file

[root@ys ~] # vim / etc/sysconfig/network-scripts/ifcfg-eno16777728YPE=EthernetBOOTPROTO=static | | none / / enable static IP address, BOOTPROTO=dhcp Enable dynamic acquisition of DEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yes | | no / / whether IPV6IPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noNAME=eno16777728 / / device name UUID=f248e89a-6788-489f-a236-a401ff596a38 / / device identification number DEVICE=eno16777728 / / device name ONBOOT=yes / / whether to start network connection IPADDR=192.168.1.100 / / set IP address PREFIX=24 / is supported / set subnet mask length GATEWAY=192.168.1.1 / / set gateway DNS1=12.3.1.1 / / set DNSIPV6_PEERDNS=yesIPV6_PEERROUTES=yes

Method 2:

Use the nmtui command, as shown below

[root@ys Desktop] # nmtui

Method 3:

Use the nm-connection-editor command, as shown below

[root@ys Desktop] # nm-connection-editor

Finally, the modification takes effect by restarting the network card service.

[root@ys ~] # systemctl restart network

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report