Network configuration and ip settings
1. Basic knowledge of network
If a host can connect to the public network, such as accessing www.baidu.com
Then this mainframe is bound to have
Ipaddress
GATEWAY
Dns
# ipaddress#
Tcp/ip
Ipv4
2-ary 32 bit
254.254.254.254/255.255.255.0
11111110.11111110.11111110.11111110/11111111.11111111.11111111.00000000
254.254.0.254/255.255.255.0
254.254.0.254/255.255.0.0
# ip settings #
Ifconfig # tools for viewing or temporarily configuring host ip
Ifconfig Network Interface # # View the ip on this interface
Ifconfig network interface ip netmask subnet mask # temporarily set ip
Ifconfig eth0 172.25.254.100 netmask 255.255.255.0
Systemctl restart network # restart basic network services
Systemctl restart NetworkManager # Network Intelligent Management Service
Graphical network configuration mode
Network Settings tool in nm-connection-editor # # drawing
Network configuration tools in nmtui # # text
How the command sets the ip
Nmcli
Nmcli connection delete connection name # Delete this connection
Nmcli connection add con-name westos ifname eth0 type ethernet autoconnect yes # add dynamic network
Nmcli connection add con-name westos ifname eth0 type ethernet ip4 ip/24 # static network
Network profile
/ etc/sysconfig/network-scripts/ # Network configuration directory
# dynamic network configuration #
Vim ifcfg-xxx # Network configuration file format
DEVICE=eth0 # # specify the device name for file management
BOOTPROTO=dhcp # # dhcp dynamic acquisition. Both none and static represent static network.
ONBOOT=yes # # Boot automatic Activation device
NAME=hello # # specifies that the name of the web link is hello
# static network configuration #
Vim ifcfg-xxx # Network configuration file format
DEVICE=eth0 # # specify the device name for file management
BOOTPROTO=static | none # # dhcp dynamic acquisition. Both none and static represent static network.
ONBOOT=yes # # Boot automatic Activation device
NAME=hello # # specify the link name
IPADDR=172.25.254.100 # # set ip to 172.25.254.100
NETMASK=255.255.255.0 # # subnet mask is 255.255.255.0
PREFIX=24 # # subnet mask is 255.255.255.0