赞
踩
11010010.01001001.10001100.00000110 = 210.73.140.6 # 便于记忆
192.168.0.25 # 192.168.0:网络部分 # 25:主机部分
IP地址分为A、B、C、D、E五类,每一类有不同的划分规则
类型 | 范围 | 备注 |
---|---|---|
A类 | 00000000~01111111 | 0~126 |
B类 | 10000000~01111111 | 128~191 |
C类 | 11000000~11011111 | 192~223 |
D类 | 11100000~11101111 | 224~239 |
E类 | 11110000~11111111 | 240~255 |
127又称为本机回环地址,通常利用在本机上 ping 此地址来检查TCP/IP协议安装是否正确
网络部分(NETWORK)
主机部分(HOST)
A类地址:第1个8位组为网络部分,其余3个8位组为主机部分
B类地址:前2个8位组为网络部分,后2个8位组为主机部分
C类地址:前3个8位组为网络部分,最后一个8位组为主机部分
从用户的使用角度 IP 地址分为两类
共有地址(应用于Internet外部网络,需要向电信、联通、移动等、运营商租用,需要付费才能使用)
私有地址(应用于公司内部的局域网,无需付费,直接可以使用)
与
运算得到网络地址
使用 ipconfig 命令查看本机网络配置信息
使用 ping 命令诊断网络连接
空闲一段时间后,重回初始界面的问题
switch(config)#line con 0
switch(config-if)#exec-timeout 0 0
控制台消息打断输入的处理
switch(config)#line con 0
switch(config-if)#logging synchronous
禁用DNS查询
switch(config)#no ip domain-lookup
一键配置
en
conf t
no ip domain-lo
line con 0
logg syn
exec-timeout 0 0
exit
Router(config)#interface fastethernet 0/1
Router(config-if)#ip address ip-address subnet-mask | ip add ip-address subnet-mask
Router(config-if)#no shutdown | no shut
Switch(config)#interface vlan 1
Switch(config-if)#ip address ip-address subnet-mask
Switch(config-if)#no shutdown
Router#show ip interface brief | sh ip int br
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.10.1 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
Router#
192.168.10.0 255.255.255.0
192.168.10.1~192.168.10.255(256个)
192.168.10.0(网络地址或网段)
192.168.10.255(广播地址)
192.168.10.1~192.168.10.245(可用的主机地址254个)
路由器的每个接口都代表一个网段
协议字段
ICMP是一个“错误侦测与回馈机制”,通过IP数据包封装的,用来发送错误和控制消息
ping 命令的基本格式为
C:\>ping [–t] [-l 字节数] [-a] [-i] IP_Address | target_name
局域网中主机的通信
什么是ARP协议
IP地址解析为MAC地址
IP地址 | 物理地址 | 类型 |
---|---|---|
10.0.0.200 | 00-1a-64-b1-5a-f2 | 动态 |
10.0.0.2 | 08-00-00-20-11-11 | 动态 |
Windows系统中的ARP命令
查看ARP缓存表
Router#show arp
清除ARP缓存
Router#clear arp-cache
ARP绑定
Router(config)#arp 1.1.1.1 0011.1111.1111 arpa
Router#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 1.1.1.1 - 0011.1111.1111 ARPA
Internet 10.0.0.2 4 001f.cab6.c959 ARPA FastEthernet0/1
Internet 10.0.0.1 - 001f.caff.1041 ARPA FastEthernet0/1
需求分析
实现步骤
在主机和网关设备上绑定ARP
主机绑定ARP
netsh interface ipv4 show neighbors
netsh interface ipv4 set neighbors 11 10.0.0.178 00-1a-e2-df-07-41
网关路由器绑定ARP
Router(config)#arp 10.0.0.95 0013.240a.b219 arpa f0/0
交换机绑定ARP
Switch(config)#arp 10.0.0.12 90fb.a695.4445 arpa f0/2
Switch(config)#arp 10.0.0.178 001a.e2df.0741 arpa f0/1
Switch(config)#arp 10.0.0.95 0013.240a.b219 arpa f0/3
使用ARP防火墙,自动抵御ARP欺骗和攻击
MAC地址为真实计算机地址
MAC地址为虚假地址
查看交换机的MAC地址表,确定此MAC所属端口
Switch#show mac address-table address 001f.caff.1003
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
1 001f.caff.1003 DYNAMIC Fa0/1
Total Mac Addresses for this criterion: 1
玄子Share-网络层协议介绍 2024-02-26
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。