Linux网络管理 (YouTube视频教程)

ISO/OSI七层模型

ISO: The International Organization for Standardization 国际标准化组织

OSI: Open Systems Interconnection model 开放系统互连模型

MAC地址负责局域网通信,IP地址负责外网通信

文件传输端口(FTP端口)默认21

Www网页端口默认80

Mail邮件默认端口是25和110

ISO/OSI七层模型是理论基础,TCP/IP四层模型是优化和实际使用模型

数据传输由高层到低层,数据接收由底层到高层

数据传输:

应用层(打开浏览器)->表示层(解码jpg或ASCII或mp3成bit流,0101,如果有压缩和加密,都在这一层处理表示)->会话层(判断数据是否需要网络传递,ppt就不需要,ppt会直接交给硬盘保存不会传递到下一层,但邮件就需要)->传输层(确定邮件端口号和所用协议,TCP和110端口。同时进行差错校验和流量控制)->网络层(写入发送和接受的IP,同时负责选路)->数据链路层(写入发送和接受主机的MAC地址,负责在局域网中传递)->物理层(实际的数据传递)

TCP/IP四层模型

应用层->传输层->网际互联层->网络接口层 (由高到低)

应用层,表示层,会话层 (ISO/OSI) -> 应用层 (TCP/IP)

传输层(ISO/OSI) -> 传输层 (TCP/IP)

网络层(ISO/OSI) -> 网际互联层 (TCP/IP)

数据链路层, 物理层(ISO/OSI) -> 网络接口层 (TCP/IP)

数据链路层(ISO/OSI)/网络接口层 (TCP/IP): ARP协议(地址解析协议)把IP地址翻译成MAC地址

网络层(ISO/OSI) -> 网际互联层 (TCP/IP):IP协议(网际协议,)IGMP(互联网组管理协议),ICMP(互联网控制报文协议)

传输层(ISO/OSI) -> 传输层 (TCP/IP):TCP协议(传输控制协议),UDP协议(用户数据报协议)

应用层,表示层,会话层 (ISO/OSI) -> 应用层 (TCP/IP): FTP, Telnet, DNS, SMTP等协议

IP地址详解

不同网段通信需要路由器,相同网段只需要交换机

Port端口作用

常见端口号

FTP: 20, 21

SSH: 22

Telnet: 23 (23 端口号已经被禁用,因为telnet是明文传输)

DNS: 53

Http: 80

SMTP: 25

POP3: 110

Netstat -an

-a : 查看所有链接和监听端口

-n : 显示ip地址和端口号,而不显示域名和服务名

Listening表示本地端口号正在被监听,说明这些是本机开启的服务

Established表示已经存在的链接

DNS作用

DNS用来互相翻译数字IP地址和字母域名

gateway网关作用

网关在所有内网计算访问的不是本网段的数据报时使用, 网关负责将内网IP转换为公网IP,公网IP转换为内网IP

网管和代理服务器的区别

Both a proxy server and a gateway route traffic from inside a network to the Internet. A gateway, however, is more like a door to get to the Internet, while a proxy server acts like a wall that bars the inside of the network from being exposed to the Internet. A proxy server filters which connection is allowed, while a gateway doesn't do any filtering.

Gateways

  • For two networks to communicate, a gateway must be provided from each network. The gateway defines what is internal to the network and what is external. If a computer needs to communicate with another computer outside the network, it must be configured with a gateway to gain access outside the network. Without a gateway, a computer will be unable to get out, like someone locked inside a house.

Proxy Servers

  • A proxy server represents the network from the outside. Any user trying to gain access to any computer inside a network with a proxy will only see the IP address of the proxy server. It acts like a barrier to hide your network by configuring the Internet options of computers within the network to first point to the proxy server before going out to the Internet. It keeps computers inside the network anonymous.

Functional Difference

  • A proxy server that does not do any filtering is like a gateway, simply passing on requests from the computer to the Internet. A proxy server, however, is a more powerful networking component that can act as a gateway while protecting the network from outside threats. A gateway always risks exposing an internal network to the Internet because it does no filtering. It merely routes information from within the network to the outside.

使用文件配置IP地址

vi /etc/sysconfig/network-scipts/ifcfg-eth0来设置IP地址,子网掩码,网关,开机生效等

vi /etc/sysconfig/network 来修改主机名

hostname命令查看主机名

hostname name1 设置临时主机名

vi /etc/resolv.conf来设置DNS

Linux网络环境查看命令

ifconfig

ifup (启用) and ifdown (禁用网卡)+ 网卡设备名

ifup lo    --- lo的意思是loopback, 127.0.0.1

ifdown eth0

netstat

-a : 列出所有网络链接

-l :  仅列出在监听状态网络服务

-n : 不使用域名与服务名,而使用IP地址和端口号

-u : 列出TCP协议端口

-t : 列出TCP协议端口

-r : 列出路由列表,和route命令一致

route

-n : 查看路由列表,可以看到网关

route add default gw 192.102.1.1 临时设定网关

在一台服务器里,连内网的网卡是不能设置网关的

