RedHatLinux network configuration process notes

Source: Internet
Author: User
In Linux, TCP/IP networks are configured through several text files. You need to edit these files to complete the networking. After RedHatlinux is installed, it can be configured on a graphical interface, the following describes how to use the command line to configure the network. Use the cat command to view the network configuration file information 1.cat/ etc/sysconfig/network2.cat/etc/resolv after default installation. conf3.ca

In Linux, TCP/IP networks are configured through several text files. You need to edit these files to complete the networking. After RedHat linux is installed, you can configure it on the GUI. The following describes how to configure the network through the command line.
Run the cat command to view the network configuration file after default installation.
1. cat/etc/sysconfig/network
2. cat/etc/resolv. conf
3. cat/etc/sysconfig/network-scripts/ifcfg-ethN (the default eth0 value depends on your situation)
Let's configure and understand and configure the above three files in sequence.
/Etc/sysconfig/network settings
This file is used to specify network configuration information on the server, including parameters for controlling network-related file and daemon behavior. The following is an example file:
NETWORKING = yes
HOSTNAME = machine1
GATEWAY = 210.34.6.2
FORWARD_IPV4 = yes
GATEWAYDEV =
NETWORK = yes/no indicates whether the NETWORK is configured;
HOSTNAME = hostname indicates the Host Name of the server;
GATEWAY = gw-ip indicates the IP address of the Network GATEWAY;
FORWARD_IPV4 = yes/no whether IP Forwarding is enabled;
GAREWAYDEV = gw-dev gw-dw indicates the gateway device name, such as eth0.

Note: After modification,/etc/init. d/network must be restarted to take effect.
Command: #/etc/rc. d/init. d/network start
#/Etc/rc. d/init. d/network stop network
#/Etc/rc. d/init. d/network restart network
The following is my file content
NETWORKING = yes
HOSTNAME = localhost. localdomain
# GATEWAY = 192.168.1.1 (Note: it is best to comment out the GATEWAY here, because the GATEWAY configuration is also available in the/etc/sysconfig/network-scripts/ifcfg-eth0 ,)
/Etc/resolv. conf configure DNS customer
File/etc/resolv. conf configures the DNS customer. It contains the domain name search sequence of the host and the address of the DNS server. Each line should contain one keyword and one or more parameters separated by spaces. You can set up to three rows.
The following is an example file:
Nameserver 192.168.0.36
Nameserver 192.168.0.37
Search huawei-3com.com

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.