惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
GRAHAM CLULEY
S
Security @ Cisco Blogs
P
Proofpoint News Feed
Cisco Talos Blog
Cisco Talos Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tor Project blog
WordPress大学
WordPress大学
Project Zero
Project Zero
S
Schneier on Security
P
Proofpoint News Feed
小众软件
小众软件
P
Privacy International News Feed
美团技术团队
L
LangChain Blog
Know Your Adversary
Know Your Adversary
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
Engineering at Meta
Engineering at Meta
I
InfoQ
量子位
Vercel News
Vercel News
博客园 - 三生石上(FineUI控件)
Spread Privacy
Spread Privacy
D
DataBreaches.Net
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
U
Unit 42
P
Privacy & Cybersecurity Law Blog
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
Latest news
Latest news
K
Kaspersky official blog
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
Simon Willison's Weblog
Simon Willison's Weblog
云风的 BLOG
云风的 BLOG
S
Securelist
AWS News Blog
AWS News Blog
F
Fortinet All Blogs
T
Threat Research - Cisco Blogs
Stack Overflow Blog
Stack Overflow Blog
Scott Helme
Scott Helme
Help Net Security
Help Net Security
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Tenable Blog

Posts on Changkun's Blog

Why High-Output Systems Are Often the First to Stop Growing Dark Forest Theory: A Formal Derivation Agents (or Humans) in Goal-Directed and Goalless Environments: On Pipelines, Priors, and the Rhythm Between Exploration and Exploitation At the Boundary of Self-Reference: From Stable Structures in Artificial Intelligence to the Self as a Recursive Model in an Open Dissipative System 2023 Reading List 2022 Reading List 2021 Reading List Are PSS/USS and RSS Actually the Same Thing? Performance Differences from Page Faults vs. Prefetching 2020 Year-End Review Migration with Zero Downtime 2020 Reading List The All in Go Stack Pointers Might Not Be Ideal for Parameters Eliminating A Source of Measurement Errors in Benchmarks Setup Wordpress in 10 Minutes 我为什么不再写博客了? 2019 年终总结 2018-2019 读书清单 Ten years of blogging Rethinking the Reflections on Communications and Trusts 2018 年终总结 Go source code study is open source Go source study: unsafe Pattern Go source study: sync.Pool Go runtime programming A Million WebSocket and Go Designing Asynchronous RESTful APIs 分布式杂谈01:CAP 理论的误解 Issues of Human-Bot Interaction 压缩法与深度网络的泛化性 Go in 1 Hour UMSLT04: The Past and Present of SGD UMSLT03: A Gentle Start of Learning Theory UMSLT02: A Breif History of Neural Networks UMSLT01: A Breif History of Regularization 不笑不足以为道 论文笔记:Generalization in Deep Learning 2017 年终总结 2017 读书清单 深度学习的泛化理论简介 删除 GitHub 上已经提交的敏感信息 硕士生涯的第一年就这样告一段落了 人肉计算(10): 系统参与激励 人肉计算(9): 陷阱的解法 别聊,一聊你就暴露 人肉计算(8): 人肉计算与数据科学中的陷阱 人肉计算(7): 社会行为分析 Hexo + GitHub + Travis CI + VPS 自动部署 人肉计算(6): 预测市场 人肉计算(5): 信用风险评级模型 读书与回报 瞎扯: 对现代企业理论与当下IT企业的商业模式和信息产业链的规律性的思考 人肉计算(4): 输入数据聚合与PageRank 又一次打整了一下博客 人肉计算(3): 输入数据聚合与链路预测 人肉计算(2): 意图博弈 GWAPs 人肉计算(1): 众包与群众智慧 对后辈同学在计算机专业上的答疑与解惑 在德国的医疗及住院体验 这可能不是一个技术博客了 实验楼楼赛第3期-Python-题解 迅速更换了 DISQUS Electron 深度实践总结 良好的编码体验的三个方面 2016 年终总结 2016 读书清单 最近在着手写的文章 微信小程序文档极致总结 谈谈过去三个月在实验楼的实习经历 Built a Desktop Client for My Blog Guacamole 源码分析与 VNC 中 RFB 协议的坑 《高速上手 C++11/14》正式发布 Docker 极速入门教程02 - 镜像与容器管理 Docker 极速入门教程01 - 基本概念和操作 阶段性沉默 ELK+Redis 最佳实践 终于全面启用了 HTTPS 苹果开源了LZFSE无损压缩 Hash 碰撞的一种思路 记一次完整的 Kaldi-TIMIT 示例运行 Kaldi 上的 TIMIT 例子 Kaldi 安装与部署 从科研写作谈起 Swift API 设计指南 有趣的人类 所以其实论文并没有什么鬼用 Githug 通关记录及指南 小结一下这学期的收获 2015 读书清单 2015 年终总结 负能量爆表 转眼就快两个月了 博客迁移记录 大三总结 这个世界,终究不会是我们的。 Linux 内核分析 之六:Linux 内核创建进程的过程 小说「泽缘」 Linux 内核分析 之五:system_call中断处理过程的简要分析 大创项目的标题真是每年都在考验同学们的想象力啊
Linux学习笔记 6 网络及配置相关
Changkun Ou · 2013-12-08 · via Posts on Changkun's Blog

