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.0 nmcli network management

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

Network configuration

One. Check the ip address

[root@luck_lyb Desktop] # ip addr show ens33

Interface statu

Hardware

IPv4 address and subnet

Broadcast address, range, device name

IPv6 information

1) the Ip command actually has statistical information about network performance, receiving (RX) sending (TX) data packets.

[root@luck_lyb Desktop] # ip-s link show ens33

2. Configure the network using nmcli

Use nmcli to view network information

[root@luck_lyb Desktop] # nmcli connection show

two。 Use-active to view active devices

[root@luck_lyb Desktop] # nmcli connection show-active

[root@luck_lyb Desktop] # nmcli connection show "bo"

3. Create a lyb-dhcp connection using nmcli

[root@luck_lyb Desktop] # nmcli con add con-name "lyb-dhcp" autoconnect yes ifname ens33 type Ethernet

1) add a "name" to add con-name

2) autoconnect automatic connection analyzer yes can automatically obtain IP

3) Select ens33 for ifname device

4) type type Ethernet (Ethernet)

If you see the above, you have successfully added it.

Enable the newly built DHCP

[root@luck_lyb Desktop] # nmcli connection up lyb-dhcp

4. Create a connection lyb-static static ip configuration

[root@luck_lyb Desktop] # nmcli con add con-name "lyb-static" autoconnect no ifname ens33 type ethernet ip4 192.168.1.1 True 23 gw4 192.168.1.254

Start lyb-static static IP configuration

[root@luck_lyb Desktop] # nmcli connection up lyb-static

5. Modify the lyb-staitic connection IP address with nmcli

[root@luck_lyb Desktop] # nmcli con mod "lyb-static" ipv4.addresses "192.168.1.5Ip 24 192.168.1.254"

Note: when you use nmcli to modify a gateway, you must add a "" sign. If you modify it without adding a gateway, the gateway will become empty.

After it is executed, it will not take effect immediately. It is necessary to up the lyb-staitic down again, and then check it with show.

[root@luck_lyb Desktop] # nmcli con down lyb-static

[root@luck_lyb Desktop] # nmcli con up lyb-static

[root@luck_lyb Desktop] # nmcli connection show lyb-static

6. Set up the dns.

[root@luck_lyb Desktop] # nmcli connection modify "lyb-static" ipv4.dns 8.8.8.8

DNS server profile path: / etcresolv.conf

If it is also set, it will not take effect until it is stopped and restarted.

7. Delete a network connection (lyb_staitic)

[root@luck_lyb Desktop] # nmcli connection del lyb-staitic

8. Use graphical management network card configuration

Open the graphical interface through the nm-connection-editor command for management

The above is used to manage the network with commands in linux7.0, which is written into the configuration file, and there are good things when updated.

I won't talk any more about Vim editor. Yes, of course, you can write the configuration file directly. It's still in the same place.

/ etc/sysconfig/network-scripts/ifcfg-name

Of course, there is also the configuration of link aggregation and bridge, as will be written later in the study, if you have friends who are in urgent need of learning, you can leave a message! I will write it as soon as possible.

three。 Configure hostname and domain name resolution

1. View hostname through hostname

Hostname profile path: / etc/hostname

Local domain name resolution profile path: / etc/hosts

This is a little different from the equivalent of rhel6.0.

The hostname file path of Rhel6.0 is / etc/sysconfig/network

two。 Configure hostname command: hostnamectl

[root@luck_lyb /] # hostnamectlset-hostname luck_bobo.example.com

[root@luck_lyb /] # hostnamectl status

There is no need to restart the system after the change! Just turn off the terminal and turn it on to see the effect.

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

Network Security

Wechat

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

12
Report