Linux system directories and network links

Introduction to the Linux Directory

Catalog description

Table of contents description, description
/ Linux root directory
/bin binaries, the directory for storing system commands, all users can execute
/sbin Super user binaries, save commands related to system environment settings, only super users can use these commands, some commands can allow ordinary users to view
/usr/bin The directory for storing system commands, which can be executed by all users. These commands have nothing to do with system startup and cannot be executed in single-user mode
/usr/sbin Store unnecessary system management commands in the root file system, which can be executed by super users
/root Store the relevant files of the root user and the home directory of the root user. superuser home directory
/home The folder of the current ordinary user, the default name is the current user, for example: /home/qianfeng
/cd User default home directory, for example: /home/qianfeng
/tmp temporary, store temporary files
/etc etcetera, store system configuration files
/usr Unix software resource, system software shared resource directory, stores all commands, libraries, man pages, etc.
/proc Virtual file system, data is stored in memory, and current process information is stored
/boot system startup directory
/dev devices, store device files
/sys Virtual file system, the data is stored in memory, and mainly stores information related to memory
/lib Store the shared library required for the system program to run
/lost+found Store some system error check results
/was variavle, dynamic data storage location, including frequently changing files, such as mail, log files, scheduled tasks, etc.
/mnt mount, the mount directory, the mount point of the temporary file system, the directory where the CD-ROM and floppy drive are mounted by default
/media Mount directories, mount media devices such as floppies and CDs
/misc Mount directory, mount NFS service
/opt The storage location of the software installed by the third party is usually placed in the /usr/local directory
/src Service Data Directory

Three ways to connect to the network

Concepts related to the network environment

1 外网:IP是唯一性,不能重复。范围:0.0.0.0~255.255.255.255

2 内网:通过路由器或者交换器设备,来重新设置IP地址。
  不同的内网的ip可以相同。内网A的某一台主机通过自己的网卡与自己的路由器A通信,然后路由器A通过网络中心
  与路由器B通信,路由器B再与内网中的某一台机器的网卡通信。

3 IP: ip地址是确定一台机器的唯一标识符

4 NETMASK(子网掩码):与ip连用,用于确定网络段位			
  192.168.1.x      范围:1-254
  255.255.255.0 	
  子网掩码有1的位置对应ip的部分就是网络段位。0对应的位置就是内网中主机的位置。
  子网掩码作用:用来指定当前机器属于哪个ip号段的
  判断方式:将当前的ip的二进制按位与子网掩码的二进制等于网段地址
  如: 192.168.1.2  &  255.255.255.0  = 192.168.1.0	
  
5 GATEWAY:网关,用于与连接外网的机器设备通信(路由器)换句话说,网关就是路由器的IP

6 DNS:域名解析服务器
  119.75.217.109  www.baidu.com

Domain Name Access Mechanism of Internet DNS Server

Equipment introduction

1 router

A router is a hardware device that connects two or more networks. It acts as a gateway between networks. It is a dedicated intelligent network device that reads the address in each data packet and then decides how to transmit it. It can understand different protocols, such as the Ethernet protocol used by a local area network, and the TCP/IP protocol used by the Internet. In this way, the router can analyze the destination addresses of data packets from various types of networks, and convert the addresses of non-TCP/IP networks into TCP/IP addresses, or vice versa; The best route is sent to the designated location. So routers can connect non-TCP/IP networks to the Internet.

2 switches

Switch (Switch) means "switch" is a network device used for electrical (optical) signal forwarding. It can provide an exclusive electrical signal path for any two network nodes connected to the switch. The most common switches are Ethernet switches. Other common ones are telephone voice switches, fiber optic switches, etc.

3 Modem

A modem (English name Modem), commonly known as "cat", is a kind of computer hardware. It can translate the digital signal of the computer into pulse signals that can be transmitted along ordinary telephone lines, and these pulse signals can be transmitted by another computer at the other end of the line. The modem receives it and translates it into a language the computer can understand.

The information in the computer is a digital signal composed of "0" and "1", but what is transmitted on the telephone line can only be an analog electrical signal. Therefore, when two computers want to transmit data through the telephone line, a device is required to be responsible for the digital-to-analog conversion.

4 virtual machines

A virtual machine (Virtual Machine) refers to a complete computer system that is simulated by software and has complete hardware system functions and runs in a completely isolated environment. Everything that can be done on a physical computer can be done on a virtual machine. When creating a virtual machine on a computer, part of the hard disk and memory capacity of the physical machine needs to be used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent CMOS, hard disk and operating system, and the virtual machine can be operated like a physical machine.

Virtual machine network connection method

After installing the virtual machine, two virtual network cards as shown below are installed by default——VMnet1 and VMnet8, among which VMnet1 is the host network card, which is used to connect to the network in host mode; VMnet8 is a NAT network card, which is used to connect to the network in NAT mode, and they The IP address is randomly generated.

VMware provides three working modes, namely bridged (bridge mode), NAT (network address translation mode) and host-only (host-only mode).

The settings of the host where VMware is located, see the figure below

bridged (bridged mode)

In this mode, using the VMnet0 virtual switch, the virtual operating system is like an independent host in the local area network. Like the host computer, it can access any machine in the network. In bridge mode, you can manually configure its TCP/IP configuration information (IP, subnet mask, etc., and it must be in the same network segment as the host machine) to access the Internet through a LAN gateway or router. IP address and DNS are set to "obtain automatically". If you want to use VMWare to create a new server in the LAN to provide Web or network services for LAN users, you should choose the bridge mode.

In the bridging mode, use the VMnet0 virtual switch. At this time, the virtual machine is equivalent to an independent computer on the network and has an independent IP address like the host.

NAT (Network Address Translation Mode)

Using NAT mode is to allow the virtual machine to use the NAT (Network Address Translation) function to access the public network through the network where the host machine is located. In other words, using NAT mode can realize accessing the Internet in the virtual system. The TCP/IP configuration information of the virtual machine in NAT mode is provided by the DHCP server of the VMnet8 virtual network, so the IP and DNS are generally set to "automatically obtain", so the virtual system cannot communicate with other real hosts in the local area network. communication. The biggest advantage of using the NAT mode is that it is very simple for the virtual system to access the Internet. You do not need to perform any other configurations, and you only need the host machine to be able to access the Internet. If you want to use VMWare to install a new virtual system, you can directly access the Internet without any manual configuration in the virtual system, it is recommended that you use NAT mode.

In the NAT mode, the Vmnet8 virtual switch is used. At this time, the virtual machine can "one-way access" other hosts on the network through the host, and other hosts cannot access the virtual machine.

Note: 192.168.62.1 at the host refers to the address of the host connected to the V8 switch, which must be the same address as the gateway at the virtual switch

host-only (host mode)

The Host-Only mode is actually the NAT mode that removes the virtual NAT device, and then uses the VMware Network Adapter VMnet1 virtual network card to connect to the VMnet1 virtual switch to communicate with the virtual machine. The Host-Only mode separates the virtual machine from the external network, making the virtual machine a An independent system that only communicates with the host computer. Its network structure is shown in the figure below:

If we want to enable the virtual machine to be networked, we can share the host network card with the VMware Network Adapter VMnet1 network card, so as to achieve the purpose of virtual machine networking.

For more exciting content of big data, welcome to search " Qianfeng Education " at station B or scan the code to get a full set of materials 

[Qianfeng Education] A full set of tutorials on big data development, the most comprehensive big data learning video in history

Guess you like

Origin blog.csdn.net/longz_org_cn/article/details/131590163