Published at发布于:   |   PV/UV: /   |   Reading阅读: 1 min

网络原理

IP编址

IP编址是一个双层编址方案,一个IP地址表示一个主机(或一个网卡接口),应用最广泛的是IPv4编址,但是已向IPv6编址切换

一个IPv4地址为32位长,IPv6地址为128位长(2^128个)

IPv4地址分为2个部分:网络部分(标识所属区域)和主机部分(标识区域中的哪台主机)

IPv4共32位,使用点分十进制方式表示,分为四个部分,每部分八位

192.168.1.1(11000000.10101000.00000001.00000001)

子网掩码

通过子网掩码来确定网络部分的位数

子网掩码与IP地址一样,有32bit,每一位与IP地址中的每一位一一对应。

IP地址中对应子网掩码中为1的部分为网络部分。

192.168.1.1

255.255.255.0

证明此IP地址的前24位是网络部分,也就是说此IP地址处在同一个网络的其他主机的IP地址前24位相同,以证明他们在同一网络。

网关/路由

在不同网络之间传输数据的功能叫做路由功能,一般有多个接口,接到不同网络中,并通过路由表进行数据转码

路由表:

目标网络       子网掩码       出接口

192.168.1.1   255.255.255.0   eth0

172.16.1.0    255.255.255.0   eth1

61.1.1.0      255.255.255.0   eth2

域名:

类型:表示此域名的类型

域名:域名名称

主机名:该域中的某台主机名称

DNS

每一个域名代表一个IP,而DNS服务就是用来在IP与域名之间进行转换的。

 

基本网络参数:

要配置一个局域网通信的计算机需要:

(1)IP地址(2)子网掩码

要配置一个跨网端通信的计算机需要:

(1)IP地址(2)子网掩码(3)网关

要配置一个可以上网的计算机需要:

(1)IP地址(2)子网掩码(3)网关(4)DNS

 

<span style="font-size:24px;">**Linux网络配置**</span>

以太网接口被命名为:eth0、eth1等(数字表示网卡编号)

通过lspci查看网卡硬件信息(usb网卡需要用lsusb)

ifconfig -a &nbsp;查看所有

ifconfig eth0 查看特定接口

ifup ifdown 启用/禁用一个接口

setup配置网卡,配置王成后,使用ifup启用网卡,并使用ifconfig命令查看信息

网络相关配置文件

网卡配置文件

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

DNS配置文件

/etc/resolv.conf

主机名配置文件

/etc/sysconfig/network

静态主机名配置文件

/etc/hosts

网络测试命令

测试网络连通性

ping www.baidu.com

测试DNS解析

host www.baidu.com

dig www.baidu.com

显示路由表

iproute

追踪到达目标地址的网络路径

traceroute www.baidu.com

使用mtr进行网络质量测试(结合了traceroute和ping)

mtr www.baidu.com

修改主机名:

实时修改主机名

hostname www.baidu.com

永久性修改主机名

/etc/sysconfig/network

HOSTNAME = www.baidu.com

&nbsp;

故障排查:

网络故障排查遵循从底层到高层,从自身外部的流程进行

先查看网络配置信息是否正确:

(1)IP(2)子网掩码(3)网关(4)DNS

查看到达网关是否联通:

ping

查看DNS解析是否正常:

host