Linux Basic Learning Management Network

Source: Internet
Author: User

I. IP Fundamentals


1.ipv4


2 binary 32-bit-----10-binary


172.25.0.10/255.255.255.0


172.25.0.10:ip Address


255.255.255.0: Subnet Mask


Subnet mask 255-bit corresponding IP bit for network bit


Subnet mask 0 corresponds to the IP bit master camera


Two. Configure IP


<< Graphics >>


1. Graphical interface


Nm-connection-editor


650) this.width=650; "title=" screenshot from 2017-10-17 23-49-08.png "src=" https://s4.51cto.com/wyfs02/M02/A7/7F/ Wkiol1nnvtyzz8duaae7vg5wbr8260.png-wh_500x0-wm_3-wmp_4-s_613328916.png "alt=" Wkiol1nnvtyzz8duaae7vg5wbr8260.png-wh_50 "/>


2. Text Graphics


Nmtui


650) this.width=650; "title=" screenshot from 2017-10-17 23-53-31.png "src=" https://s3.51cto.com/wyfs02/M00/08/D0/ Wkiom1nnwa3a1z5kaafaub6-gnm938.png-wh_500x0-wm_3-wmp_4-s_1582360099.png "alt=" Wkiom1nnwa3a1z5kaafaub6-gnm938.png-wh_50 "/>


<< commands >>


Ifconfig network card IP netmask # #临时设定


NMCLI Connection Add type Ethernet con-name WESTOS ifname eth0 AutoConnect Yes #添加dhcp网络
NMCLI Connection Add type Ethernet con-name WESTOS ifname eth0 ip4 ip/24 #添加静态网络
NMCLI Connection Delete Westos #删除westos链接
NMCLI Connection Show #显示所有网络链接
NMCLI Connection down Westos #关闭指定链接
NMCLI Connection up Westos #开启指定链接
NMCLI connection Modify "Westos" Ipv4.addresses newip/24 #改变wetos的ip
NMCLI connection Modify "Westos" Ipv4.method <auto|manual> #改变westos的工作方式为动态或者静态
NMCLI Device Connect eth0 #开启设备
NMCLI Device Disconnect eth0 #关闭设备
NMCLI Device Show #显示设备信息
NMCLI Device Status #显示设备状态


<< Files >>


DHCP # #动态获取


Vim/etc/sysconfig/network-scripts/ifcfg-eth0


Device=eth0 # #接口使用设备
BOOTPROTO=DHCP # #网卡工作模式
Onboot=yes # #网络服务开启时自动激活
Name=eth0 # #网络接口名称
: Wq


Systemctl Restart Network


Static|none # #静态网络


Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0 # #设备
Bootproto=static|none # #设备工作方式
Onboot=yes # #开启网络服务激活设备
Name=eth0 # #网络接口名称
IPADDR=172.25.0.100 # #IP
netmask=255.255.255.0 | PREFIX=24 # #子网掩码


Three. Gateway Gateways


    1. Router


      The main function is to make NAT
      Dnat Destination Address Translation
      Snat Source Address Translation


2. Gateways


650) this.width=650; "title=" screenshot from 2017-10-18 11-38-59.png "src=" https://s1.51cto.com/wyfs02/M01/A7/7F/ Wkiol1nnvaihrwzuaajlhhjjkre394.png-wh_500x0-wm_3-wmp_4-s_2565935209.png "alt=" Wkiol1nnvaihrwzuaajlhhjjkre394.png-wh_50 "/>


The IP on the router and itself in the same network segment


3. Setting up the Gateway


650) this.width=650; "title=" screenshot from 2017-10-18 11-39-13.png "src=" https://s2.51cto.com/wyfs02/M01/A7/7F/ Wkiol1nnvghhua8xaafbutcxxnk652.png-wh_500x0-wm_3-wmp_4-s_766809367.png "alt=" Wkiol1nnvghhua8xaafbutcxxnk652.png-wh_50 "/>


Systemctl Stop Netwrokmanager
Vim/etc/sysconfig/network # #全局网关
gateway= Gateway IP

vim/etc/sysconfig/network-scripts/ifcfg-NIC configuration file # #网卡接口网关
gateway= Gateway IP

Systemctl Restart Netwrok

Route-n # #查询网关
Kernel IP Routing Table
Destination Gateway genmask Flags Metric Ref use Iface
0.0.0.0 (Gateway) 172.25.0.254 0.0.0.0 UG 0 0 0 eth0
172.25.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0


650) this.width=650; "title=" screenshot from 2017-10-18 19-05-53.png "src=" https://s5.51cto.com/wyfs02/M01/08/D0/ Wkiom1nnwnzwli3waagdhrkjli0268.png-wh_500x0-wm_3-wmp_4-s_547499590.png "alt=" Wkiom1nnwnzwli3waagdhrkjli0268.png-wh_50 "/>


Four. DNS


1.dns


DNS is a single server
This server provides the ability to answer the client hostname and IP correspondence


650) this.width=650; "title=" screenshot from 2017-10-18 19-06-47.png "src=" https://s1.51cto.com/wyfs02/M00/08/D0/ Wkiom1nnwquhnppjaaokvc0ytza641.png-wh_500x0-wm_3-wmp_4-s_3772613326.png "alt=" Wkiom1nnwquhnppjaaokvc0ytza641.png-wh_50 "/>


2. Setting up DNS


Vim/etc/resolv.conf
NameServer DNS Server IP

vim/etc/sysconfig/network-scripts/ifcfg-NIC configuration file
Dns1=dns Server IP


650) this.width=650; "title=" screenshot from 2017-10-18 20-07-58.png "src=" https://s3.51cto.com/wyfs02/M02/A7/7F/ Wkiol1nnvm_rr4beaagyehldpdm007.png-wh_500x0-wm_3-wmp_4-s_1873789948.png "alt=" wKioL1nnVm_ Rr4beaagyehldpdm007.png-wh_50 "/>


3. Local parsing file


Vim/etc/hosts
IP host Name


4. Local resolution of file and DNS read priority tuning


/etc/nsswitch.conf
#hosts: DB Files Nisplus NIS DNS
Hosts:files DNS # #files代表本地解析文件, DNS on behalf of the DNS server, that priority in the front










Linux Basic Learning Management network

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.