nslookup

nslookup www.baidu.com 进行域名与IP地址的解析

nslookup >server 查看本机DNS服务器

Linux网络测试命令

ping

探测制定IP或域名的网络状况

-c : 指定ping包的次数

ping 192.168.0.252

telnet

远程管理与端口探测命令

telnet 192.168.0.252 80 (telnet ip port)

traceroute

路由跟踪命令

-n : 使用ip不使用域名,更快

raceroute www.baidu.com 打印出到该ip所经过的所有网关路由等

wget

下载命令

tcpdump

抓包的命令

-i : 制定网卡接口

-nn : 将数据包中的域名与服务转为IP和端口

-X : 以十六进制和ASCII码显示数据包内容

port 制定监听端口

tcpdump -i eth0 -nnX port 21

Linux Network Management的更多相关文章

  1. Netstat Commands for Linux Network Management

    netstat (network statistics) is a command line tool for monitoring network connections both incoming ...

  2. Queueing in the Linux Network Stack !!!!!!!!!!!!!!!

    https://www.coverfire.com/articles/queueing-in-the-linux-network-stack/ Queueing in the Linux Networ ...

  3. Netruon 理解(11):使用 NAT 将 Linux network namespace 连接外网

    学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

  4. Netruon 理解(12):使用 Linux bridge 将 Linux network namespace 连接外网

    学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

  5. Simple Network Management Protocol - SNMP Tutorial

    30.9 Simple Network Management Protocol Network management protocols specify communication between t ...

  6. SNMP: Simple? Network Management Protocol(转)

    转自:http://www.rane.com/note161.html An SNMP Overview The Message Format The Actual Bytes Introductio ...

  7. Linux network 资料链接

    1.iptables 基础 https://wiki.centos.org/HowTos/Network/IPTables 2.HOWTOs on netfilter site http://www. ...

  8. Linux Network Namespace

    Linux Network Namespaces Linux kernel在2.6.29中加入了namespaces,用于支持网络的隔离,我们看一下namespace是如何使用的 创建与配置 创建一个 ...

  9. (转)Linux Network IO Model、Socket IO Model - select、poll、epoll

    Linux Network IO Model.Socket IO Model - select.poll.epoll  原文:https://www.cnblogs.com/LittleHann/p/ ...

随机推荐

  1. 老李分享: 并行计算基础&编程模型与工具 2

    2.并行编程模型和工具 – MPI – MPI(Message Passing Interface)是一种消息传递编程模型,服务于进程通信.它不特指某一个对它的实现,而是一种标准和规范的代表,它是一种 ...

  2. 原生JS跨浏览器事件封装处理

    引子:用javascript给元素绑定事件,我们可以用addEventListener这个方法,然而这个方法有兼容问题,比如在IE浏览器上面就无效,在IE上面要用attachEvent这个方法 一.a ...

  3. 是什么让C#成为最值得学习的编程语言

    随着 Web.iOS.Android.智能设备的流行,新的编程语言纷纷涌现并表现不俗,如 Ruby,Python,Scala,Go,Node.js,Swift 等.反观已经发展了近20年的 C# 语言 ...

  4. Python科学计算—numpy模块总结(1)

    作为一个本科学数学专业,目前研究非线性物理领域的研究僧.用什么软件进行纯科学计算好,Fortran永远是第一位的:matlab虽然很强大,可以很容易的处理大量的大矩阵,但是求解我们的模型(有时可能是几 ...

  5. pwm最后的解释

    之前学东西总是模模糊糊,前几天看了pwm,虽然知道怎么配置,但是如果让我自己去写一个pwm的程序,我却不知如何下手. 不知道如何配置他的频率和占空比.今天痛定思痛,决定彻底搞懂pwm. 百度给 的答案 ...

  6. 使用Perl提取Excel中的IO_MUX

    使用Perl提取Excel中的IO_MUX 关键问题 提取数据 格式化输出 循环嵌套 数据结构构建 坐标映射,逆向提取关键字 描述 在IC集成中,我们使用Excel表格规划设计的IC引脚功能映射需要转 ...

  7. 用js+cookie实现商城的购物车功能

    页面上的添加功能主要就是两个按钮 <input name="buy" type="image" alt="第一个商品" src=&qu ...

  8. Angular2.js——数据显示

    显示数据,即属性绑定机制把数据显示到用户界面上. 在Angular中最典型的数据显示方式,就是把HTML模板中的控件绑定到Angular组件的属性. 接下来介绍几种数据显示的语法和代码片段. 使用插值 ...

  9. Session攻击(会话劫持+固定)与防御

    1.简介 Session对于Web应用无疑是最重要的,也是最复杂的.对于web应用程序来说,加强安全性的第一条原则就是 – 不要信任来自客户端的数据,一定要进行数据验证以及过滤,才能在程序中使用,进而 ...

  10. php生成二维码的几种方式整理及使用实例

    hp生成二维码的方式:1.google开放api:2.php类库PHP QR Code:3.libqrencode:4.QRcode Perl CGI & PHP scripts感兴趣的朋友可 ...