OpenSuSE/Linux network configuration, opensuselinux

Source: Internet
Author: User
Tags nameserver

OpenSuSE/Linux network configuration, opensuselinux
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 file, 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.