因工作需要配置一台Suse Linux,平常都用的是Ubuntu和Redhat,特地查了一下Suse怎么配地址的,记下来备查。
一、配IP地址, 把”xx.xx.xx.xx“用实际IP地址/广播地址/网络地址代替
linux100:/etc # vim /etc/sysconfig/network/ifcfg-eth0
BOOTPROTO='static'
NAME='VMXNET3 Ethernet Controller'
STARTMODE='auto'
USERCONTROL='no'
BROADCAST='xx.xx.xx.xx'
ETHTOOL_OPTIONS=''
IPADDR='xx.xx.xx.xx/xx'
MTU=''
NETWORK='xx.xx.xx.xx'
REMOTE_IPADDR=''
二、配网关,把’xx.xx.xx.xx‘换成实际网关
linux100:/etc # vim /etc/sysconfig/network/routes
default xx.xx.xx.xx
三、配DNS,我用的是google的,也可随意配个可用的,记得没有”=“。
linux100:/etc # cat /etc/resolv.conf
### /etc/resolv.conf file 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.
#
# Note: Manual change of this file disables netconfig too, but
# may get lost when this file contains comments or empty lines
# only, the netconfig settings are same with settings in this
# file and in case of a "netconfig update -f" call.
nameserver 8.8.8.8
nameserver 8.8.4.4
4、重启网络,以下三条命令任意:
rcnetwork restart
service network restart
/etc/init.d/network restart