# /etc/sysconfig/network-scripts/ifcfg-*
# /etc/sysconfig/network-scripts/route-*
# 示例
default via 192.168.88.254 dev eth0
# 示例
10.15.150.0/24 via 192.168.150.253 dev eth1
1.修改文件内容:/etc/netplan/01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
ethernets:
ens32: ## network card name
dhcp4: false
addresses:
- 192.168.3.88/24 ## set static IP
routes:
- to: default
via: 192.168.3.1 ## gateway
nameservers:
addresses: [8.8.8.8,8.8.4.4,192.168.3.1]
version: 2
2.netplan apply
netplan安装: apt install netplan.io
ip route flush table main
systemctl stop firewalld
systemctl stop iptables