Because of their work, come into contact with Linu server an OpenSUSE system, I began to think and CentOS as only need to configure a ifcfg-ethx file can be, but after the configuration found no network, then to query the network settings information, OpenSUSE system as follows:
First, modify the ifcfg-eth0 file (parameters can be modified as follows)
# Vi / etc / sysconfig / network / ifcfg-eth0
BOOTPROTO = static
IPADDR = 192.168.1.100
NETMASK = 255.255.255.0
Second, configure the gateway (route)
# Vi / etc / sysconfig / network / routes
Third, configure DNS
# Vi /etc/resolv.conf
Fourth, restart the network card
# /etc/init.d/network Restart
========================= Documents described ====================== ===
1: / etc / sysconfig / network / config
In this file, you can select the card management mode, as follows
NETWORKMANAGER = "yes" set by the user of the method networkmanage
NETWORKMANAGER = "no" by ipfu conventional Sets (recommended to choose this)
2: / etc / sysconfig / network / ifcfg-eth0
In this file, you can configure the IP address acquisition mode, 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, you can default route (gateway) configuration, and thereby set the default gateway to route to a specific network or host. This file will be loaded when the network start
Configure the following format:
Add the Gateway:
The above command can also add:
# Route add default gw 192.168.1.1
The same instructions above can also be deleted:
# Route del -net 0.0.0.0
Configuring network from 192.168.2.100 to 192.168.1.100 port out of the net:
192.168.1.100 192.168.2.100 255.255.255.255
Use the command to add:
# Route add -net 192.168.1.100 netmask 255.255.255.255 gw 192.168.2.100
Use Delete command:
# Route del -net 192.168.1.100 netmask 255.255.255.255
4, / etc / resolv.conf
In this file, you can configure DNS name resolution. Mainly has the following four parameters:
nameserver # defined DNS server IP address (required)
domain # define local domain name (optional)
search # custom domain search list (optional)
sortlist # sort the returned domain name (optional)
Examples are as follows:
search www.linuxidc.com linuxidc.com