logo资料库

思科网络典型配置案例集锦(吐血推荐.doc

第1页 / 共5页
第2页 / 共5页
第3页 / 共5页
第4页 / 共5页
第5页 / 共5页
资料共5页,全文预览结束
思科网络典型配置案例集锦(吐血推荐) 本人整理的部分配置方案,现在还不全,一直在努力中,我会不断更新 2900XL VLAN config -------------------------------------------------------------------------------- Switch# vlan database Switch(vlan)# vtp domain domain-name Switch(vlan)# vtp domain domain-name password password-value Switch(vlan)# vtp server Switch(vlan)# show vtp status 若想 Disable VTP,只须将 VTP 模式改为 transparent 即 Switch(vlan)# vtp transparent 2. 激活 VTP V2(交换机默认的是 VTP V1)。 Switch# vlan database Switch(vlan)# vtp v2-mode Switch# show vtp status 3. 增加 VLAN。Catalyst 2900XL 系列交换机最大支持 64 个激活的 VLAN, VLAN ID 号从 1-1005。 Switch# vlan database Switch(vlan)# vlan vlan-id name vlan-name Switch# show vlan name vlan-name Switch(vlan)# no vlan vlan-id //删除 VLAN 4. 将端口加入 VLAN。 Switch# configure terminal Switch(config)# interface interface Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan vlan-id Switch(config-if)# show interface interface-id switchport 5. 配置 trunk 端口。 Switch# configure terminal Switch(config)# interface interface Switch(config-if)# switchport mode trunk Switch(config-if)# switchport trunk encapsulation isl Switch(config-if)# end Switch# show interface interface switchport Switch# copy running-config startup-config 6. 配置 trunk 上允许的 VLAN。 Switch(config)# interface interface Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan remove vlan-id-range Switch(config-if)# switchport trunk allowed vlan add vlan-id-range Switch(config-if)# end Switch# show interface interface switchport allowed-vlan 若想取消 trunk 端口,只需 Switch(config-if)# no switchport mode 7. 使用 STP 实现负载。 实现负载分担有两种方法: 1) 使用端口优先级。 配置: Switch_1(config-if)# interface fa0/1 Switch_1(config-if)# spanning-tree vlan 8 9 10 port-priority 10 Switch_1(config)# interface fa0/2 Switch_1(config-if)# spanning-tree vlan 3 4 5 6 port-priority 10 2) 使用路径值。例如: Switch_1(config)# interface fa0/1 Switch_1(config-if)# spanning-tree vlan 2 3 4 cost 30 Switch_1(config)# interface fa0/2 Switch_1(config-if)# spanning-tree vlan 8 9 10 cost 30 ----------------------------------- Cisco HSRP 的配置 ----------------- version 12.0 service timestamps debug uptime service timestamps log uptime no service password-encryption hostname r1 enable password cisco ip subnet-zero interface Ethernet0 ip address 136.147.107.101 255.255.0.0 no ip redirects no ip directed-broadcast standby 150 timers 5 15 /* 定义 150 组 5 秒交换一次 hello 信息,15 秒没收到 hello 信息就开始切换 */ standby 150 priority 110 /* 定义 150 组的主路由器权值,值越大,为主路由 standby 150 preempt /* enable 150 组的 hsrp 抢占功能 */ 器希望越大 */
standby 150 authentication cisco /* 设置 150 组的 router 身份验证串 */ standby 150 ip 136.147.107.100 /* 定义 150 组的浮动地址,也是这台 router standby 150 track Ethernet0 /* 定义监控的端口 */ 连接的网络的网关 */ interface Serial0 no ip address no ip directed-broadcast no ip mroute-cache shutdown no fair-queue ip classless line con 0 transport input none line 1 16 line aux 0 line vty 0 4 password cisco login end 16AM 配置 ---------- 设置 16 口 Modem 拨号模块,使用内部 DHCP 服务为拨入用户分配地址 Cisco2620(config)#interface Group-Async1 Cisco2620(config-if)# ip unnumbered FastEthernet0/0 Cisco2620(config-if)# encapsulation ppp Cisco2620(config-if)# ip tcp header-compression passive:启用被动 IP 包头压缩 Cisco2620(config-if)# async mode dedicated:只在异步模式下工作 Cisco2620(config-if)# peer default ip address dhcp:将 IP 地址请求转发至 DHCP 服务器 Cisco2620(config-if)# ppp authentication chap:将认证设为 CHAP Cisco2620(config-if)# group-range 33 48:拨号组包括 16 个口 Cisco 的 16AM 模块提供了高密度的模拟电路接入方式,不在办公大楼的员工可以用 Modem 拨号联入局 域网、登录服务器,实现远程办公。 peer default ip address dhcp 命令可以使拨入的工作站通过局域网内的 DHCP 服务器动态地获得 IP 地 址,节约了 IP 地址资源,同时还接收了在 DHCP 服务器上配置的参数,比如 DNS 服务器的 IP 地址,并 配合全局模式下配置的指向防火墙的静态路由,使工作站同时也可以通过防火墙访问 Internet。 Cisco2620(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.4:设置到防火墙的静态路由 (5) 对 16AM 模块物理特性的设置
Cisco2620(config)#line 33 48: 进入 Modem 口线模式 Cisco2620(config-line)# session-timeout 30:超时设为 30 分钟 Cisco2620(config-line)# autoselect during-login:自动登录 Cisco2620(config-line)# autoselect ppp:自动选择 PPP 协议 Cisco2620(config-line)# login local:允许本地口令检查 Cisco2620(config-line)# modem InOut:允许拨入拨出 Cisco2620(config-line)# transport input all:指定传输协议 Cisco2620(config-line)# stopbits 1:设置一位停止位 Cisco2620(config-line)# flowcontrol hardware:设置硬件流控制 (6) 添加拨号用户的用户名和密码 Cisco2620(config)#username shixuegang password abc123:增加用户名 shixuegang,口令为 abc123 Cisco PIX 防火墙的安装流程 1. 将 PIX 安放至机架,经检测电源系统后接上电源,并加电主机。 2. 将 CONSOLE 口连接到 PC 的串口上,运行 HyperTerminal 程序从 CONSOLE 口进入 PIX 系统;此时系统提示 pixfirewall>。 3. 输入命令:enable,进入特权模式,此时系统提示为 pixfirewall#。 4. 输入命令: configure terminal,对系统进行初始化设置。 5. 配置以太口参数: interface ethernet0 auto (auto 选项表明系统自适应网卡类型 ) interface ethernet1 auto 6. 配置内外网卡的 IP 地址: ip address inside ip_address netmask ip address outside ip_address netmask 7. 指定外部地址范围: global 1 ip_address-ip_address 8. 指定要进行要转换的内部地址: nat 1 ip_address netmask 9. 设置指向内部网和外部网的缺省路由 route inside 0 0 inside_default_router_ip_address route outside 0 0 outside_default_router_ip_address 10. 配置静态 IP 地址对映: static outside ip_address inside ip_address 11. 设置某些控制选项: conduit global_ip port[-port] protocol foreign_ip [netmask] global_ip 指的是要控制的地址 port 指的是所作用的端口,其中 0 代表所有端口
protocol 指的是连接协议,比如:TCP、UDP 等 foreign_ip 表示可访问 global_ip 的外部 ip,其中表示所有的 ip。 12. 设置 telnet 选项: telnet local_ip [netmask] local_ip 表示被允许通过 telnet 访问到 pix 的 ip 地址(如果不设此项, PIX 的配 置只能由 consle 方式进行)。 13. 将配置保存: wr mem 14. 几个常用的网络测试命令: #ping #show interface 查看端口状态 #show static 查看静态地址映射
分享到:
收藏