大型网络命令集锦

T568A的 线序:白绿,绿,白橙,蓝,白蓝,橙,白棕,棕。白绿和绿为发送,白橙和橙为接收。12345678
T568B的 线序:白橙,橙,白绿,蓝,白蓝,绿,白棕,棕。白绿和绿为发送,白橙和橙为接收。36145278
计算水晶接口的用量: 水晶头=信息点数量4+信息点数量415% (N415%)表示留有的富余量
信息模块的用量=N+N
3% 电缆的用量=[0.55(最远距离+最近距离)+6]N除于305 N是信息点数 305是每箱的线数 0.55是备用系数
工作区子系统 水平子系统 管理子系统 垂直子系统 建筑群子系统 设备间子系统

                                 第一章  vlan和 trunk

一、配置vlan。
创建vlan与删除vlan
1.(config)# vlan 1
exiit
2.#vlan database
vlan 1
no vlan 1
3.将端口加入vlan 将多数端口加入到vlan中
(config)#interface f0/1 interface range f0/4-10
(config-if)# switchport mode accss
switchport access vlan 1
将接口添加或删除到某个vlan中
(config-if)# no switchport access vlan 1
4.验证vlan的配置。 #show vlan brief
5.配置接口为以太网通道模式
(config-if)# interface range fastEthernet 0/1 - 2
(config-if-range)#switchport mode trunk
(config-if-range)#channel-group 1 mode on
二、配置trunk。每箱
(config)# interface fastEthernet 0/24
(config-if)#switchport mode trunk
检查trunk

show intrface fastEthernet 0/24 switchprot

从trunk中去除和添加vlan
(config-if)#switchport trunk allowed vlan remove vlan 2
(config-if)#switchport trunk allowed vlan add vlan 2
路由器的f0/0端口设置子接口并和vlan--对应。
router(config)#interface fastEthernet 0/0.1
router(config-subif)#ip address 192.168.1.1 255.255.255.0
router(config-subif)#exit

                  第二章   三层交换和VTP

1.启动路由器功能 Switch(config)#ip routing
2.配置vlan的IP Switch(config)#interface vlan 1
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no shutdown
3.配置路由器接口实现点对点的连接 Switch(config-if)#no switchport
4.在3层交换机配置trunk SW-3L(config)# interface fastEthernet 0/24
SW-3L(config-if)#switchport trunk encapsulation dot1q
SW-3L(config-if)#switchport mode trunk
5.创建vtp域 (config)# vtp domain abc(名字)
6、配置交换机vtp模式 (config)#vtp mode (server 或者 client)
7.配置vtp口令 (config)# vtp password (密码)
8.vtp 修剪 (config)# vtp pruning
9.vtp版本 (config)# vtp version 2
10.查看vtp配置信息 (config)# show vtp status

                        第三章  生成树协议

1.指定根网桥 Switch(config)#spanning-tree vlan 1 (1-5)priofty 4096
Switch(config)#spanning-tree vlan 1 root (primary secondary)
2.启用生成树 Switch(config)#spanning-vlan 1
3.查看生成树 Switch#show sopanning-tree (vlan 5)
4.查看交换机MAC地址 #show version
5.生成树算法 选择跟网桥:比较交换机的ID,优先级小的被选择为根网桥,在优先级相同的情况
下,MAC地址小的为根网桥。
选择根端口:到根网桥最低的根路径成本。10M是100 100M是19 1000M是4
直连的根网桥的ID最小。
端口ID最小
选择指定端口:根网桥上的端口全是指定端口
在每个网段上,选择一个指定端口
非根网桥上的指定端口,选择顺序是 :
根成本 所在交换机的网桥ID的值较小 端口ID的值较小

                       第四章   HSRP路由器热备份

1.将路由器配置成为HSRP成员 router(config-if)#standby 组号 ip 虚拟ip地址
2.从HSRP组中取消一个端口 router(config-if)# no standby ip地址和子网掩码
3.指定优先级 router(config-if)# standby 组号 priority 数字(优先级)
4.查看优先级 show standby
5.占先权 router(config-if)#standby 组号 preempt(两台路由器都设)
6.设置端口追踪 router(config-if)#standby 组号 track(追踪) f0/0 100
7.关闭追踪命令 router(config-if)#on standby group track
8.显示HSRP路由器的状态 #show standy brief 或者,加端口号 组
#show standy brief f0/0 1 brief

                       第五章    访问控制列表
                                                                     源IP地址 

