As a result of work, I came into contact with an opensuse system server and thought that I only needed to configure an ifcfg-ethx file like centos, but after configuration, I found that there was no network at all, to query relevant information, the network settings of the opensuse system are as follows:
1. Modify the ifcfg-eth0 file (modify the following parameters)
# Vi/etc/sysconfig/Network/ifcfg-eth0
Bootproto = static
Ipaddr = 192.168.1.100
Netmask = 255.255.255.0
2. Configure the gateway (route)
# Vi/etc/sysconfig/Network/routes
Default 192.168.1.1
3. Configure DNS
# Vi/etc/resolv. conf
Nameserver 202.101.172.35
Nameserver 114.114.114.114
4. Restart the NIC
#/Etc/init. d/network restart
= ==================
1:/etc/sysconfig/Network/config
In this file, you can select the NIC Management Mode as follows:
NetworkManager = "yes" is set through the networkmanage user Method
NetworkManager = "no" is set through the traditional ipfu method (this is recommended)
2:/etc/sysconfig/Network/ifcfg-eth0
In this file, you can configure parameters such as the IP address acquisition method, IP address, and subnet mask.
Bootproto = 'static'
Ipaddr = '1970. 168.1.136'
Name = 'rtl-8139/8139 C/8139c +'
Netmask = '2017. 255.255.0'
Startmode = 'auto'
Usercontrol = 'no'
3./etc/sysconfig/Network/routes
In this example, you can configure the default route (GATEWAY) to configure the default gateway and the 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>
Instance 1:
Add Gateway:
Default 192.168.1.1
You can also add the following commands:
# Route add default GW 192.168.1.1
You can also run the following command to delete the file:
# Route del-net 0.0.0.0
Instance 2:
The network configured to 192.168.1.100 is output from 192.168.2.100:
192.168.1.100 192.168.2.100 255.255.255.255
Add using commands:
# Route add-net 192.168.1.100 netmask 255.255.255.255 GW 192.168.2.100
Delete using commands:
# Route del-net 192.168.1.100 netmask 255.255.255.255
4./etc/resolv. conf
In this file, you can configure DNS domain name resolution. There are four main parameters:
Nameserver # define the IP address of the DNS server (required)
Domain # define a local domain name (optional)
Search # list of domain names (optional)
Sortlist # Sort returned Domain Names (optional)
Example:
Domain doiido.com
Search www.doiido.com doiido.com
Nameserver 202.101.172.35
Nameserver 114.114.114.114
Opensuse Network Configuration