Cisco多网段配置方法
Cisco,多网段配置方法:现在的大型网络一般都使用二层交换机(百兆或千兆交换到桌面),并在二层或三层交换机上划分VLAN,然后再使用具有线速路由技术的三层交换机实现内网中VLAN间数据流的快速转发,从而使整个网络安全高速地运转。
为了和公网相联,一般还要用不可或缺的路由器。
此时,我们完全可以在不增加设备投资的情况下,启用路由器的DHCP Server功能,使它在完成好本职工作之余再兼任一台DHCP 服务器。
考虑到Cisco设备在许多大型网络中有着广泛的应用,因而本文将为大家介绍怎样在Cisco 设备上实现IOS DHCP Server功能以使各VLAN中的主机自动获得IP地址。
第一步:查看设备是否支持IOS DHCP Server功能一般的Cisco路由器或访问服务器,以及少部分安装有路由交换模块或多层交换功能卡的交换机都具有IOS DHCP Server功能。
如果还没有确认你的设备是否具备这一功能,那么,你可以按如下方法在命令行界面(CLI)下进行快速检测,步骤如下:dwzx>enablePassworddwzx#config t进入配置模式Enter configuration commands one per line. End with CNTL/Z.dwzx config#ip dhcp ?如果出现的是下面的信息,那么很遗憾,你的设备不支持IOS DHCP Server功能:% Unrecognized command在进行具体的配置之前,笔者先对本文所采用的设备及设置先作一个简单的介绍:用作IOS DHCP Server的路由器采Cisco 3620,它和内网相连的fastethernet0端口的IP地址为202.107.204.18,二层交换机采用Cisco 2924,三层交换机采用Cisco 3550-48-EMI。
在整个网络中有三个VLAN,为简化描述,假设每个VLAN都采用24位网络地址,其中VLAN1的IP地址为202.107.204.254,VLAN2的IP地址为202.107.205.254,VLAN3的IP地址为202.107.206.254。
第二步:在路由器上进行相关配置1.设置DHCP数据库代理DHCP数据库代理是用于存储DHCP绑定信息的一台主机,它可以是FTP、TFTP或者是RCP服务器。
当然,如有必要,你可以配置多个DHCP数据库代理。
同样,不配置DHCP数据库代理也是允许的,但这是以不能在DHCP数据库代理上存储地址冲突日志为代价的。
如果你不想配置数据库代理,你只要取消掉地址冲突日志的记录功能即可,操作命令如下:dwzx>enablePassword输入路由器的特权口令dwzx#config terminal进入配置模式Enter configuration commands one per line. End with CNTL/Z.dwzx config#no ip dhcp conflict logging 取消地址冲突记录日志2.设置不能用于动态分配的IP地址在整个网络中,有些IP地址需要静态的指定给一些特定的设备,例如路由器的端口、DNS 服务器、wins服务器以及VLAN的地址等。
显然,这些静态IP地址是不能用于动态分配的,这就需要将它们排除掉。
其步骤如下:dwzx config#ip dhcp excluded-address 202.107.204.1 202.107.204.5地址202.107.204.1至202.107.204.5不能用于动态分配dwzx config# ip dhcp excluded-address 202.107.204.254IP地址202.107.204.254固定为VLAN1的地址,不能用于动态分配dwzx config# ip dhcp excluded-address 202.107.205.254IP地址202.107.205.254固定为VLAN2的地址,不能用于动态分配dwzx config# ip dhcp excluded-address 202.107.206.254IP地址202.107.206.254固定为VLAN3的地址,不能用于动态分配3.配置DHCP地址池DHCP服务器的数据库被组织成一个树形结构,树根是用于动态分配的所有网络段的地址池,树枝是子网地址池,树叶是手工绑定给节点的地址。
详细步骤如下:dwzx config#ip dhcp pool global配置一个根地址池,global是地址池的名称,你可以采用有意义的字符串来表示dwzx dhcp-config#network 202.107.0.0 255.255.0.0动态分配的地址段dwzx dhcp-config#domain-name 为客户机配置域后缀dwzx dhcp-config#dns-server 202.107.204.1为客户机配置DNS服务器dwzx dhcp-config#netbios-name-server 202.107.204.1为客户机配置wins服务器dwzx dhcp-config#netbios-node-type h-node为客户机配置节点模式dwzx dhcp-config#lease 1地址租用期为1天dwzx dhcp-config#ip dhcp pool vlan1为VLAN1配置地址池,本池是global池的子池,将从global继承域后缀、DNS服务器、wins服务器等参数dwzx dhcp-config#network 202.107.204.0 255.255.255.0VLAN1动态分配202.107.204这个网段内可以被分配的地址 没有被排除的地址dwzx dhcp-config#default-router 202.107.204.254为客户机配置默认的网关,即VLAN1的IP地址dwzx dhcp-config#ip dhcp pool vlan2为VLAN2配置地址池,本池是global池的子池,将从global继承域后缀、DNS服务器、wins服务器等可继承的参数dwzx dhcp-config#network 202.107.205.0 255.255.255.0dwzx dhcp-config#default-router 202.107.205.254dwzx dhcp-config#ip dhcp pool vlan3为VLAN3配置地址池,本池是global池的子池,将从global继承域后缀、DNS服务器、wins服务器等参数dwzx dhcp-config#network 202.107.206.0 255.255.255.0dwzx dhcp-config#default-router 202.107.206.2544.按MAC地址为特定的用户分配指定的IP地址如果你需要为某些特定的节点分配指定的IP地址,你就需要手工绑定MAC地址和IP地址间的映射。
要按MAC地址为特定的节点分配指定的IP地址,只须在相应的地址池配置模式下输入如下命令即可:dwzx dhcp-config#host 202.107.204. 10 /24假设为VLAN1下的一个站点指定IPdwzx dhcp-config#client-identifier 01b7.0813.8811.66将202.107.204.10指定给MAC地址为01b7.0813.8811.66的节点5.配置路由器的静态路由表要使客户机能从用作DHCP Server的路由器中自动获得IP地址,首要条件就是各个VLAN 中的客户机都能和路由器通信,因此首先就需要在路由器中设置一个路由以使路由器能和各个客户机通信。
你可以按如下设置:dwzx config#ip route 202.107.204.0 255.255.255.0 FastEthernet0FastEthernet0为路由器和内网相连的以太网接口,该命令的作用是在以太网接口和VLAN1 202.107.204.254间建立一条静态路由dwzx config#ip route 202.107.205.0 255.255.255.0 FastEthernet0该命令在以太网接口和VLAN2 202.107.205.254间建立一条静态路由dwzx config#ip route 202.107.206.0 255.255.255.0 FastEthernet0该命令在以太网接口和VLAN3 202.107.206.254间建立一条静态路由设置好之后,在配置模式中键入EXIT命令回到特权模式下,Ping一下VLAN2和VLAN3的IP地址 202.107.205.254和202.107.206.254,如果能够Ping通则表明配置正确,可以直接进入下一步的保存过程。
6.保存路由器的设置命令如下:dwzx#copy running-config startup-config将当前正在运行的配置保存为启动配置Destination 2004712160825.htm startup-config ?dwzx#reloadProceed with reload? confirm直接回车确认至此,在路由器中的设置顺利完成,以下操作在交换机上进行。
第三步:在交换机上进行设置1.在交换机上为不同的VLAN指定DHCP服务器地址这一步骤只须在不同的VLAN中通过设置IP HELPER-ADDRESS即可搞定,指令如下:switch>ena进入交换机的特权模式Passwordswitch #config t进入配置模式Enter configuration commands one per line. End with CNTL/Z.switch config#interface vlan1配置VLAN1switch config-if#ip helper-address 202.107.204.18指定DHCP服务器的地址,即路由器的地址dwzx config-if#interface vlan2配置VLAN2dwzx config-if#ip helper-address 202.107.204.18dwzx config-if#interface vlan3配置VLAN3dwzx config-if#ip helper-address 202.107.204.182.对所有直接连到客户机的二层访问端口开启Portfast功能要使客户机正确获得IP地址,就需要将和客户机相连的交换机端口的Portfast功能打开。
cisco3560三层交换机vlan间路由配置实例
interface vlan 4 //同上
ip address 172.16.4.252 255.255.255.0
no shutdown
standby 4 ip 172.16.4.254
standby 4 priority 110 preempt
ip access-group 101 in
switchport mode trunk
switchprot trunk allowed vlan all
interface gigbitethernet 0/7 //进入模块0上的吉比特以太口7
Switchport mode access //定义这个接口的工作模式为访问模式
interface vlan 5
ip address 172.16.5.252 255.255.255.0
no shutdown
standby 5 ip 172.16.5.254
standby 5 priority 110 preempt
ip access-group 101 in
interface gigabitethernet 0/11 //进入模块0上的吉比特以太口11
switchport trunk encapsulation dotlq //给这个接口封装为802.1Q
switchport mode trunk //定义这个接口的工作模式为trunk
Enable //进入私有模式
Configure terminal //进入全局模式
service password-encryption //对密码进行加密
hostname Catalyst 3550-12T1 //给三层交换机定义名称
Cisco路由器配置实例(经典)
实训报告实训一路由基本配置1、实验目的:路由器基本配置及ip设置2、拓扑结构图Router0 fa0/0: 192.168.11.1Fa0/1:192.168.1.1Router1 fa0/0: 192.168.11.2Fa0/1:192.168.2.1Znn1:192.168.1.2Znn2:192.168.2.23、实验步骤Router1Router>en 用户模式进入特权模式Router#conf t 特权模式进入全局模式Enter configuration commands, one per line. End with CNTL/Z.Router(config)#host rznn1 改名字为rznn1rznn1(config)#int fa0/0 进入fa0/0端口rznn1(config-if)#ip add 192.168.11.1 255.255.255.0 设置ip地址rznn1(config-if)#no sh 激活rznn1(config)#int fa0/1rznn1(config-if)#ip add 192.168.1.1 255.255.255.0rznn1(config-if)#no shrznn1(config-if)#exitrznn1(config)#exitrznn1#copy running-config startup-config 保存Destination filename [startup-config]? startup-configrznn1#conf trznn1(config)#enable secret password 222 设置密文rznn1#show ip interface b 显示Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.1 YES manual up up FastEthernet0/1 192.168.1.1 YES manual up upVlan1 unassigned YES manual administratively down downrouter 2outer>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host rznn2rznn2(config)#int fa0/0rznn2(config-if)#ip add 192.168.11.2 255.255.255.0rznn2(config-if)#no shrznn2(config)#int fa0/1rznn2(config-if)#ip add 192.168.2.1 255.255.255.0rznn2(config-if)#no shRznn2#copy running-config startup-config 保存Destination filename [startup-config]? startup-configrznn2(config-if)#exitrznn2(config)#exitrznn2#conf trznn2(config)#enable secret 222rznn2#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.2 YES manual up up FastEthernet0/1 192.168.2.1 YES manual up upVlan1 unassigned YES manual administratively down down实训二1、远程登录、密码设置及验证为路由器开设telnet端口,PC机可以远程登陆到Rznn3(Router 1)拓扑结构图Router0:192.168.1.1Pc:192.168.1.2步骤rznn3>rznn3>enrznn3#conf tEnter configuration commands, one per line. End with CNTL/Z.rznn3(config)#no ip domain lookuprznn3(config)#line cons 0rznn3(config-line)#password znnrznn3(config-line)#loginrznn3(config-line)#no exec-trznn3(config-line)#logg syncrznn3(config-line)#exitrznn3(config)#int fa0/0rznn3(config-if)#ip add 192.168.1.1 255.255.255.0rznn3(config-if)#no shrznn3(config-if)#exitrznn3(config)#line vty 0 4 打通五个端口rznn3(config-line)#password cisco 设置密码rznn3(config-line)#login 保存rznn3(config-line)#exit4、测试:实训三命令组1、目的:八条命令(no ip domain lookup\line cons 0\password\login\no exec-t\logg sync\show version\reload\copy running-config startup-config)\show cdp neighbors)2、拓扑结构图Router0 fa0/0: 192.168.11.1Router1 fa0/0: 192.168.11.23、步骤rznn1#conf tEnter configuration commands, one per line. End with CNTL/Z.1、rznn1(config)#no ip domain lookup 取消域名查找转换2、rznn1(config)#line cons 0 打开cons 0端口3、rznn1(config-line)#password znn 设置密码为znnrznn1(config-line)#login 保存rznn1(config-line)#no exec-t 设置永不超时4、rznn1(config-line)#logg sync 产生日志5、rznn1#show version 显示思科路由系统版本信息Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)Technical Support: /techsupportCopyright (c) 1986-2007 by Cisco Systems, Inc.Compiled Wed 18-Jul-07 06:21 by pt_rel_team6、rznn1#show cdp neighbors 查看路由器连接的相邻路由器的相关信息Capability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDrznn2 Fas 0/0 139 R C2800 Fas 0/07、rznn1#copy running-config startup-config 保存刚才指令Destination filename [startup-config]? startup-configBuilding configuration...[OK]8、rznn1#reload 重启路由器Proceed with reload? [confirm]System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)Copyright (c) 2000 by cisco Systems, Inc.cisco 2811 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memorySelf decompressing the image :########################################################################## [OK] Restricted Rights Legendrznn1#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.1 YES manual up up FastEthernet0/1 192.168.1.1 YES manual up upVlan1 unassigned YES manual administratively down down9、rznn1(config-if)#ip add 192.168.3.1 255.255.255.0 重置ip地址rznn1#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.3.1 YES manual up up FastEthernet0/1 192.168.1.1 YES manual up up Vlan1 unassigned YES manual administratively down down实训四发现协议1、实训目的通过发现协议显示路由器相邻路由的端口信息2、拓扑结构Router0:192.168.11.1Router1:fa0/0 192.168.11.2Fa0/1 192.168.12.1Router2:192.168.12.23、步骤R1路由器Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upr1(config-if)#r1(config-if)#exitr1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.1 YES manual up down FastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downR2 路由器Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r2r2(config)#int fa0/0r2(config-if)#ip add 192.168.11.2 255.255.255.0r2(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r2(config-if)#exitr2(config)#exitr2#%SYS-5-CONFIG_I: Configured from console by consoler2#conf tEnter configuration commands, one per line. End with CNTL/Z.r2(config)#int fa0/0r2(config-if)#int fa0/1r2(config-if)#ip add 192.168.12.1 255.255.255.0r2(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to upr2(config-if)#exitr2(config)#exitr2#%SYS-5-CONFIG_I: Configured from console by consoler2#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.2 YES manual up upFastEthernet0/1 192.168.12.1 YES manual up down Vlan1 unassigned YES manual administratively down downR3路由器Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r3r3(config)#int fa0/0r3(config-if)#ip add 192.168.12.2 255.255.255.0r3(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r3(config-if)#exitr3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by consoler3#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.12.2 YES manual up up FastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downR1发现邻居r1#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDr2 Fas 0/0 165 R C2800 Fas 0/0R2发现邻居r2#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDr1 Fas 0/0 176 R C1841 Fas 0/0r3 Fas 0/1 130 R C1841 Fas 0/0R3发现邻居r3#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDr2 Fas 0/0 166 R C2800 Fas 0/14、总结show 命令(1)show ip interface b (显示端口ip信息)(2)show version (显示ios版本信息)(3)show running-config (显示刚才使用的命令配置信息)(4)show cdp neighbors (显示发现邻居直连设备信息)(5)show interface (显示所有端口详细信息)实训五静态路由1、实验目的:将不同网段的网络配通(ip route)Ip route语法:ip route 目标地址子网掩码相邻路由器接口地址Show ip route2、试验拓扑:Router0:192.168.11.1Router1:fa0/0 192.168.11.2Fa0/1 192.168.12.1Router2:192.168.12.23、实验步骤:Router1Router>enRouter#conf tRouter(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upr1(config-if)#exitr1(config)#exitr1#show ip interface bInterface IP-Address OK? Method Status ProtocolFastEthernet0/0 192.168.11.1 YES manual up downFastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downr1#%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r1#ping 192.168.12.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:.....Success rate is 0 percent (0/5)r1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#ip route 192.168.12.0 255.255.255.0 192.168.11.2r1(config)#exitr1#ping 192.168.12.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 msr1#ping 192.168.12.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:.....Success rate is 0 percent (0/5)r1#ping 192.168.12.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 47/62/78 msr1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.11.0/24 is directly connected, FastEthernet0/0S 192.168.12.0/24 [1/0] via 192.168.11.2Router3Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r3r3(config)#int fa0/0r3(config-if)#ip add 192.168.12.2 255.255.255.0r3(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r3(config-if)#exitr3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by consoler3#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.12.2 YES manual up up FastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downr3#conf tEnter configuration commands, one per line. End with CNTL/Z.r3(config)#ip route 192.168.11.0 255.255.255.0 192.168.12.1r3(config)#exitr3#ping 192.168.11.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.2, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 msr3#ping 192.168.11.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 msr3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setS 192.168.11.0/24 [1/0] via 192.168.12.1C 192.168.12.0/24 is directly connected, FastEthernet0/04、默认路由Route 1r1>enr1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#no ip route 192.168.12.0 255.255.255.0 192.168.11.2%No matching route to deleter1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.11.0/24 is directly connected, FastEthernet0/0r1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.2r1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.11.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, FastEthernet0/0S* 0.0.0.0/0 [1/0] via 192.168.11.2r1#ping 192.168.12.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 16/28/31 msr1#ping 192.168.12.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 msRoute 3r1>enr1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#no ip route 192.168.12.0 255.255.255.0 192.168.11.2%No matching route to deleter1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.11.0/24 is directly connected, FastEthernet0/0r1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.2r1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.11.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, FastEthernet0/0S* 0.0.0.0/0 [1/0] via 192.168.11.2r3#ping 192.168.11.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms实训六动态路由RIP 协议1、实验目的使用配置动态路由启动Rip协议使用到的命令(router rip/network/show ip protocols/show ip route)2、实验拓扑R1 fa0/0 192.168.11.1R2 fa0/0 192.168.11.2fa0/1 192.168.12.1R3 fa0/0 192.168.12.23、实验步骤R1Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no shr1(config-if)#exitr1(config)#router ripr1(config-router)#network 192.168.11.0r1(config-router)#exitr1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoleR2Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host r2r2(config)#int fa0/0r2(config-if)#ip add 192.168.11.2 255.255.255.0r2(config-if)#no shr2(config-if)#exitr2(config)#int fa0/1r2(config-if)#ip add 192.168.12.1 255.255.255.0r2(config-if)#no shr2(config-if)#exitr2(config)#router ripr2(config-router)#network 192.168.11.0r2(config-router)#network 192.168.12.0r2(config-router)#exitr2(config)#exitr2#R3Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host r3r3(config)#int fa0/0r3(config-if)#ip add 192.168.12.2 255.255.255.0r3(config-if)#no shr3(config-if)#exitr3(config)#router ripr3(config-router)#network 192.168.12.0r3(config-router)#exitr3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by console4、实验测试R1r1#show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 10 secondsInvalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not set Redistributing: ripDefault version control: send version 1, receive any version Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 1 2 1Automatic network summarization is in effectMaximum path: 4Routing for Networks:192.168.11.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)r1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.11.0/24 is directly connected, FastEthernet0/0R 192.168.12.0/24 [120/1] via 192.168.11.2, 00:00:24, FastEthernet0/0 r1#ping 192.168.12.0Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.0, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 msR2r2#show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 21 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chain FastEthernet0/0 1 2 1FastEthernet0/1 1 2 1Automatic network summarization is in effectMaximum path: 4Routing for Networks:192.168.11.0192.168.12.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)r2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.11.0/24 is directly connected, FastEthernet0/0C 192.168.12.0/24 is directly connected, FastEthernet0/1R3r3#show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 15 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chain FastEthernet0/0 1 2 1Automatic network summarization is in effectMaximum path: 4Routing for Networks:192.168.12.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)r3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setR 192.168.11.0/24 [120/1] via 192.168.12.1, 00:00:04, FastEthernet0/0 C 192.168.12.0/24 is directly connected, FastEthernet0/0r3#ping 192.168.11.0Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.0, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms实训七负载平衡试训目的实现负载平衡实训拓扑R1 fa0/0 192.168.11.1R2 eth0/0/0 192.168.11.2Fa0/0 192.168.12.1Fa0/0 192.168.13.1R3 fa0/0 192.168.12.2Fa0/1 192.168.14.1R4 fa0/0 192.168.13.2Fa0/1 192.168.15.1R5 fa0/0 192.168.14.2Fa0/1 192.168.15.2实训步骤(R1 )r1>enR1#conf tR1(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.2R1(config)#exitr1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.11.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, FastEthernet0/0S* 0.0.0.0/0 [1/0] via 192.168.11.2(R2)r2>enr2(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2r2(config)#ip route 0.0.0.0 0.0.0.0 192.168.13.2r2(config)#exitr2#%SYS-5-CONFIG_I: Configured from console by consoles% Ambiguous command: "s"r2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.12.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, Ethernet0/0/0C 192.168.12.0/24 is directly connected, FastEthernet0/0C 192.168.13.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.12.2[1/0] via 192.168.13.2(R3)r3>enr3#conf tEnter configuration commands, one per line. End with CNTL/Z.r3(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.1r3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by consoler3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.12.1 to network 0.0.0.0C 192.168.12.0/24 is directly connected, FastEthernet0/0C 192.168.14.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.12.1(R4)r4>enr4#conf tEnter configuration commands, one per line. End with CNTL/Z.r4(config)#ip route 0.0.0.0 0.0.0.0 192.168.13.1r4(config)#exitr4#%SYS-5-CONFIG_I: Configured from console by consoler4#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.13.1 to network 0.0.0.0C 192.168.13.0/24 is directly connected, FastEthernet0/0C 192.168.15.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.13.1(R5)r5>enr5#conf tEnter configuration commands, one per line. End with CNTL/Z.r5(config)#ip route 0.0.0.0 0.0.0.0 192.168.14.1r5(config)#ip route 0.0.0.0 0.0.0.0 192.168.15.1r5(config)#exitr5#%SYS-5-CONFIG_I: Configured from console by consoler5#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.14.1 to network 0.0.0.0C 192.168.14.0/24 is directly connected, FastEthernet0/0C 192.168.15.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.14.1[1/0] via 192.168.15.1实训测试(R1)r1#ping 192.168.14.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.14.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 62/84/94 ms (R5)r5#ping 192.168.11.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 79/91/94 ms实训八DHCP 协议配置实训目的全网配通实训拓扑Fa0/0 192.168.11.1Fa0/1 192.168.12.1实训步骤Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no shr1(config-if)#exitr1(config)#int fa0/1r1(config-if)#ip add 192.168.12.1 255.255.255.0r1(config-if)#no shr1(config-if)#exitr1(config)#ip dhcp pool znn //配置一个根地址池znnr1(dhcp-config)#network 192.168.11.0 255.255.255.0 //为所有客户机动态分配的地址段r1(dhcp-config)#default-router 192.168.11.1 //为客户机配置默认的网关r1(dhcp-config)#dns-server 192.168.11.1 //为客户机配置DNS服务器r1(dhcp-config)#exitr1(config)#ip dhcp pool znn1r1(dhcp-config)#network 192.168.12.0 255.255.255.0r1(dhcp-config)#default-router 192.168.12.1r1(dhcp-config)#dns-server 192.168.12.1r1(dhcp-config)#exit。
cisco配置实验报告
cisco配置实验报告Cisco配置实验报告1. 实验目的本次实验旨在通过配置Cisco网络设备,实现局域网内主机之间的互联及互访。
通过此实验,我们将深入了解Cisco设备的配置和管理,提高网络管理技能。
2. 实验环境本次实验使用的设备为Cisco Catalyst 2960交换机和Cisco 2811路由器。
交换机用于构建局域网,路由器用于实现不同局域网之间的互联。
3. 实验步骤3.1 网络拓扑规划根据实验要求,我们设计了以下网络拓扑结构:一个核心交换机连接多个分支交换机,每个分支交换机连接多台主机。
核心交换机通过路由器与其他局域网相连。
3.2 配置交换机首先,我们登录到核心交换机的管理界面。
使用默认用户名和密码登录后,我们进入交换机的命令行界面。
3.2.1 VLAN配置为了实现不同局域网之间的隔离,我们需要配置不同的VLAN。
通过以下命令,我们创建了两个VLAN,分别为VLAN 10和VLAN 20:```vlan 10name VLAN10vlan 20name VLAN20```3.2.2 端口配置接下来,我们需要将交换机的端口划分到不同的VLAN中。
通过以下命令,我们将端口1-10划分到VLAN 10,端口11-20划分到VLAN 20:```interface range fastEthernet 0/1-10switchport mode accessswitchport access vlan 10interface range fastEthernet 0/11-20switchport mode accessswitchport access vlan 20```3.3 配置路由器在路由器上,我们需要配置静态路由,将不同局域网之间的流量进行转发。
3.3.1 接口配置首先,我们配置路由器的接口。
通过以下命令,我们将路由器的Fa0/0接口配置为与核心交换机相连的接口:```interface fastEthernet 0/0ip address 192.168.1.1 255.255.255.0```3.3.2 静态路由配置接着,我们配置静态路由,实现不同局域网之间的互通。
CiscoSG300系列交换机划分VLan与普通路由器连接配置
CiscoSG300系列交换机划分VLan与普通路由器连接配置思科SG300系列三层交换机是针对中⼩企业设计的⼀款产品,Marvell 主控和128M Ram,最⼤⽀持52个千兆RJ45端⼝和2个SFP端⼝,因公司业务需求,最近也进⾏了解和配置,具体型号为 SG300 – 52 记录下过程,便于参考.⽹络拓扑图如下所⽰:计划⽬标:针对不同部门划分不同的VLAN,前期满⾜能够同时上⽹的需求,后期需要能够隔离不同部门的资源访问(本次配置操作不涉及)。
因之前未接触CISCO交换机,在参考了⽹上众多配置后,发现该交换机部分命令和服务并不⽀持,⽐如DHCP Server 。
所以配置过程以Console 为主,Web界⾯为辅的⽅式进⾏。
配置过程:1.更改交换机⼯作模式交换机⾃⾝带有Web界⾯,英⽂版,不熟悉的可以通过官⽅下载固件版本对应的中⽂语⾔包进⾏切换,默认IP地址 192.168.1.254 ⽤户名密码均为cisco ⾸次登陆后需要修改密码,在管理中将⼯作模式更改为三层模式,然后重启。
2.为交换机划分VLAN交换机默认所有端⼝均属于VLAN1,分别建⽴ vlan 10 , vlan 20 , vlan 30 。
在WEB界⾯中可以直接配置,但实际操作却发现点击确定提交后,⽹络会断开,最后还是得以Console 串⼝线配置。
命令如下:# conf t //进⼊配置模式# vlan 10# vlan 20# vlan 30 //分别创建3个VLAN# exit //退出配置.3.配置基于端⼝的VLAN (Port to VLAN),即多个端⼝同属于⼀个VLAN,以便直接接⼊PC.规划⽰例:VLAN 标⽰物理端⼝ VLAN⽹关vlan 10 gi2-10 192.168.1.1vlan 20 gi11-30 192.168.2.1vlan 30 gi31-52 192.168.3.1先给每个Vlan 指定⽹关IP.命令如下# interface vlan 10# ip address 192.168.1.1 255.255.255.0# exit# interface vlan 20# ip address 192.168.2.1 255.255.255.0# exit# interface vlan 30# ip address 192.168.3.1 255.255.255.0# exit指定物理端⼝范围,并加⼊到对应Vlan# interface range gi2-10 //指定vlan 10 端⼝范围, gi 为物理端⼝号# switchport mode access //指定端⼝⼯作模式,连接PC为 access# switchport access vlan 10 //将指定端⼝划分为 vlan 10# exit# interface range gi11-20# switchport mode access# switchport access vlan 20# exit# interface range gi21-52# switchport mode access# switchport access vlan 30# exit为交换机默认的vlan1 添加⽹关,⽤于连接路由器(前⾯的操作并未指定gi1 端⼝,默认它属于vlan 1 )# interface vlan 1# ip address 192.168.0.2 255.255.255.0# exit添加⼀条默认路由规则,指向路由器IP 192.168.0.1# conf t# ip route 0.0.0.0 0.0.0.0 192.168.0.1# exit将当前配置的运⾏参数写⼊到启动配置⽂件中# copy running-config startup-config完成后分别在 VLAN 10,20,30 对应的端⼝连接上PC,并配置⽹卡IP地址 192.168.1.x/2.x/3.x ⽹关为 192.168.1.1/2.1/3.1 能够ping通对⽅IP和vlan ⽹关即表⽰成功.普通路由器的配置.常⽤的路由器TP-link,磊科,腾达,都可以配置静态路由,分别添加3条规则并指向三层交换机默认vlan1 所配置的⽹关,有ARP攻击防御和内⽹病毒防御功能的需要关闭。
实验七 多网段网络组建与动态路由配置
实验七多网段网络组建与动态路由配置一、实验内容与要求1、理解RIP动态路由原理,练习动态路由配置;2、掌握对路由器有关状态获取和分析的方法;3、按照拓扑图构建一个小型的局域网,配置设备;4、完成连通性和包传输路径基本测试。
二、实验设备或仪器两台2620XM路由器,三台PC机,一台2950-24交换机,一台HUB-PT集线器,DCE/DTE Cable一条,伊通县四根、反转线一条三、实验原理动态路由协议可以允许网络快速的更新和适应于变化,大多数网络采用动态路由,因为它能使网络自动适应变化;其缺点是会增加网络的开销。
本实验将使用RIP作为路由选择协议,RIP设计用于工作在中等大小的局域网中,并不适应与更复杂的环境。
RIP经过若干年的发展,从一个有路由选择协议RIP版本1改进到了无路由选择协议RIP版本2,RIP2除了具有RIPV2的所有功能外,还具有以下增强特性:支持身份验证、支持无类别子网掩码、使用路由标记、使用D类地址244.0.0.9组播传送路由选择更新信息。
四、实验内容与步骤本次实验的拓扑图与配置参数表如下:图6.1 实验参考拓扑图1.1、先进入全局配置模式,执行命令“erase startup-config”,清除缓存的配置文件;使用“reload”命令重启路由器:Router>enRouter#erase startup-configErasing the nvram filesystem will remove all configuration files! Continue? [confirm][OK]Erase of nvram: complete%SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvramRouter#reloadProceed with reload? [confirm]%SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command.System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)Copyright (c) 2000 by cisco Systems, Inc.cisco 2620 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memorySelf decompressing the image :########################################################################## [OK] 两台路由器分别配置名字为Router1和Router2。
思科交换机NAT配置介绍及实例
思科交换机NAT配置介绍及实例思科交换机(Cisco Switch)是企业级网络设备中最常用的一种。
与传统的路由器不同,交换机主要用于在局域网(LAN)内部提供数据包的转发和过滤功能。
然而,在一些情况下,我们可能需要使用交换机进行网络地址转换(NAT)来实现特定的网络部署需求。
本文将介绍思科交换机的NAT配置方法,并提供实例说明。
1.NAT概述网络地址转换(NAT)是一种在不同网络之间转换IP地址的技术。
它主要用于解决IPv4地址空间的短缺问题,并允许多个主机通过一个公网IP地址来访问互联网。
NAT实现了将内部网络地址与外部IP地址之间进行映射,使得内部主机可以通过共享公网IP地址来与外部网络进行通信。
2.NAT配置方法在思科交换机上配置NAT通常涉及以下步骤:步骤1:创建访问控制列表(ACL)访问控制列表(Access Control List)用于定义需要进行NAT转换的数据包。
我们可以根据源地址、目标地址、端口等条件来配置ACL,以确定哪些数据包需要进行NAT转换。
例如,下面是一条配置ACL的命令示例:access-list 10 permit 192.168.1.0 0.0.0.255该命令表示允许192.168.1.0/24网段的内部主机进行NAT转换。
步骤2:创建NAT池NAT池用于定义可以被映射到的公网IP地址范围。
我们可以通过配置交换机的外部接口和NAT池来设置NAT转换的目标IP地址。
例如,下面是一条配置NAT池的命令示例:ip nat pool NAT_POOL 203.0.113.1 203.0.113.10 netmask255.255.255.0该命令表示创建一个名为NAT_POOL的NAT池,其中可用的IP地址范围为203.0.113.1至203.0.113.10。
步骤3:创建NAT规则NAT规则用于将内部网络的私有IP地址映射到NAT池的公网IP地址。
我们可以通过配置NAT类型(静态/动态)、内部地址、外部地址等参数来创建NAT规则。
Cisco 3750交换机VLan配置
Cisco 3750交换机配置DHCP服务器实例网络环境:一台3750交换机,划分三个vlan, vlan2 为服务器所在网络,命名为server,IP地址段为192.168.2.0,子网掩码:255.255.255.0,网关:192.168.2.1,域服务器为windows 2003 advance server,同时兼作DNS服务器,IP地址为192.168.2.10,vlan3为客户机1所在网络,IP地址段为192.168.3.0,子网掩码:255.255.255.0,网关:192.168.3.1命名为work01,vlan4为客户机2所在网络,命名为work02,IP地址段为192.168.4.0,子网掩码:255.255.255.0,网关:192.168.4.1,3750作DHCP服务器,端口1-8划到VLAN 2,端口9-16划分到VLAN 3,端口17-24划分到VLAN 4.DHCP服务器实现功能:各VLAN保留2-10的IP地址不分配置,例如:192.168.2.0的网段,保留192.168.2.2至192.168.2.10的IP地址段不分配.安全要求:VLAN 3和VLAN 4 不允许互相访问,但都可以访问服务器所在的VLAN 2,默认访问控制列表的规则是拒绝所有包。
配置命令及步骤如下:第一步:创建VLAN:Switch>enSwitch#Vlan DatabaseSwitch(Vlan)>Vlan 2 Name serverSwitch(Vlan)>Vlan 3 Name work01Switch(vlan)>Vlan 4 Name work02第二步:设置VLAN IP地址:Switch#Config TSwitch(Config)>Int Vlan 2Switch(Config-vlan)Ip Address 192.168.2.1 255.255.255.0Switch(Config-vlan)No ShutSwitch(Config-vlan)>Int Vlan 3Switch(Config-vlan)Ip Address 192.168.3.1 255.255.255.0Switch(Config-vlan)No ShutSwitch(Config-vlan)>Int Vlan 4Switch(Config-vlan)Ip Address 192.168.4.1 255.255.255.0Switch(Config-vlan)No ShutSwitch(Config-vlan)Exit/*注意:由于此时没有将端口分配置到VLAN2,3,4,所以各VLAN会DOWN掉,待将端口分配到各VLAN后,VLAN会起来*/第三步:设置端口全局参数Switch(Config)Interface Range Fa 0/1 - 24Switch(Config-if-range)Switchport Mode AccessSwitch(Config-if-range)Spanning-tree Portfast第四步:将端口添加到VLAN2,3,4中/*将端口1-8添加到VLAN 2*/Switch(Config)Interface Range Fa 0/1 - 8Switch(Config-if-range)Switchport Access Vlan 2/*将端口9-16添加到VLAN 3*/Switch(Config)Interface Range Fa 0/9 - 16Switch(Config-if-range)Switchport Access Vlan 3/*将端口17-24添加到VLAN 4*/Switch(Config)Interface Range Fa 0/17 - 24Switch(Config-if-range)Switchport Access Vlan 4Switch(Config-if-range)Exit/*经过这一步后,各VLAN会起来*/第五步:配置3750作为DHCP服务器/*VLAN 2可用地址池和相应参数的配置,有几个VLAN要设几个地址池*/ Switch(Config)Ip Dhcp Pool Test01/*设置可分配的子网*/Switch(Config-pool)Network 192.168.2.0 255.255.255.0/*设置DNS服务器*/Switch(Config-pool)Dns-server 192.168.2.10/*设置该子网的网关*/Switch(Config-pool)Default-router 192.168.2.1/*配置VLAN 3所用的地址池和相应参数*/Switch(Config)Ip Dhcp Pool Test02Switch(Config-pool)Network 192.168.3.0 255.255.255.0Switch(Config-pool)Dns-server 192.168.2.10Switch(Config-pool)Default-router 192.168.3.1/*配置VLAN 4所用的地址池和相应参数*/Switch(Config)Ip Dhcp Pool Test03Switch(Config-pool)Network 192.168.4.0 255.255.255.0Switch(Config-pool)Dns-server 192.168.2.10Switch(Config-pool)Default-router 192.168.4.1第六步:设置DHCP保留不分配的地址Switch(Config)Ip Dhcp Excluded-address 192.168.2.2 192.168.2.10Switch(Config)Ip Dhcp Excluded-address 192.168.3.2 192.168.3.10Switch(Config)Ip Dhcp Excluded-address 192.168.4.2 192.168.4.10第七步:启用路由/*路由启用后,各VLAN间主机可互相访问*/Switch(Config)Ip Routing第八步:配置访问控制列表Switch(Config)access-list 103 permit ip 192.168.2.0 0.0.0.255 192.168.3.0 0.0.0.255 Switch(Config)access-list 103 permit ip 192.168.3.0 0.0.0.255 192.168.2.0 0.0.0.255 Switch(Config)access-list 103 permit udp any any eq bootpcSwitch(Config)access-list 103 permit udp any any eq tftpSwitch(Config)access-list 103 permit udp any eq bootpc anySwitch(Config)access-list 103 permit udp any eq tftp anySwitch(Config)access-list 104 permit ip 192.168.2.0 0.0.0.255 192.168.4.0 0.0.0.255 Switch(Config)access-list 104 permit ip 192.168.4.0 0.0.0.255 192.168.2.0 0.0.0.255 Switch(Config)access-list 104 permit udp any eq tftp anySwitch(Config)access-list 104 permit udp any eq bootpc anySwitch(Config)access-list 104 permit udp any eq bootpc anySwitch(Config)access-list 104 permit udp any eq tftp any第九步:应用访问控制列表/*将访问控制列表应用到VLAN 3和VLAN 4,VLAN 2不需要*/Switch(Config)Int Vlan 3Switch(Config-vlan)ip access-group 103 outSwitch(Config-vlan)Int Vlan 4Switch(Config-vlan)ip access-group 104 out第十步:结束并保存配置Switch(Config-vlan)EndSwitch#write memory。
2024版使用Cisco路由器配置PPTP
使用Cisco路由器配置PPTP•引言•Cisco路由器基础知识•PPTP协议原理及特点•使用Cisco路由器配置PPTP步骤详解目•常见问题排查与解决方法•总结与展望录01引言目的和背景了解PPTP协议及其工作原理掌握在Cisco路由器上配置PPTP的方法实现远程访问和VPN连接01020304介绍PPTP协议Cisco路由器PPTP配置步骤配置实例及验证方法常见问题及解决方案PPT内容概述02Cisco路由器基础知识Cisco路由器是网络设备的一种,用于连接不同网络或网段,实现数据包的转发和路由选择。
Cisco作为全球知名的网络设备制造商,其路由器产品在市场上占据重要地位,具有高性能、稳定性和可靠性等特点。
Cisco路由器广泛应用于企业、政府机构、教育机构等场景,提供安全、高效的网络连接解决方案。
010203 Cisco路由器简介路由器工作原理路由器是工作在OSI模型第三层(网络层)的设备,通过路由表进行数据包转发。
当数据包到达路由器时,路由器会解析数据包中的目的IP地址,并根据路由表信息进行路由选择,将数据包转发到相应的下一跳地址。
路由器之间通过路由协议(如OSPF、BGP等)进行路由信息的交换和学习,构建和维护路由表。
1 2 3Cisco路由器型号众多,包括固定配置路由器(如Cisco 1900系列)和模块化路由器(如Cisco 2900系列、4000系列等)。
不同型号的Cisco路由器具有不同的性能特点,如吞吐量、端口密度、扩展能力等。
在选择Cisco路由器时,需要根据实际需求和应用场景进行评估和选择,以满足网络建设的需要。
Cisco路由器型号与性能03PPTP协议原理及特点PPTP(Point-to-Point Tunneling Protocol)是一种网络协议,主要用于实现虚拟私人网络(VPN)连接。
PPTP通过在公共网络上建立一个加密的隧道,使得远程用户能够安全地访问企业内部网络资源。
Cisco三层交换机配置DHCP解决方案
器解释...)
lease 3 //地址租用期限: 3天
ip dhcp pool vlan1
network 10.1.1.0 255.255.255.0 //本pool是global的子pool, 将从global pool继承domain-name等
option
default-router 10.1.1.100 10.1.1.101 //为客户机配置默认网关
第四步:将端口添加到VLAN2,3,4中
/*将端口1-8添加到VLAN 2*/
Switch(Config)Interface Range Fa 0/1 - 8
Switch(Config-if-range)Switchport Access Vlan 2
/*将端口9-16添加到VLAN 3*/
Switch(Config)Ip Dhcp Excluded-address 192.168.3.2 192.168.3.10
Switch(Config)Ip Dhcp Excluded-address 192.168.4.2 192.168.4.10
第七步:启用路由
/*路由启用后,各VLAN间主机可互相访问*/
host 10.1.1.21 255.255.255.0
client-identifier 010050.bade.6384 //client-identifier=01加上客户机网卡地址
!
ip dhcp pool vlan1_tom
host 10.1.1.50 255.255.255.0
debug ip dhcp server {events | packets | linkage} //观察DHCP服务器工作情况
cisco设置方法步骤
cisco设置方法步骤思科(Cisco)路由器是一个集成多业务路由器,福利综合服务网络路由器,以及获得回报的网络路由器。
cisco路由器怎么设置??有网友提到自己不会设置思科的设备,该怎么办?店铺在网上找了一些教程及命令,需要的朋友可以参考下。
以下是cisco路由器设置具体命令一、 host到router1、实验网络拓扑:pc( client 4.01)---switch---router1720 ( access server)pc配置:ip:10.130.23.242/28gw:10.130.23.2461720接口ip:f0:10.130.23.246/28lo0:172.16.1.1/241720的ios为c1700-k93sy7-mz.122-8.T5.bin2、步骤:1、配置isakmp policy:crypto isakmp policy 1encr 3desauthen pre-sharegroup 22、配置 client地址池cry isa client conf address-pool local pool192ip local pool pool192 192.168.1.1 192.168.1.2543、配置 client有关参数cry isa client conf group vclient-group####vclient-group就是在client的连接配置中需要输入的group authentication name。
key vclient-key####vclient-key就是在client的连接配置中需要输入的group authentication password。
pool pool192 ####client的ip地址从这里选取####以上两个参数必须配置,其他参数还包括domain、dns、wins等,根据情况进行配置。
4、配置ipsec transform-setcry ipsec trans vclient-tfs esp-3des esp-sha-hmac5、配置map模板cry dynamic-map template-map 1set transform-set vclient-tfs ####和第四步对应6、配置mapcry map map 1 ipsec-isakmp dynamic template-map#### 使用第?*脚渲玫?map 模板cry map map isakmp author list vclient-group ####使用第三步配置的参数authorizationcry map map client conf address respond ####响应client分配地址的请求7、配置静态路由ip route 192.168.1.0 255.255.255.0 fastethernet03、说明几点:(1)因为1720只有一个fastethernet口,所以用router1720上的lo0地址来模拟router内部网络。
