好文档 - 专业文书写作范文服务资料分享网站

交换机、路由器常用配置

天下 分享 时间: 加入收藏 我要投稿 点赞

交换机配置

1、VTP协议配置步骤:

配置VTP:模式、域名、口令、版本、功能 sw(config)# vtp mode server|clie nt|tra nspare nt 模式 域名 口令 版本 修剪功能 sw(config)# vtp domai n vtpserver sw(config)# vtp password sw(config)# cisco 1|2 vtp vers ion sw(config)# vtp pruning

配置Trunk

设置互联接口为中继模式

创建VLAN 10 为端口分配vian aii 10 设置中继端口允许通过的 Vian J 删除某个列表(默认所有vian通过) 配置端口 sw(config-if)# switchport mode trunk

sW(config)# sw(config-if)# via n 10 switchport access via n switchport trunk aiiowed vian 配置策略

sW(config-if)# sW(config-if)# switchport trunk remove via n 验证VTP设置信息:show vtp status 2、生成树协议STP配置步骤:

配置 VTP: mode/domain/password/version

vtp mode server

vtp doma in vtpserver 配置Trunk switchport mode trunk 配置端口 Vian

vlan 10

switchport access via n 10 配置STP (实现负载均衡) sW(config-if)# port-priority sW(config-if)# spa nnin g-tree 16 spa nnin g-tree via n via n 10 cost 30 设置端口优先权 10 值 设置端口路径值 常见路由协议配置

配置路由协议前须配置接口:

1、 开启接口(命令:no shutdow n ) 2、 配置接口 IP地址

IPv4 命令:ip address 192.168.1.1 255.255.255.0 IPv6 命令:ipv6 address 2005:CCCC::1/64 3、 Serial 端口需指定时钟频率(命令: clock rate )

路由配置基本步骤:

1、 指定使用的路由协议 2、 指定协议版本等信息 3、 配置指定路由协议

IPv4静态 ip route ip route IPv6静态

ipv6 un icast-rout ing ipv6 route ipv6 route RIP 目标网络下一跳的ip

192.168.0.0 255.255.255.0 10.0.0.1

目标网络下一跳的接口

2005:CCCC::/64 serial 1/0

router rip version 版本号 network 相邻网络 version 2 network 192.168.0.0 IGRP router igrp network OSPF autonomous-system( 自治系统号) router rip n etwork 100 192.168.0.0 相邻网络 process-id( 进程 ID) router ospf router ospf 100 area 1 process-id 范围:1~65535,只在本路由器内起作用 n etwork address wildcard-mask area area-id wildcard-mask area-id 是掩码的反码 network 192.1.0.128 0.0.0.63 的范围:0~2人32,也可用点分十进制表示, 0.0.0.0 特指主干区域 EIGRP router eigrp aut onom ous-system router eigrp 100 n etwork n etwork-addr 掩码反码 n etwork 192.168.1.0 0.0.0.255 no auto-summary 查看路由信息: show ip route 查看指定路由协议的路由信息: show ip route rip|igrp|ospf|eigrp

其它技巧:

屏蔽端口变化信息: no loggi ng con sole 查看相应控制器: show co ntrollers serial

广域网协议配置:

IPsec

(con fig)# crypto isakmp policy 1

(config-isakmp)# authentication pre-share

(con fig-isakmp)# group 2 (config)# crypto isakmp key WRODaddress 对端 IP 地址 (con fig)# crypto ipsec tran sform-set WORDah-md5-hmac|ah-sha-hmac] [esp-des|esp-3des|esp-aes|esp-md5-hmac|esp-sha-hmac] (con fig)# crypto map WORD 10 ipsec-isakmp (con fig-crypto-map)# set peer 对端IP地址

set tran sform-set WORD (con fig-crypto-map)# match address 101

(con fig-crypto-(con fig)#

in terface tunnel 0

(config-if)# ip address 隧道端口 IP 及掩码 (con fig-if)# no ip directed - broadcast

NAT

1、 设置内网 (con fig-if)# ip nat in side 2、 设置外网 (con fig-if)# ip nat outside 3、 设置对应关系

A、静态NAT 设置“——

对应”关系 (con fig)# ip n at in side source static 内部 ip 夕卜部 ip B、动态NAT 配置地址池 定义ACL 关联ACL

(config)# ip nat pool access-list pool 名起始 IP 结束 IP netmask 掩 acl 编号 permit 源 IP 反掩码 acl 编号 pool 码 (config)# (co nfig)# ip nat in side source list pool name 配置地 址(config)# 池 定义ACL (config)# 关联ACL (con fig)# overload ip nat pool access-list pool 名起始 IP 结束 IP netmask 掩码 acl 编号 permit 源 IP 反掩码 acl 编号 pool pool 名 C、端口转换 ip nat in side source list

ACL

1、标准AC L配置:acl num = [1~99], 定义ACL

基于IP协议 acl num { permit | deny}源 IP 反掩码 acl num {in | out} 基于多种协议 (config)# (config-if)# access-list ip access-group 2、扩展ACL配置:acl num = [100~199], 定义 ACL access-list 反掩码目标IP反掩码 (config)# 应用ACL acl_num { permit | deny} ip_protocol 源 IP 说明 ip_protocol OSPF…] = [IP, ICMP, TCP, GRE, UDP, IGRP, EIGRP, IGMP, NOS, A、基于 TCP/UDP

(con fig)# access-list acl_num {permit | de ny} tcp|udp 源 IP 反掩码 [operator 端口号或名称]

目标IP 反掩码[operator 端口号或名称] [established ] [ log ]

交换机、路由器常用配置

交换机配置1、VTP协议配置步骤:配置VTP:模式、域名、口令、版本、功能sw(config)#vtpmodeserver|client|transparent模式域名口令版本修剪功能sw(config)#vtpdomainvtpserversw(config)#vtppasswordsw(config)#cisco
推荐度:
点击下载文档文档为doc格式
5vcjh8lafm4bptb11x4w7g2499iozz00mkd
领取福利

微信扫码领取福利

微信扫码分享