1, describe the network bridge, hub, two-layer switch, layer three switch, router functions, usage scenarios and differences.
Network Bridge |
The bridge has two ports, one in and out, can connect two similar networks, thereby amplifying the transmission distance of the signal. |
Hubs |
Hub, the LAN is connected to the received signal to zoom in, but it can have multiple interfaces. Broadcast and conflict domains are not quarantined. |
Two-layer switch
|
A data link layer device that identifies the MAC address in a packet and forwards data based on the MAC address. Isolate conflict domains, but do not isolate broadcast domains. |
Layer three switch |
Data link layer and network layer equipment, three layer switch is the most important purpose is to speed up the large LAN internal data exchange, the routing function is also for this purpose, can do one route, multiple forwarding. The process of the regularity of packet forwarding is realized by hardware, and the functions such as routing information updating, routing table maintenance and routing addressing are implemented by software. Although it has three layers of functionality, it is not recommended as a substitute for routers. Isolate broadcast and conflict domains.
|
Router |
Network-level devices that connect LAN and WAN. It automatically chooses and sets the route according to the channel, and sends the signal in the order of the best path. Routers are hubs of the Internet, also known as Gateway devices, that are used to connect multiple logically separate networks. |
2. What are the classification of IP addresses? The representation of subnet mask and its function
First, A.B.C.D.E five types of address
Class A: 0000 0000--0111 1111
1.0.0.1--126.255.255.254
Class B 1000 0000--1011 1111
128.0.0.1--191.255.255.254
Class C 1100 0000--1101 1111
192.0.0.1-223.255.255.254
Class D 1110 0000--1110 1111
224.0.0.1-239.255.255.254
Class E 240.0.0.1-255.255.255.254
Second, subnet mask
Host bit + network bit
3. What are the models of computer networks (OSI model and TCP/IP model), the functions of each layer and the physical devices involved?
OSI model
Layer Seven: Link layer, physical layer, network layer, transport layer, Session layer, presentation layer, application layer
Physical layer: Provides the mechanical, electrical, functional, and procedural characteristics required to establish, maintain, and dismantle physical links, and to transmit non-structural bitstream and fault detection instructions on the physical link.
Physical layer of media including overhead wire, balance cable, optical fiber, wireless channel, etc.
Data Link layer: Provides the function and process of data sending and receiving between network layer entities; Provides data link flow control
Two layer switches, hubs, bridges
Network layer: Control the operation of packet transfer system, routing, congestion Control, network interconnection and other functions, its role is to be specific physical transmission to the high-level transparent.
Routers, layer three switches
Transport Layer: Provides the ability to establish, maintain, and dismantle transport connections, select the network layer to provide the most appropriate services, provide reliable and transparent data transfer between systems, and provide end-to-end error recovery and traffic control.
Session Layer: Provides the ability to establish, maintain, and end session connections between processes, providing management control of interactive sessions, i.e., one-way interaction, two alternate, and two simultaneous session modes.
Presentation layer: Represents the application process negotiation data representation, complete data conversion, formatting and text compression.
Application tier: Provides a variety of user services
TCP/IP model
Four layers: Network interface layer, network layer, Transport layer, application layer
The network interface layer, which includes protocols for collaborating on the transfer of IP data over existing network media. In fact, the TCP/IP standard does not define the functions corresponding to the ISO data link layer and the physical layer. Instead, it defines protocols such as Address Resolution Protocol ARP, which provides the interface between the data structure of the TCP/IP protocol and the actual physical hardware.
Network layer: The network layer solves the problem of communication between computer and computer, which includes three functions:
• Handle packet-sending requests from the transport layer, send packets into the IP datagram, populate the header, select the path, and then send the datagram to the appropriate network interface when the request is received.
• Process datagrams.
• Processing network Control Message protocol, i.e. processing path, flow control, blocking, etc.
The network layer corresponding to the OSI seven layer model, this layer contains the IP protocol, RIP protocol, responsible for the data packaging, addressing and routing. Also included is the inter-Network Control Message Protocol ICMP, used to provide network diagnostic information.
Transport Layer
The transport layer solves the problem of communication between computer programs and computer programs. The transport layer, which corresponds to the OSI seven-layer reference model, provides two end-to-end communication services. The TCP protocol provides reliable data flow transport service, and the UDP protocol provides unreliable User datagram service.
Application Layer
The application layer and presentation layer corresponding to the OSI seven-layer reference model, the application layer protocol of the Internet includes FINGER/WHOIS/FTP/GOPHER/HTTP/TELNET/SMTP/IRC/NNTP, etc.
4, how to access the Linux host to the TCP/IP network, please describe the detailed steps. (Manually specified mode)
• Physical connection
• Turn on Web services
• Configure IP address, subnet mask, set gateway, DNS service
• Then restart the network service to load the configuration file
Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Onboot=yes #开机启动
Bootproto=static/dhcp #设置静态IP或者自动分配
ipaddr=192.168.1.1
netmask=255.255.255.0
gateway=192.168.1.254
Service Network restart
Re-configure DNS domain name resolution:
Vim/etc/resolv.conf
NameServer 8.8.8.8
5. What are the ways to configure network information for Linux hosts, please describe each process.
• Use command: ifconfig eth0 192.168.1.1 netmask 255.255.255.0
Temporary effect, failure after shutdown
• Modify the NIC profile: Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Then restart the Network service for permanent
• Use the graphical interface to setup--the network configuration, select the appropriate option,
And then restart the Network service, which is also permanently active
6, write a script, use the ping command to detect the online status of all hosts between 172.16.250.1-172.16.250.254;
The online host uses green display;
The non-online master uses red display;
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/89/BF/wKiom1gbP2HyU4N7AAAsuYT21os442.png "title=" Ping.png "alt=" Wkiom1gbp2hyu4n7aaasuyt21os442.png "/>
7, detailed description of each network interface configuration file The meaning of each parameter and its corresponding value;
CentOS6 configuration file:/etc/sysconfig/network-scripts/ifcfg-eth0
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/89/BD/wKioL1gbQiHwEJfOAABT1JquO7g667.png "title=" Network.png "alt=" Wkiol1gbqihwejfoaabt1jquo7g667.png "/>
8, how to configure multiple addresses for the network interface, what are the ways?
To configure a network alias:
Ifconfig eth0:1 192.168.1.1
Then create a new eth0:1 configuration file
Device=eth0:1
Bootproto=static
ipaddr=192.168.1.1
netmask=255.255.255.0
gateway=192.168.1.254
Onboot=yes
9. What are the commonly used network management tools, and describe how they are used in an example format?
Ip
Ifconfig
Netstat
Ss
Route
Setup
10, Linux system software package management methods (installation, upgrade, uninstall and other operations), and how to manage.
Rpm:redhat Packages Manager
RPM-QA View all installed packages
RPM-IVH Package_name (-I installation,-V displays files being processed,-H shows Progress)
Rpm-u Packgae_name (-u upgrade)
Rpm-e package_name (-e uninstall)
--force Enforcement
--requires Show dependencies for packages
--nodeps Ignore dependencies
Yum::yellow Dog Updater Modified
Yum Install package_name Installation
Yum Update package_name Upgrade
Yum Remove Package_name Uninstall
Yum Repolist View Yum Warehouse
Yum Grouplist Viewing package groups
Yum list shows all installation packages
Yum Groupinstall package_name-y directly using package Group installation
11, how to use the distribution CD as a yum repository, please describe the process.
1) Create mount point: Mkdir/mnt/media
2) Hanging on CD: Mount/media/cdrom/mnt/media
3) Edit configuration file: VIM/ETC/YUM.REPO.D
[Centos-localrepo]
name = Localrepo names
Baseurl=file:///mnt/media/packages Local Path
Gpgcheck=0 do not check.
Enabled=1 enabled
4) Update Yum and make configuration effective
Yum Clean All
12. Write a script to complete the following functions
(1) Suppose that a directory (/etc/rc.d/rc3.d/) has a number of files with the beginning of K and S;
(2) Displays the file name of all files that begin with K and appends a stop string to it;
(3) Displays the file name of all files beginning with S and appends a start string to it;
(4) The respective numbers of documents that begin with the beginning of S and K respectively;
sed-n ' s/^k/stop&/p ' displays all file names of files starting with K, the-n option cancels the SED default printing, the p command prints the lines of the matching pattern once, and when the Select-N and command p appear simultaneously, SED can print the selected content. & means to save the lookup string for application in the replacement string. 650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/8A/74/wKioL1gxcbSxo0MoAAAtv3bqB8g018.png "style=" Float:none; "title=" RM ' A) tbx4ga47$cglu8vg22.png "alt=" Wkiol1gxcbsxo0moaaatv3bqb8g018.png "/>
13. Write a script to complete the following functions
(1) The script can accept the user name as the parameter;
(2) Calculate the sum of the IDs of these users;
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8A/78/wKiom1gxeZ6wSbnyAAAnDfF09Uw654.png "title=" 13.png "alt=" Wkiom1gxez6wsbnyaaandff09uw654.png "/>
14. Write a script
(1) Pass some catalogs to this script;
(2) Display the content type of all level files or subdirectories of each directory individually;
(3) How many directories are in the statistics, and how many file content types are displayed altogether;
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8A/78/wKiom1gxfY6gjII3AABszosIsNw293.png-wh_500x0-wm_3 -wmp_4-s_3672766895.png "title=" 14.png "alt=" Wkiom1gxfy6gjii3aabszosisnw293.png-wh_50 "/>
15. Write a script
Pass a parameter to the script from the command line, the parameter is the user name
If the user's ID number is greater than or equal to 500, the user is displayed as a normal user;
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/8A/74/wKioL1gxewmy2bkPAABTmCnOtTk354.png "title=" 15.png "alt=" Wkiol1gxewmy2bkpaabtmcnottk354.png "/>
seems to be able to input a good number of users, do not know what the use
16. Write a script
(1) Add 10 user user1-user10; password and user name;
(2) Add when the user does not exist, or skip when existing;
(3) Finally shows how many users have been added this time;
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/8A/78/wKiom1gxhCziAUWfAAAtEl3dOyc843.png-wh_500x0-wm_3 -wmp_4-s_895919809.png "title=" 16.png "alt=" Wkiom1gxhcziauwfaaatel3doyc843.png-wh_50 "/>
17, write a script, ping command to test the 172.16.250.20-172.16.250.100 within the host online, will be displayed online;
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8A/78/wKiom1gxhMqxenCVAAAzz2eR-Os304.png-wh_500x0-wm_3 -wmp_4-s_9280062.png "title=" 17.png "alt=" Wkiom1gxhmqxencvaaazz2er-os304.png-wh_50 "/>
18, printing 99 multiplication table;
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8A/78/wKiom1gxhniDS2UIAAA9MBhoI0k449.png-wh_500x0-wm_3 -wmp_4-s_594457647.png "title=" 19.png "alt=" Wkiom1gxhnids2uiaaa9mbhoi0k449.png-wh_50 "/>
Linux study Eighth Week homework