Linux Network basics-In centos5

Source: Internet
Author: User
Tags traceroute command

TCP/IP network configuration file

/Etc/sysconfig/network-scripts/ifcfg-eth0 Nic Interface Configuration File

Content instance

Device = eth0 Nic ID

Onboot = Yes activated upon startup

Bootproto = static or works as a DHCP pilot

Ipaddr = 192.168.1.10 IP Address

Netmask = 255.255.255.0 Subnet Mask

Geteway = 192.168.1.1 Gateway

Network = 192.168.1.0 network segment

Broadcast = 192.168.1.255 broadcast code

 

/Etc/sysconfig/basic network configuration file

Content instance:

Networking = yes whether IPv4 works

Hostname = linux.jnrp.cn machine name

Gatway = 192.168.1.1 Gateway

 

/Etc/hosts this file is equivalent to the host file in Windows

Do you still remember the location of the host file in windows? C: \ windows \ system32 \ drivers \ etc \ hosts

 

/Etc/host. conf this file is used to set how to parse the Host Name

Order sets the available methods and sequence for host name resolution. The available methods include hosts (using the/etc/hosts file for resolution) and bind (using the DNS server for resolution ), NIS (using Network Information Service NIS resolution)

Multi sets whether to return multiple IP addresses of the host from the/etc/hosts file. The value is on/off.

 

/Etc/resolv. conf this file is the client configuration file of DNS domain name service

 

The/etc/Services Service port and its transmission protocol configuration file.

 

Ifconfig eth0 192.168.1.3 netmask 255.255.255.0.0 up this command uses the ifconfig command to directly modify the network configuration and take effect immediately.

Ifconfig eth0: 0192.168.1.4 netmask 255.255.255.0.0 up this command uses the ifconfig command to bind the NIC to the second IP address.

Ifconfig eth0: 1Down this command deletes the third virtual IP Address

 

Service Network restart this command restarts the NIC. After the configuration file is modified, the setting does not take effect immediately. You can restart the NIC to make the setting take effect.

/Etc/rc. d/rc. Local this file is equivalent to Windows startup.

 

The output fields in the ifconfig command are described as follows:

IFUP starts the network

Disable network in ifdown Mode

Hostname: displays the current host name

Route command

 

Diagnostic Tools

Ping Command to test network connection through ICMP protocol

The traceroute command can trace the path to a specific destination.

For example, traceroute www.google.com

Curl command to view site details

Run the netstat command to check which ports are enabled.

Generally, netstat-a-n is used, where a indicates that all are displayed, and N indicates that IP addresses and ports are displayed in numbers rather than names.

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.