Linux basic configuration and management 1 ---

Source: Internet
Author: User
Linux basic configuration and management 1 ---- Linux network basic configuration 1 IP address 1 IP address addressing is a two-layer addressing solution, one IP address addressing identifies a host (or a Nic interface) 2. Currently, ipv4 is the most widely used one. it has begun to gradually switch the 3ipv4 address to 3... linux basic configuration and management 1 ---- Basic Linux network configuration
1 IP address addressing
1. IP address addressing is a two-layer addressing solution. an IP address identifies a host (or a Nic interface)
2. ipv4 is the most widely used and has begun to switch over IPv6.
3. the ipv4 address is 32-bit, and the ipv6 address is 128-bit.
4 An ipv4 address is divided into two parts: the network part and the host part.
5. The network part identifies the region and the host part identifies the host.
The ip host is represented in decimal notation. each ip address is divided into four parts, each of which is divided into eight digits.
 
2 subnet mask
1. We use the subnet mask to determine the network part of the IP address.
2. the subnet mask and IP address are the same as 32 bits. each bit in the IP address corresponds one to one.
3. the part in the corresponding subnet mask of an IP address is the network part.
4. for example, if the subnet mask is 255.255.255.0 and the binary value is 11111111.111111.111111.00000000, the first 24 bits in the IP address are the network part.
 
3 Route
1. the data transmission function between different networks is called the routing function. Generally, there are multiple interfaces connected to different networks and data forwarding is performed through the route table.
 

4 Domain name
1 IP address is often hard to remember, so we generally use domain names for management
2 Domain names are divided into three parts
Type indicates the type of the domain name (com/net/org/edu/gov)
Domain name
Host name a host in this domain
 

5 DNS
1. each domain name represents an ip address, and the DNS service is used to convert ip addresses and domain names.
 
2. basic network parameters
1. the computer that needs to configure a LAN communication: IP address + subnet mask
2. configure a computer for cross-network communication: IP address + subnet mask + gateway
3. configure a computer that can access the Internet: IP address + subnet mask + gateway + DNS

6. Ethernet connection
1 in Linux, Ethernet interfaces are named eth0 and eth1, and 0/1 represents the ID of the network card.
2. you can use the lspci command to view the hardware information of the NIC, and use lsusb to view the usb device.
3. you can use ifconfig-a to view all interfaces.

4. you can enable and disable a Nic interface through ifup and ifdown.
For example, ifup eth0 or ifdown eth0

7 Network Test commands
1. test network connectivity
Ping IP address or domain name


2. DNS resolution
Host domain name or dig domain name

3. show route table ip route

4. track the network path to the target address
Traceroute domain name

5. use mtr to test network quality
Mtr domain name


8. modify the host name
1. modify the host name in real time
Hostname
2. change the host name permanently.
For ubuntu, you only need to modify/etc/hostname.

For other Linux releases, you only need to modify/etc/sysconfig/network

9 troubleshooting
1. network troubleshooting is performed from the bottom layer to the top layer, from itself to the outside.
Step 1: Check whether the network configuration is correct: IP address + subnet mask + gateway + DNS
Step 2: Check whether the IP address of the Gateway is successfully pinged.
Step 3: Check whether DNS resolution is normal.

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.