1.创建ACL router(config)#access-list 访问列表号码 (permit或 deny)source 反码
2.关键字 0.0.0.0 255.255.255.255 可以用 any 代替
192.168.2.2 0.0.0.0 可以用 host 192.168.2.2代替
3.删除ACL router(config)# no accss-list 组
4.将ACL应用于接口 router(config-if)#ip access-group 接口 (in或者out)
5.在接口上取消ACL应用于接口router(config-if)# on ip access-group 接口(in或者out) (取值在100-199之间)
6.扩展访问列表 router(config)#access-list 表号 {permit或deny } 协议 源地址反码 目的地地址反码 eq 端口号
7. 源IP 目的地IP 规则 协议 端口
permit或beny (HTTP,icmp) (80,echo) echo-reihy(回来)
8.查看ACL信息 #show access-lists

                      第六章         地址转换

1.指定地址转换映射 router(config)# ip nat inside soutce static 内部IP 映射IP
2.在内外部启用端口 router(config-if)# ip nat inside ip nat outside
3.同一内部局部地址映射到多个内部全局地址
router(config)# ip nat inside soutce static tcp 192.168.100.2 61.159.62.131
router(config)# ip nat inside soutce static tcp 192.168.100.2 61.159.62.132
4.nat端口映射
router(config)# ip nat inside soutce static tcp 192.168.100.2 80 61.159.62.131 80
router(config)# ip nat inside soutce static tcp 192.168.100.3 8080 61.159.62.131 8080
5.使用接口的IP地址作为转换后的源地址
router(config)# ip nat inside soutce list 1 interface f0/0 overload
6.例子 1.配置接口内外口接口IP
2.定义内部访问列表 router(config)# access-list 1 permit 10.1.1.0 0.0.0.255
3.设置复用动态IP地址转换。
4.在内部外部使用NAT
5.配置默认路由
7.查看NAT转换条目
router(config)# show ip nat translantions
8.指定服务器远程管理三层交换机。
1.配置管理IP Switch(config-if)#ip add 192.168.1.1 255.255.255.0
2.配置访问控制列表(ACL)Switch(config)#access-list 1 permit host 192.168.2.2
3.配置远程管理计算机的用户名和密码 Switch(config)#username hui passwork hui
4.配置特权密码 Switch(config)#enable password 000
5.配置远程。 Switch(config)#line vty 0 4
6.开启远程指定用户名和密码 Switch(config-line)#login local
7.引用访问控制列表 Switch(config-line)#access-class 1 in
第八章 广域网连接

1.ppp协议 router(config)# int serial f0/0
2.配置接口IP router(config-if)# ip address 192.168.1.1 255.255.255.0
3.制定网络流量 router(config-if)#clock tate 128000
4.配置ppp协议 router(config-if)# encapsulation ppp (封装ppp协议两端都要写)
5.配置主认证用户和密码 router(config)# username 名字 password 密码
6.启用PAP认证 router(config-if)# ppp authentication pap
7.被认证方 router(config-if)# ppp pap sen-username 名字 password 密码

                          第九章   配置帧中继交换机

1.开启中继交换功能 Router(config)#frame-relay switching
2.配置接口封装 Router(config)# int s0/0
Router(config-if)#no shutdown
Router(config-if)#clock rate 128000
Router(config-if)#encapsulation frame-relay 封装中继
3.配置LMI类型 Router(config)#int s 0/1
Router(config-if)#frame-relay lmi-type cisco
Router(config-if)#frame-relay intf-type dce
4.配置帧中继交换表 Router(config)#int s0/0
Router(config-if)#frame-relay route 103 int s0/1 301
Router(config-if)#frame-relay route 104 int s0/2 401
(从接口收到103的帧,要从s0/1交换出去,并且DLCI改为301)
5.检查中继交换机配置 show frme-relay route
6.配置其他路由的(DTE端)
Router(config)#int s1/0
Router(config-if)#ip add 192.168.123.3 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#encapsulation frame-relay
7.关闭自动映射配置手工静态帧中继映射
Router(config)#int s1/0
Router(config-if)#no frame-relay inverse-arp
Router(config-if)#frame-relay map ip 192.168.123.1 301 broadcast
(往192.168.123.1地址去的封装401 DLCI号)
8.配置帧中继上的RIP。
接口配置IP地址 启动RIP 宣告主网络号 关闭自动汇总 查看路由表 ping测试
show ip route router rip 宣告主网络号 version 2 版本设置 no auto-summary (关闭自动汇总)
9.增加互指静态映射
Router(config)#int s1/0 Router(config-if)#frame-relay map ip 192.168.123.4 301
Router(config)#int s1/0 Router(config-if)#frame-relay map ip 192.168.123.3 401

                            第十章   OSPF单区域

