Network Configuration in Linux (RedHat)

Source: Internet
Author: User
Tags domain name server nameserver

The following settings are valid on the Self-installed vmwarevm. The client OS is RedHat;

I. Command Line Configuration

1. Set IP

Ifconfig eht0 netmask 255.255.255.0 192.168.1.129

Ifconfig eth0 down

Ifconfig eth0 up

The above settings are temporary settings. After the restart, the system will still use the default settings. The default network configuration file of the system is under the Change directory:

/Etc/sysconfig/networking/profiles/Default

(1) ifcfg-eth0 -- IP address, network mask, network address and other information, /etc/sysconfig/networking/devices/ifcfg-eth0 and/etc/sysconfig/network-scripts/ifcfg-eth0 are links to this file;
(2) Network -- hostname
(3) resolv. conf -- DNS
(4) hosts -- Host Name List./etc/hosts is the link to this file;

2. Set the Default Gateway

Route add default GW 192.168.1.1

3. Set DNS

Specify the DNS address in the resolv. conf file mentioned in 1,

Nameserver *.*.*.*

Nameserver *.*.*.*

You can set multiple

 

In this way, the machine should be able to access the Internet. If not, it will be on Google,

 

2. directly modify the configuration file mentioned above,

Or Setup/netconfig can be set directly through the graphical interface.

 

Appendix: Common TCP/IP configuration files in Linux

/Etc/sysconfig/network contains the most basic network information of the host for system startup.
/Etc/sysconfig/network-script/This directory is some information used to open the network system at system startup, for example: the first Ethernet interface file is ifcfg-eth0.
/Etc/xinetd. conf defines the network service started by the super process xinted.
/Etc/hosts ing host names to IP addresses.
/Etc/networks maps the domain name to the network address (network ID.
/Etc/host. conf configure the control file of the Domain Name Service client.
/Etc/resolv. conf: configure the configuration file of the Domain Name Service client, which is used to specify the location of the Domain Name Server.
/Etc/protocols sets the protocol used by the host and the protocol numbers of each protocol.
/Etc/services: Set network services with different ports on the host.

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.