ip网关配置

时间:2022-04-30 11:08:32
流量查看
watch more /proc/net/dev
ip子网查询https://www.sojson.com/convert/subnetmask.htmlhttp://ip.gchao.cn/ ifconfig ens33 45.115.243.24 netmask 255.255.255.0 route add default gw 45.115.240.1
route del default gw 45.115.240.1
route -n

vi /etc/resolv.conf
  nameserver 8.8.8.8

service network restart
  systemctl restart network

vi /etc/sysconfig/network-scripts/ifcfg-enp2s0f1

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
NAME=enp2s0f1
UUID=42b92d1b-a1aa-46ec-8697-f206fa9aa798
DEVICE=enp2s0f1
ONBOOT=yes
IPADDR=45.115.243.24
GATEWAY=45.115.240.1
NETMASEK=255.255.252.0
DNS1=8.8.8.8