1.启动OSPF路由进程 Router(config)#route ospf 1
2宣告OSPF(宣告IP地址)接口和所在区域 Router(config-router)#network 192.168.30.1 0.0.0.0 area 0
3.配置loopback 地址 RouteID Router(config)#interface Loopback0
Router(config-if)# ip address 20.1.1.1 255.255.255.0
Router(config-if)# no shutdown
4.配置接口的优先级 Router(config)#int f0/0
Router(config-if)#ip ospf priority 255

                            第十一章   OSPF多区域

1.配置ABR 将一台路由器的两个接口配置到不同的区域
2.配置ASBR 将两个不同的路由协议配置到同一台路由器
3.配置一个末梢区域(stub area) Router(config-router) area 1 stub
4.配置一个完全末梢区域。(totally stubby area)
Router(config-router) area 1 stub no-summary
5.代码类型。 type1 路由器LSA 由区域内的路由器发出的
type2 网络LSA 由区域内的DR发出的
type3 网络汇总LSA ABR发出的,其他区域的汇总链路通告
type4 ASBR汇总LSA ABR发出的,用于通告ASBR信息
type5 AS外部LSA ASBR发出的,用于通告外部路由
type7 NSSA外部LSA NSSA区域内的ASBR发出的,用于通告本区域连接的外部路由

                         第十五章  SDM控制和排错

1.允许http登陆 ip http server
2.指定本地认证 ip http authentication local
3.设置用户名和密码 username 账户 privilege 15 password 密码
4.设置远程管理 line vty 0 4
login local
允许telnet transport input telnet

          排错方法

1.分段检查法
2.替换法
3.分层排除法 物理层(线路好坏) 数据链路层(交换机) 网络层 (路由器) 传输应用 (应用程序)

路由器常用检查命令
1.连线
2.开机
3.TRUNK
三层交换机
int f0/x
switchport trunk encap dot1q
switchport mode trunk
二层交换机
int f0/1
switchport mode trunk
4.VTP
vtp domain xxx
vtp mode server/client
5.划分VLAN
vlan X
6.端口加入VLAN中
interface f0/x
switchport access vlan x
7.启用路由功能
ip routing
8.配置三层接口
int vlan x
ip address x.x.x.x y.y.y.y 此VLAN的网关地址
9.设置路由接口
interface f0/x
no switchport
ip address x.x.x.x y.y.y.y
10.配置默认路由
三层交换机 ip route 0.0.0.0 0.0.0.0 x.x.x.x 路由器的LAN口IP地址
路由器
1.接口设置IP地址
2.设置静态路由(指向三层交换机)
ip route 192.168.2.0 255.255.255.0 x.x.x.x
ip route 192.168.3.0 255.255.255.0 x.x.x.x
ip route 192.168.100.0 255.255.255.0 x.x.x.x 指向三层交换机的路由接口
设置PAT
1.设置标准ACL
access-list 1 permit any
2.使用接口作PAT
ip nat inside source list 1 int f0/1 overload
3.设置NAT的inside的outside接口
interface f0/0
ip nat inside
interface f0/1
ip nat outside
4. 用内网的计算机访问外网的WEB服务器之后,用
show ip nat translations 检查转换结果

发布服务器
1.ip nat inside source static 192.168.1.2 123.1.1.1(这个地址是路由器外网接口地址)

2.用外网的计算机访问内网的WEB服务器,地址为123.1.1.1,如果可以,实验结束。
3.保存write命令
1.查看配置 show running-config
2.查看物理层和数据链路层 show interface 端口号
3.查看网络层命令 show ip route show ip arp
4.调试命令 debug

交换机常用命令
1.查看接口命令 show interface f0/1 show interface f0/1 switchport
2.查看MAC地址表和ARP show mac-address-table show arp
3.其它命令 show vlan brief show vtp status

posted @ 2020-08-06 21:16  奋斗的羊  阅读(309)  评论(0编辑  收藏  举报