RHEL7网卡设置

1.改网卡名

先vim /etc/sysconfig/grub:
GRUB_TIMEOUT=5
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"
GRUB_DISABLE_RECOVERY="true"
后grub2-mkconfig -o /boot/grub2/grub.cfg
再reboot后修改配置网卡名

2.设置IP

TYPE=Ethernet
BOOTPROTO=static
NM_CONTROLLED=no
IPADDR=192.168.56.101
NETMASK=255.255.255.0
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s8
UUID=9f771188-1e88-4145-a02d-701c88cb688b
DEVICE=eth1
ONBOOT=yes
 
重启服务:systemctl restart network     ip add
上一篇:使用docker安装lamp


下一篇:xxx_cast类型转换