due to work needs, contact with a openSUSE system server, began to think and CentOS just need to configure a ifcfg-ethx file, but after the configuration found no network, so to query the relevant information, openSUSE system network settings are as follows:
First, modify the Ifcfg-eth0 file (modify the following parameters can be)
# Vi/etc/sysconfig/network/ifcfg-eth0
Bootproto=static
ipaddr=192.168.1.100
netmask=255.255.255.0
Second, configure the Gateway (routing)
# vi/etc/sysconfig/network/routes
Default 192.168.1.1
Third, configure DNS
# vi/etc/resolv.conf
NameServer 202.101.172.35
NameServer 114.114.114.114
Four, restart the network card
#/etc/init.d/network Restart
========================= Related File Description =========================
1:/etc/sysconfig/network/config
In this file, you can choose the mode of managing the NIC, as follows
Networkmanager= "Yes" via Networkmanage user method settings
Networkmanager= "No" is set by Ipfu traditional method (this option is recommended)
2:/etc/sysconfig/network/ifcfg-eth0
In this file, you can configure the IP address acquisition method, IP address, subnet mask and other parameters, as follows
bootproto= ' Static '
Ipaddr= ' 192.168.1.136 '
Name= ' rtl-8139/8139c/8139c+ '
netmask= ' 255.255.255.0 '
Startmode= ' Auto '
Usercontrol= ' No '
3,/etc/sysconfig/network/routes
In this file, a default route (Gateway) can be configured to configure the default gateway and route to a specific network or host. This file will be loaded at network start
The configuration format is as follows:
<default| Destination Network | Destination host > < gateway > < destination network subnet mask > < local network interface >
Example 1:
To add a gateway:
Default 192.168.1.1
The above can also be added by instruction:
# route add default GW 192.168.1.1
Also the above can be deleted by the command:
# route Del-net 0.0.0.0
Example 2:
Configure the network to 192.168.1.100 from the 192.168.2.100 this network port:
192.168.1.100 192.168.2.100 255.255.255.255
Add using directives:
# route add-net 192.168.1.100 netmask 255.255.255.255 GW 192.168.2.100
To delete using directives:
# route del-net 192.168.1.100 netmask 255.255.255.255
4,/etc/resolv.conf
In this file, DNS domain name resolution can be configured. There are four main parameters:
NameServer #定义DNS服务器的IP地址 (required)
Domain #定义本地域名 (optional)
Search #定义域名的搜索列表 (optional)
Sortlist #对返回的域名进行排序 (optional)
Examples are as follows:
Domain doiido.com
Search Www.doiido.com doiido.com
NameServer 202.101.172.35
NameServer 114.114.114.114
Opensuse/linux Network Configuration