Red hat Simple Network Configuration

Source: Internet
Author: User
Tags nameserver
To add a host to a local network, follow these steps:

Assign a unique IP address and host name;
Sets the network interface of a new host when it is started;
Set a default route. More routing configurations may be available;
Point to a DNS name server and allow access to other parts of the Internet.

1. Allocate host names and IP addresses
Edit the/etc/hosts file
127.0.0.1 localhost. localdomain hostname. localdomain localhost hostname
10.1.8.176 hostname. localdomain

2. Configure Network Interfaces
Ifconfig eth0 10.1.8.176 netmask 255.255.255.0 broadcast 10.1.8.255 up
Use netstat-I to find the Interface Name
View Interface Configuration with/sbin/ifconfig eth0

3. Configure routes
Route add-net 10.1.8.0 netmask 255.255.255.0 gw 10.1.8.1 eth0
Route add default gw 10.1.8.1 eth0
Use netstat-nr to view route configurations

4. Configure DNS
Edit the/etc/resolv. conf file
Nameserver 10.1.9.11
Nameserver 211.98.2.4
Up to three nameserver entries
View the Service Switch file/etc/nsswitch. conf and/etc/host. conf to confirm the domain name resolution sequence.

Most applications are connected to libc6. libc6 uses the BIND parser and the nsswitch. conf file. A few old applications are connected to libc4 or libc5. They use the/etc/host. conf file.

 

Default Value of the Service Switch File

Open the Customs document Default settings for host name search
/Etc/nsswitch. conf Files nisplus nis dns
/Etc/host. conf Hosts, bind

Red Hat Network Configuration File

Text Set internal capacity
/Etc/sysconfig/network Host Name and default route
/Etc/sysconfig/static-routes Static Routing
/Etc/sysconfig/network-scripts/ifcfg-Ifname IP address, network mask, broadcast address of each interface

 

Related Article

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.