opensuse初始化网络配置
2021-12-29 本文已影响0人
与狼共舞666
opensuse:/etc/sysconfig/network # cat ifcfg-ens18
IPADDR='10.3.23.235/22'
BOOTPROTO='static'
STARTMODE='auto'
ZONE=public
opensuse:/etc/sysconfig/network # vim routes
opensuse:/etc/sysconfig/network # cat routes
default 10.3.23.254
/etc/sysconfig/network/config
定义如下三个变量 :
NETCONFIG_DNS_STATIC_SEARCHLIST
NETCONFIG_DNS_STATIC_SERVERS
NETCONFIG_DNS_FORWARDER
重启网卡后会反写到/etc/resolv.conf中,如下图
opensuse:/etc/sysconfig/network # cat /etc/resolv.conf
### /etc/resolv.conf is a symlink to /var/run/netconfig/resolv.conf
### autogenerated by netconfig!
#
# Before you change this file manually, consider to define the
# static DNS configuration using the following variables in the
# /etc/sysconfig/network/config file:
# NETCONFIG_DNS_STATIC_SEARCHLIST
# NETCONFIG_DNS_STATIC_SERVERS
# NETCONFIG_DNS_FORWARDER
# or disable DNS configuration updates via netconfig by setting:
# NETCONFIG_DNS_POLICY=''
#
# See also the netconfig(8) manual page and other documentation.
#
### Call "netconfig update -f" to force adjusting of /etc/resolv.conf.
search 10.0.100.1
nameserver 10.0.100.1