Fifth week of Linux jobs

Source: Internet
Author: User
Tags switches uuid

1, describe the functions, usage scenarios, and differences between bridges, hubs, two-layer switches, layer three switches, routers.

1, the bridge is used to isolate the conflict domain, the bridge belongs to the two layer network equipment.

2. Hub: The host connected to the hub belongs to a conflict domain, and only one host can send information at the same time in a conflict domain.

3, two-layer switch: Is the advanced bridge, or can connect more hosts of the bridge, the same function as the bridge

4, three layer switch: Three layer switch has all the functions of two layer switch, three layer switch can support some three layer functions such as three layer multicast, routing protocol.

5, Routers: can let different network segments of the host communication. The router is in the location of the host gateway.

2,IPWhat are the categories of addresses? The representation of subnet mask and its function

class A:

the first of the eight bits is the first one the range of the 0.A class IP address is 1.0.0.0~126.255.255.255, and the mask is 255.0.0.0

class B:

The first eight-bit two-bit 10.B class IP address range is 128.0.0.0~191.255.255.255, and the mask is 255.255.0.0

class C:

The first eight-bit three-bit 110.C class IP address range is 192.0.0.0~223.255.255.255, and the mask is 255.255.255.0

class D

The first eight-bit pre-thinking for the range of 1110.D class IP addresses is 224.0.0.0~239.255.255.255.255 class D addresses are generally used for multicast.

Class A,B, and C addresses are generally used for host addresses.

3, and what are the partitioning models of computer networks (OSImodel andTCP/IPmodel), the function of each layer and the physical equipment involved.

OSI seven-layer model

1. Physical Layer 2, Data link layer 3, Network layer 4, Transport layer 5, Session layer 6, Presentation layer 7, Application layer

The physical layer is responsible for electrical function characteristics

The data link layer is responsible for sending and receiving data between network entities.

The Network layer is responsible for three layer protocol processing, routing and sending and receiving IP messages.

The transport layer is responsible for the end-to-end function of establishing, maintaining, and removing the transfer connection.

Session layer is responsible for the establishment, maintenance and removal of sessions between processes

The presentation layer is responsible for data transformation and data compression.

The application layer is responsible for providing application services.

TCP/IP four layer model

1. Data Link Layer 2, Network layer 3, Transport layer 4, Application layer

Data Link Layer Correspondence the physical layer and data link layer of the OSI

Network layer Correspondence the OSI network layer

Transport Layer Correspondence the transport layer of the OSI

Application Layer Correspondence the OSI session, presentation, and application layer

4, how toLinuxHost access toTCP/IPNetwork, please describe the detailed steps. (manually specified mode)

My understanding of this problem is how to set The IP address, mask, Gateway, and DNS server for the Linux host .

Set There are three ways to mask the Linux host IP address.

1.ipconfig ens33 192.168.1.1 netmask 255.255.255.0 up this configures the IP address and mask for the ens33 Nic

2.IP address add 192.168.1.1/24 dev ens33

3, by setting the network card configuration file /etc/sysconfig/network-scripts/ifcfg-ens33

to beLinuxWhat are the ways that hosts configure network information, please describe each process.

1,ipconfig This command can set the network card information for the host

ifconfig ens37 172.16.1.1/24 up set IP Address

Configure multiple IPs for one network card Address, the alias of the network card must start with the NIC itself

Ifconfig ens37:0 172.16.2.1/24

Remove IP for a network card Address

Ifconfig ENS37 0

Note: This command can also be deleted unless the main IP address, but the system prompts you not to associate to the interface.


This command knocks down the non-master . the IP is gone.

Turn off the NIC


Turn on the NIC

Turn on the specified function with Promisc as an example

Turn off specified features

Route View Routes

Recommended Use of Route–n Command

Increase routing

Delete route

View network Statistics


Display Network Port brief information


View TCP for the current system Session State

IP route2 This is a package and there is a need for small programs.

Addr configuring addresses and masks

The link management interface itself

Route Configuration Routing

Netns Network Name space similar to virtual network card

This program needs to be installed Iproute

View IP Address

Turn off the NIC

IP link Set ens37 down

Turn on the NIC

Configure IP for the NIC Address


Remove IP for Nic Address

Configure multiple addresses for a network card


Add route table

To delete a route table


View TCP Listening Port

View a summary of existing link information for the system

Filter output Content



3, by setting the network card configuration file /etc/sysconfig/network-scripts/ifcfg-ens33

4. Configure network card information through interactive tools

CentOS6 's command is setup.

CentOS7 's order is nmtui.

6, write a script, usePingCommand Detection172.16.250.1-172.16.250.254The presence of all hosts in the online state; the online host uses a green display; The main that is not online is displayed in red;

#!/bin/bash

#ping the Host

Declare-i I=1

While [$i-le 2];

Do

if (ping-c 2-w 2 192.168.1. $i &>/dev/null)

Then ECHO-E "\033[32m the host 192.168.1. $i is reachable \033[0m"

Else

Echo-e "\033[31m the host 192.168.1. $i is unreachable \033[0m"

Fi

i=$[$i +1]

Done

The main difficulty with this script is how the conditional statement of the IF is written. There is also a character coloring.

7, detailed description of each network interface configuration file The meaning of each parameter and its corresponding value;

TYPE Specifies the Data Link layer protocol

Bootproto what protocol is used to configure interface properties when activating this interface

Defroute whether to set a default route

Ipv6init whether the IPV6 function is turned on

Ipv6_autoconf IPV6 Property Auto-Configuration

Ipv6_defroute IPV6 Default Gateway

Name device names

UUID of the UUID NIC

Device name This name must match the name recognized by the system

Onboot whether the interface is started when the system starts

Ethtool_opts Ethernet Properties turn on auto-negotiation

IPAddr Interface IP Address

PREFIX Mask Length

Gateway Gateways Address

DNS1 DNS Server

HWADDR=MACADDR Hardware Address

8, how to configure multiple addresses for the network interface, what are the ways?

1, can be through ifconfig

Ifconfig ens37:0 172.16.2.1/24

2, can be through IP addr

IP addr Add 1.1.1.1/32 dev ens37 label ens37:0

3, through the configuration file

By copying the original file to generate a copy of the network card, such as the original network card configuration file is/ifcfg-ens37, then the name of the copy is/ifcfg-ens37:0


Fifth week of Linux jobs

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.