It is normal that ifconfig
does not find information, because you have not set it! Edit the network configuration file with VI commands:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
ETH0 here refers to the first network card interface, if you have multiple servers, please distinguish
4 Network card configuration static IP
1) Edit the configuration file, add and modify the following content
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR =
0a: ee: 8e: a0: ad: ae
TYPE=Ethernet
UUID=
cf179604-b924-495f-9ddb-eafc5735041e
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=192.168.10.10
NETMASK=255.255.255.0
GATEWAY=192.168.10.1
DNS1=8.8.8.8
DNS2=8.8.4.4
IPV6INIT=no
# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=
ce:cf:fa:1a:a2:e0
TYPE=Ethernet
UUID=
bea92e3f-e13b-4ddc-beb8-d8f67f996103
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static
IPADDR=
192.168.10.11
NETMASK=255.255.255.0
GATEWAY=
192.168.10.1
DNS1=8.8.8.8
DNS2=8.8.4.4
IPV6INIT=no
:wq!
2) Execute the following command after modification
# service ip6tables stop #Stop IPV6 service
# chkconfig ip6tables off #Prohibit IPV6 booting up
# service network restart #Restart network connection
# ifconfig #View IP address