Linux System Management-Network basic collection and Linux network configuration, advanced use

Source: Internet
Author: User

1. Terminology of network communication


1.1. Three modes of communication

Unicast, multicast, broadcast;


1.2. LAN composition

Computers PCs Servers interconnections NICs Media Network devices Hubs Switches routers Protocols Ethernet IP ARP DHCP



(1) Hub hub

Hub: Multiport repeater; hub does not remember which MAC address the packet was issued from, which MAC address is on which port of the hub; Hub features: Shared bandwidth; half duplex.




(2) Ethernet Bridge


Benefits of switched Ethernet:

The network bandwidth is expanded, the network conflict domain is divided, and the network conflict is limited to the smallest extent; the switch, as a more intelligent switching device, can provide more functions required by users: priority, virtual network, remote detection ...



How the Ethernet Bridge works:

The Ethernet bridge listens to the source MAC address in the data frame, learns the Mac, builds the Mac table, and for an unknown MAC address, the bridge forwards to all ports except the one receiving the frame, and when the bridge is connected to a data frame, if the frame's purpose is on the segment of the receiving port, it The data frame is filtered out, and if the destination MAC address is on a different port, the bridge forwards the frame to that port, and when the bridge is connected to the broadcast frame, it immediately forwards to all other ports except the receive port.


(3) Router


Routing:

Send a packet from one device to another on a different network. These tasks depend on the router to complete. Routers only care about the state of the network and determine the best path in the network. The implementation of the route relies on the routing table in the router to complete.


In order to implement routing, routers need to do the following things:

Separate broadcast domains, select the best path to reach the destination in the routing table, maintain and inspect routing information, and connect to the WAN.



Hub and switch comparison:

The hub belongs to the OSI's first layer of physical layer equipment, and the bridge belongs to the OSI's second layer of data-link-layer devices; From a working perspective, a hub is a broadcast mode, with all ports in a conflict domain. The network bridge can be isolated by port conflict; Hub is all shared bus and shared bandwidth. The bridge share population one bandwidth per end.




1.3, the characteristics of the network

Speed cost security availability scalability reliability topological physical topology: Physical topology describes how physical devices are routed; logical topology:


1.4. Network topology

Bus topology: All devices can receive signals; star topology: transmission via central point; single point of failure; extended star topology: Better resilience than star topology; ring topology: Signal Loop Transmission single point of failure; Dual-loop topology: signal transmission in the opposite direction is more resilient than single-loop; fully meshed topology: High implementation cost of fault-tolerant capability; Partial mesh topology: Find a balance between fault tolerance and cost;



1.5, TCP, UDP, IP features


TCP Features

Work at the transport plane to the connection protocol full duplex protocol half-shutdown error checking to package data into segments, sort acknowledgement mechanism data recovery, retransmission flow control, sliding window congestion control, slow start and congestion avoidance algorithms



UDP features

Work at the transport layer provides unreliable network access non-connection-oriented protocols with limited error checking for high transmission performance without data recovery characteristics


Internet protocol Features

The OSI network layer is run on the connectionless protocol, and the data packet layered address is processed independently. No data recovery function for best effort transmission


1.6. Network model


OSI Seven layer model:



TCP/IP protocol stacks and OSI models:


TCP/IP protocol stacks and OSI Models


2. Network configuration


To connect a Linux host to a network, you need to configure network-related settings.

Typically include the following: hostname ip/netmask routing: Default gateway DNS Server primary DNS server secondary DNS server third DNS server
Interface Naming method:
View Nic: Dmesg |grep–i ETH ethtool-i eth0 offload NIC driver: modprobe-r e1000 rmmod e1000 load NIC driver: Modprobe e1000


2.1, Network configuration mode


Static designations: ifconfig, route, netstat ip:object {link, addr, route}, SS, TC System-config-network-tui, Setup configuration file Dynamic assignment: dhcp:dynamic Host Configuration Protocol


2.2. Network Interface Configuration


(1) Ifconfig command

Syntax: Ifconfig [interface] Common combination: ifconfig-a ifconfig IFACE [up|down] Ifconfig interface [Aftype] Options | Address ... ifconfig IFACE ip/netmask [up] ifconfig IFACE IP netmask netmask
Note: effective immediately; enable promiscuous mode: [-]promisc


(2)route command


Routing Management Commands:


View: Route-n
Added: Route add route add [-net|-host] target [netmask Nm] [GW GW] [[Dev] If] Target: 192.168.1.3 Gateway: 172.16.0.1 RO Ute add-host 192.168.1.3 GW 172.16.0.1 dev eth0 target: 192.168.0.0 Gateway: 172.16.0.1 Route add-net 192.168.0.0 N Etmask 255.255.255.0 GW 172.16.0.1 Dev eth0 Route add-net 192.168.0.0/24 GW 172.16.0.1 Dev eth0


Default route, Gateway: 172.16.0.1 Route add-net 0.0.0.0 netmask 0.0.0.0 GW 172.16.0.1 route add default GW 172.16.0.1
Delete: Route del route del [-net|-host] target [GW GW] [netmask Nm] [[Dev] If] Target: 192.168.1.3 Gateway: 172.16.0.1 Route del-host 192.168.1.3 Target: 192.168.0.0 Gateway: 172.16.0.1 Route del-net 192.168.0.0 netmask 255. 255.255.0




(3) IP command


Function:

Configure Linux Network properties; ip-show/manipulate routing, devices, policy Routing and tunnels


IP [OPTIONS] object {COMMAND | help} object: = {link | addr | route}


IP link-network device configuration;            Set Dev IFACE sets properties: Up and down: Activates or disables the specified interface;            Ifup/ifdown show [Dev IFACE]: Specify interface; [Up]: Only the interface that is active is displayed;



Linux System Management-Network basic collection and Linux network configuration, advanced use

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.