前言:
最近整理一些之前的学习笔记(有部分缺失,会有些乱,往后再补)。
过去都是存储在本地,这次传到网络留待备用。算法
Switch> 用户模式 Switch> enable #进入特权模式 Switch# 特权模式 Switch# configure terminal #进入全局配置模式 Switch(config)# 全局配置模式 Switch(config)# interface fastEthernet 0/1 #进入接口模式,接口 接口号 Switch(config-if)# 接口模式
exit
end
Switch(config)# hostname S1 //修改主机名为S1
# show mac-address-table
Switch# show running-config //查看交换机配置信息 或 简写 Swich# show run
Switch# show version //查看IOS版本信息
config)# enable password 123
(config)# enable secret 456 #全局模式能够配置口令 (config-if)# enable secret 456 #接口模式也能够配置口令
# copy running-config startup-config 或# write
(config)# erase startup-config (config)# reload
(config)# interface 接口 //进入接口 (config-if)# shutdow //禁用此接口
switch(config)#no ip domain-lookup
switch(config)# line console 0 //进入行控制台 switch(config-line)# exec-timeout 分钟 秒 //
(config)# line console 0 (config-line)# logging synchronous
switch(config-if)# duplex {full | half | auto} #duplex,双重
switch(config-if)# speed {10 | 100 | 1000 | auto}
switch# show interface fastethernet 0/24
全局模式:ip default-gateway 网关ip地址
(config)# vlan 编号 //编号1-1005 (config-vlan)# Name 名字 //给vlan命名
(config)# interface 接口名 //进入要加入vlan的接口 (config-if)# switchport access vlan 编号 //交换机接口接入vlan
(config)# interface range f0/1–10 //进入连续的接口 (config)# interface range fastEthernet0/1,fa0/3, ... //进入不连续的接口 (config-if-range)# switchport access vlan 编号 //多接口加入
# show vlan
(config)# no vlan 编号
(config)# 进入接口模式 (config-if)# switchport mode trunk ( 配置为trunk中继链路) #交换机端口 模式 trunk (config-if)# switchport mode access ( 配置为access接入链路)
(config)# interface fastEthernet trunk的端口名 #进入trunk所在端口 (config-if)# switchport trunk allowed vlan remove vlan编号
(config)# interface trunk的接口 //进入trunk链路接口 (config-if)# switchpot trunk allowd vlan add vlan编号 //
# show interface 接口名 switchport # show interfaces fastEthernet 0/24 switchport
(config)# ip route 目标网络ip 目标网络子网掩码 下一跳ip(经由点:进入对方网络的门户ip)
(config)# ip route 192.168.1.1 255.255.255.0 200.0.0.1 10 全局模式# ip route 目标ip 子网掩码 下一跳ip 优先级(1-255)
(config)# ip route 0.0.0.0 0.0.0.0 下一跳地址 全局模式# ip 路由 任意网络ID 任意子网掩码 下一跳地址
# show ip route //思科 # display //华为 // C直连路由 //connected route // S静态路由 //static route // S*默认路由
①防火墙未关闭 ====== 关闭防火墙 ②主机不在相同网段 == ③网关地址错误 ====== 配置正确网关,ping网关是否能通 ④DNS配置 ========== 配置正确DNS,DNS是否能正常解析域名
根据网络拓朴或流量变化,由路由器经过路由协议自动设置缓存
适合ISP服务商、广域网、园区网等大型网络安全
动态路由是网络中的路由器之间相互通讯,传递路由信息,利用收到的路由信息更新路由表的过程,是基于某种路由协议来实现的。网络
AS:自治系统(Autonomous System)dom
一、按应用范围的不一样,路由协议可分为两类:学习
- 正在使用的内部网关路由协议: OSPF:极为经常使用 //开放式最短路径优先 IS-IS:经常使用 RIP:基本废弃,RIP-1,RIP-2, IGRP(思科私有)、EIGRP(IGRP加强版)。
- 外部网关协议:域间路由协议(EGP=External Gateway Protocol) - 域间路由协议有两种:边界网关协议(BGP)和外部网关协议(EGP被淘汰)。
- 当你须要从一个AS发送流量到另外一个AS时;
二、按照路由执行的算法动态路由协议的分类 :ui
1)距离矢量路由协议 :RIP、IGRP.net
2)链路状态路由协议 :OSPF、IS-IS计算机网络
(config)# ip routing
(config)# interface vlan 编号 //进入虚拟接口 (config-if)# ip address ip地址 子网掩码 //配置ip (config-if)# no shutdown //启动端口
(config)# interface fastEthernet 接口 //进入接口 (config-if)# no switchport //转换为非交换机接口
(config-if)# switchport trunk encapsulation dot1q //封装802.1q (config-if)# switchport mode trunk //修改模式为trunk