广告

本站里的文章大部分经过自行整理与测试

2017年1月28日星期六

OpenSUSE - Network Settings - 静态 IP 设置


YaST2 - Network Settings

Global Options
IPv6 Protocol Settings - Enable IPv6 (uncheck)
DHCP Client Options - Change Default Route via DHCP (uncheck)

Overview - Edit - Statically Assigned IP Address
IP Address: 192.168.0.100
Subnet Mask: 255.255.255.0/24
Hostname: member.dlinkddns.com

Hostname/DNS - Hostname and Domain Name
Hostname: member
Domain Name: dlinkddns.com

Routing
Default IPv4 Gateway: 192.168.0.1
Device: eth0

$ su

$ gedit /etc/hosts

192.168.0.100   member.dlinkddns.com

$ gedit /etc/sysconfig/network/ifcfg-eth0

BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='192.168.0.100/24'
MTU=''
NAME=''
NETMASK=''
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
DHCLIENT_SET_DEFAULT_ROUTE='yes'
PREFIXLEN='24'


$ gedit /etc/sysconfig/network/ifroute-eth0

default 192.168.0.1 - eth0 


以上设置完后, 要改一改 resolv.conf

$ gedit /etc/sysconfig/network/config

NETCONFIG_DNS_STATIC_SERVERS="192.168.0.1"

$ netconfig update -f

看看 resolv.conf, 会多出一行

$ cat /etc/resolv.conf

nameserver 192.168.0.1

没有评论:

发表评论