飞鱼星路由器下接三层交换机配置文档
路由器和三层交换机互通配置

例如:路由器内网IP为192.168.0.1交换机端vlan ip段192.168.1.0---192.168.2.0路由器段配置:添加一条静态路由,网段为192.168.0.0 掩码为255.255.0.0 目的网关:192.168.0.254核心交换机配置:ip route-static 0.0.0.0 0 192.168.1.254路由器内部为地址:192.168.1.2541、路由器的配置:interface FastEthernet0/0ip address 10.212.80.90 255.255.255.0ip nat outsideduplex autospeed autointerface FastEthernet0/1ip address 192.168.1.254 255.255.255.0ip nat insideduplex autospeed autoip nat inside source list 1 interface FastEthernet0/0 overloadip classlessip route 192.168.1.0 255.255.255.0 192.168.1.1ip route 192.168.2.0 255.255.255.0 192.168.1.1access-list 1 permit 192.168.0.0 0.0.255.255ip route 0.0.0.0 0.0.0.0 192.168.1.254环境描述:使用设备为Cisco2621XM + NE-1E模块,该配置拥有两个FastEthernet及一个Ethernet端口。
现使用Ethernet 1/0 端口连接内部局域网,模拟内部拥有100.100.23.0 255.255.0.0 与100.100.24.0 255.255.0.0 两组客户机情况下基于原地址的策略路由。
Fastethernet 0/0 模拟第一个ISP接入端口,Fastethernet 0/1模拟第二个ISP接入端口,地址分别为 Fastethernet 0/0 的ip地址192.168.1.2 255.255.255.0 对端ISP地址192.168.1.1 255.255.255.0Fastethernet 0/1 的ip地址192.168.2.2 255.255.255.0 对端ISP地址192.168.2.1255.255.255.0通过策略路由后对不同原地址数据流量进行分流,使得不同原地址主机通过不同ISP接口访问Internet,并为不同原地址主机同不同NAT地址进行转换。
三层交换机与路由器对接上网教程

三层交换机与路由器对接上网教程交换机作为网关,实现跨网段转发。
同时作为DHCP服务器分配IP。
路由器做NAT转换,使用户可以上外网。
下面是小编带来的配置过程:1、配置连接用户的接口和对应的VLANIF接口system-view[Huawei]vlanbatch23[Huawei]interfaceg0/0/2[Huawei-GigabitEther0/0/2]portlink-typeaccess[Huawei-GigabitEther0/0/2]portdefaultvlan2[Huawei-GigabitEther0/0/2]quit[Huawei]intg0/0/3[Huawei-GigabitEther0/0/3]portlink-typeaccess[Huawei-GigabitEther0/0/3]portdefaultvlan3[Huawei-GigabitEther0/0/3]q[Huawei]intVlanif2[Huawei-Vlanif2]ipaddress192.168.1.124[Huawei-Vlanif2]quit[Huawei]intvlanif3[Huawei-Vlanif3]ipaddress192.168.2.124[Huawei-Vlanif3]quit2、配置连接路由器的接口和对应的VLANIF接口[Huawei]vlan100[Huawei-vlan100]intg0/0/1[Huawei-GigabitEther0/0/1]portlink-typeaccess[Huawei-port-group-default]portdefaultvlan100[Huawei-port-group-default]quit[Huawei]intVlanif100[Huawei-Vlanif100]ipaddress192.168.100.224[Huawei-Vlanif100]quit3、配置缺省路由(下一跳地址为路由器内网口地址)[Huawei]iproute-static0.0.0.00.0.0.0192.168.100.14、配置DHCP服务[Huawei]dhcpenable[Huawei][Huawei]intvlanif2[Huawei-Vlanif2]dhcpselectinterface[Huawei-Vlanif2]dhcpserverdns-list202.102.128.68114.114.114.114[Huawei-Vlanif2]quit[Huawei]intvlanif3[Huawei-Vlanif3]dhcpselectinterface[Huawei-Vlanif3]dhcpserverdns-list202.102.128.68114.114.114.114[Huawei-Vlanif3]quit1、配置连接交换机的接口对应的IP地址sys[Huawei]intg0/0/1[Huawei-GigabitEther0/0/1]ipaddress192.168.100.124[Huawei-GigabitEther0/0/1]quit2、配置连接公网的接口对应的IP地址[Huawei]intg0/0/2[Huawei-GigabitEther0/0/2]ipaddress222.134.95.5830[Huawei-GigabitEther0/0/2]q3、配置缺省路由和回程路由(路由器访问内网段192.168.0.0,接口为连接路由器的VLANIF地址)[Huawei]iproute-static0.0.0.00.0.0.0222.134.95.57[Huawei]iproute-static192.168.0.0255.255.0.0192.168.100.24、配置NAT转换[Huawei]aclnumber2001[Huawei-acl-basic-2001]rule5permitsource192.168.0.00.0.255.255 [Huawei-acl-basic-2001]quit[Huawei]intg0/0/2[Huawei-GigabitEther0/0/2]natoutbound2001 [Huawei-GigabitEther0/0/2]quit。
三层交换机详细配置实例(图)

三层交换机与路由器的配置实例(图解)目的:学会使用三层交换与路由器让处于不同网段的网络相互通信实验步骤:一:二层交换机的配置:在三个二层交换机上分别划出两VLAN,并将二层交换机上与三层交换或路由器上的接线设置为trunk接口二:三层交换机的配置:1:首先在三层交换上划出两个VLAN,并进入VLAN为其配置IP,此IP将作为与他相连PC 的网关。
2:将与二层交换机相连的线同样设置为trunk接线,并将三层交换与路由器连接的线设置为路由接口(no switchsport)3:将路由器和下面的交换机进行单臂路由的配置实验最终结果:拓扑图下各个PC均能相互通信交换机的配置命令:SW 0:Switch>Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#int f0/2Switch(config-if)#switchport access vlan 2Switch(config-if)#no shutSwitch(config-if)#int f0/3Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to upSwitch(config-if)#exitSwitch(config)#SW 1:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/2Switch(config-if)#switchport access vlan 2% Access VLAN does not exist. Creating vlan 2Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to upSwitch(config-if)#SW 2:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/2Switch(config-if)#switchport access vlan 2% Access VLAN does not exist. Creating vlan 2Switch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport mode trunkSwitch(config-if)#三层交换的配置命令:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/1Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to downSwitch(config-if)#exitSwitch(config)#int f0/2Switch(config-if)#switchport mode trunkSwitch(config-if)#exitSwitch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#int vlan 1Switch(config-if)#no shut%LINK-5-CHANGED: Interface Vlan1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up Switch(config-if)#ip address 192.168.1.168 255.255.255.0Switch(config-if)#exitSwitch(config)#int vlan 2%LINK-5-CHANGED: Interface Vlan2, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to upSwitch(config-if)#ip addSwitch(config-if)#ip address 192.168.2.168 255.255.255.0Switch(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/3, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to upSwitch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to upSwitch(config-if)#Switch(config-if)#ip address 192.168.10.1 255.255.255.0Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#ip routingSwitch(config-if)#exitSwitch(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2Switch(config)#路由器的配置:Router>enRouter#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#int f0/0Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upRouter(config-if)#exitRouter(config)#int f0/1Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upRouter(config-if)#exitRouter(config)#int f0/0Router(config-if)#no shutRouter(config-if)#exitRouter(config)#int f0/0.1Router(config-subif)#encapsulation dot1Q 1Router(config-subif)#ip address 192.168.3.168 255.255.255.0Router(config-subif)#exitRouter(config)#int f0/0.2Router(config-subif)#encapsulation dot1Q 2Router(config-subif)#ip addRouter(config-subif)#ip address 192.168.4.168 255.255.255.0Router(config-subif)#exitRouter(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.1Router(config)#exit%SYS-5-CONFIG_I: Configured from console by consoleRouter#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#int f0/1Router(config-if)#ip addRouter(config-if)#ip address 192.168.10.2 255.255.255.0 Router(config-if)#。
三层交换机配置教程

三层交换机配置教程三层交换机是一种具有路由功能的交换机,可以实现不同网段之间的互联。
下面是三层交换机配置教程:1. 连接三层交换机:首先,将三层交换机与其他设备(如路由器或防火墙)进行连接,可以使用网线将它们连接起来。
确保连接的端口是正确的并且连接松紧适中。
2. 访问三层交换机:使用终端或电脑连接到三层交换机的管理端口。
通常,可以通过SSH或Telnet协议访问交换机的管理接口。
3. 进入交换机的命令行界面:成功连接到三层交换机后,输入正确的用户名和密码,进入交换机的命令行界面。
用户名和密码通常是事先设置好的。
4. 设置主机名:在交换机命令行界面中,使用命令"hostname [名称]"来设置交换机的主机名。
主机名可以是任何你喜欢的名称,但通常建议使用简洁的描述性名称。
5. 配置IP地址:使用命令"interface [接口号]"进入交换机的接口配置模式。
然后,使用"ip address [IP地址] [子网掩码]"命令为每个接口设置IP地址和子网掩码。
确保IP地址和子网掩码与网络规划一致。
6. 启用接口:为了使接口生效,使用"no shutdown"命令启用每个接口。
这将使接口进入工作状态。
7. 配置路由:三层交换机可以实现不同网段之间的路由功能。
为了配置路由,使用"ip route [目标网络] [目标子网掩码] [下一跳地址]"命令。
这将指定该网络的下一跳地址。
可以添加多个路由以实现完整的路由表。
8. 保存配置:确认完成配置后,使用命令"copy running-config startup-config"保存配置。
这将保存当前正在运行的配置为交换机的启动配置,以便在重新启动后仍然有效。
以上就是三层交换机配置的基本步骤。
根据实际需求,还可以进行更复杂的配置,如VLAN划分、安全设置、负载均衡等。
三层交换机与路由器对接上网

第三步:配置缺省路由。
[Switch] ip route-static 0.0.0.0 0.0.0.0 192.168.100.1
HUAWEI TECHNOLOGIES CO., LTD.
Huawei Confidential
3
三层交换机与路由器对接上网
交换机的配置步骤(共4步) 第四步:配置DHCP服务器。 [Switch] dhcp enable
HUAWEI TECHNOLOGIES CO., LTD.
Huawei Confidential 2
三层交换机与路由器对接上网
交换机的配置步骤(共4步) 第二步:配置连接路由器的接口和对应的VLANIF接口。
[Switch] vlan batch 100 [Switch] interface gigabitethernet0/0/1 [Switch-GigabitEthernet0/0/1] port link-type access [Switch-GigabitEthernet0/0/1] port default vlan 100 [Switch-GigabitEthernet0/0/1] quit [Switch] interface vlanif 100 [Switch-Vlanif100] ip address 192.168.100.2 24 [Switch-Vlanif100] quit
Huawei Confidential
5
三层交换机与路由器对接上网
路由器的配置步骤(共4步) 第四步:配置NAT功能。
[Router] acl number 2001 [Router -acl-basic-2001] rule 5 permit source 192.168.0.0 0.0.255.255 [Router -acl-basic-2001] quit [Router] interface gigabitethernet0/0/2 [Router-GigabitEthernet0/0/2] nat outbound 2001 [Router-GigabitEthernet0/0/2] quit
三层交换机与路由器对接上网配置示例

三层交换机与路由器对接上⽹配置⽰例组⽹图形图1 三层交换机与路由器对接上⽹组⽹图三层交换机简介配置注意事项组⽹需求配置思路操作步骤配置⽂件举例适⽤的产品和版本三层交换机简介三层交换机是具有路由功能的交换机,由于路由属于OSI模型中第三层⽹络层的功能,所以称为三层交换机。
三层交换机既可以⼯作在⼆层也可以⼯作在三层,可以部署在接⼊层,也可以部署在汇聚层,作为⽤户的⽹关。
配置注意事项本举例中的路由器配置以AR3600 V200R007C00SPCc00为例,其他路由器的配置⽅法请参见对应的⽂档指南。
本举例中的交换机作为DHCP服务器适⽤的产品和版本请参见。
组⽹需求如所⽰,某公司拥有多个部门且位于不同⽹段,各部门均有访问Internet的需求。
现要求⽤户通过三层交换机和路由器访问外部⽹络,且要求三层交换机作为⽤户的⽹关。
配置思路采⽤如下思路进⾏配置:1. 配置交换机作为⽤户的⽹关,通过VLANIF接⼝,实现跨⽹段⽤户互访。
2. 配置交换机作为DHCP服务器,为⽤户分配IP地址。
3. 配置路由器通过NAT转换,使⽤户可以访问外部⽹络。
操作步骤1. 配置交换机# 配置连接⽤户的接⼝和对应的VLANIF接⼝。
<HUAWEI> system-view[HUAWEI] sysname Switch[Switch] vlan batch 2 3[Switch] interface gigabitethernet 0/0/2[Switch-GigabitEthernet0/0/2] port link-type access//配置接⼝接⼊类型为access[Switch-GigabitEthernet0/0/2] port default vlan 2//配置接⼝加⼊VLAN 2[Switch-GigabitEthernet0/0/2] quit[Switch] interface gigabitethernet 0/0/3[Switch-GigabitEthernet0/0/3] port link-type access[Switch-GigabitEthernet0/0/3] port default vlan 3[Switch-GigabitEthernet0/0/3] quit[Switch] interface vlanif 2[Switch-Vlanif2] ip address 192.168.1.1 24[Switch-Vlanif2] quit[Switch] interface vlanif 3[Switch-Vlanif3] ip address 192.168.2.1 24[Switch-Vlanif3] quit# 配置连接路由器的接⼝和对应的VLANIF接⼝。
三层交换机+路由器

三层交换机:开启路由功能: ip routing定义缺省路由: ip route 0.0.0.0 0.0.0.0 下一跳路由器:f0/0 192.168.0.254 255.255.255.0f1/0 193.1.1.1 255.255.255.252定义0/24号口为trunk路由器:Ip route 0.0.0.0 0.0.0.0 f1/0Ip route 192.168.0.0 255.255.248.0 192.168.0.2添加二层交换机0/23 与三层交换机0/23相连,定义为trunk口Switch(config-if)#switchport mode dynamic desirable主动与对协商成为Trunk接口的可能性,如果邻居接口模式为Trunk/desirable/auto之一,则接口将变成trunk接口工作。
如果不能形成trunk模式,则工作在access模式。
这种模式是现在交换机的默认模式Switch(config-if)#switchport mode trunk定义三层交换机为Vlan databaseVtp domain chzyvtp server定义二层交换机为vtp客户端模式Interface fastethernet 0/23Switch(config-if)#switchport mode trunkVlan databaseVtp domain chzyVtp clientVlan databaseSwitch(config)#interface range f0/1-10Switch(config-if-range)#switchport access vlan 10Switch(config)#interface range f0/11-20Switch(config-if-range)#switchport access vlan 20Switch(config)#interface vlan 1Switch(config-if)#ip address 192.168.0.1 255.255.255.0Switch(config)#ip default-gateway 192.168.0.254RIP路由协议:Router rip 启用RIP路由协议Network 定义所连接的网络(主类网络地址,B类前面两段,C类前面三段)Router#debug ip ripRouter#debug ip rip静态NAT将使用公网地址的机器映射到内部网络上,实现一一映射定义内部接口和外部接口Router(config)#interface f 0/0Router(config-if)#ip nat insideRouter(config-if)#exitRouter(config)#interface f 0/1Router(config-if)#ip nat outsideRouter(config)#ip nat inside source static 192.168.0.1 218.22.229.122Router(config)#ip route 0.0.0.0 0.0.0.0 f0/1静态NAPT实现端口映射ip nat inside source static tcp 192.168.0.3 80 218.22.229.122 80ip nat inside source static tcp 192.168.0.2 21 218.22.229.122 21动态NAPT实现内部私有地址访问外部公有地址,即内部私有地址机器与外部某一个公网地址(路由器接口地址)的某一端口映射Router(config)#interface f 0/0Router(config-if)#ip nat insideRouter(config-if)#exitRouter(config)#interface f 0/1Router(config-if)#ip nat outsideAccess-list 访问列表号permit 内部网络号掩码反码Ip nat pool 地址池名外部地址范围netmask 子网掩码Ip nat inside source list 访问控制列表号pool 地址池名overload(反复复用)或者Ip nat inside source list 访问控制列表号interface 外部接口overloadip route 0.0.0.0 0.0.0.0 FastEthernet1/0ip route 192.168.0.0 255.255.248.0 192.168.0.2ip route 194.1.1.0 255.255.255.0 193.1.1.2access-list 1 permit 192.168.0.0 0.0.7.255Router(config)#ip nat inside source list 1 interface f1/0 overload或者:Router(config)#ip nat pool isp 193.1.1.1 193.1.1.1 netmask 255.255.255.0Router(config)#ip nat inside source list 1 pool isp overload内部本地:192.168.1.2内部全局:内部对外公开的公网地址193.1.1.1动态NAPT:ip nat pool isp 193.1.1.3 193.1.1.4 netmask 255.255.255.0ip nat inside source list 1 pool isp overloadip nat inside source static 192.168.1.3 193.1.1.5标准访问控制列表:Access-list 规则序号permit/deny address wildcard-mask规则序号为1~99应用访问控制列表:进入接口Ip access-group 规则序号out(in)经端口流出设备时做访问控制,是out应用经设备外的数据端口流入设备时做访问控制,是in应用例:Router(config)#access-list 1 deny 192.168.1.0 0.0.0.255Router(config)#access-list 1 permit 192.168.3.0 0.0.0.255Router#sh access-lists 1Standard IP access list 1deny 192.168.1.0 0.0.0.255permit 192.168.3.0 0.0.0.255应用访问控制列表到接口上Router(config)#int e1/0Router(config-if)#ip accRouter(config-if)#ip access-group 1 out编号扩展访问控制列表规则编号为100~199Access-list 列表号{permit|deny} protocol source(源地址) 源掩码反码目的地址目的掩码反码端口范围端口范围:eq(=) gt(>) lt(<) neq(!=) range(范围)应用于端口方向:1、控制由外到内的数据包的时候,可以用IN,反之则用OUT2、标准访问控制列表应用接口靠近目的地址端,扩展访问控制列表应用靠近源地址端注:在访问控制列表中,当找不到匹配规则,则默认是拒绝查看:Router#show ip access-lists 101清除ACL: no ip access-list extended 101(编号) 包括命名访问控制列表或no access-list 101 只能删除编号的访问控制列表命名访问控制列表:例:Router(config)#ip access-list extended denystudentwwwRouter(config-ext-nacl)#deny tcp 192.168.2.2 0.0.0.0 194.1.1.2 0.0.0.0 eq wwwRouter(config-ext-nacl)#permit tcp 192.168.1.2 0.0.0.0 194.1.1.2 0.0.0.0 eq wwwRouter(config-ext-nacl)#permit ip any anyRouter(config-ext-nacl)#end%SYS-5-CONFIG_I: Configured from console by consoleRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#int f0/0Router(config-if)#ip access-group denystudentwww inRouter(config-if)#end命名的标准访问控制列表:Router(config)#ip access-list standard {name}deny {源掩码反码|源主机|any} 或permit {源掩码反码|源主机|any}应用于接口Cisco-dhcp配置Router(config)#ip dhcp pool pool1Router(dhcp-config)#network ?A.B.C.D Network number in dotted-decimal notationRouter(dhcp-config)#network 192.168.2.0 255.255.255.0 //设置分配地址的网络号Router(dhcp-config)#dns ?A.B.C.D Set ip address of DNS serverRouter(dhcp-config)#dns 202.102.192.68 //设置DNSRouter(dhcp-config)#defRouter(dhcp-config)#default-router 192.168.2.1 //设置网关Router(dhcp-config)#exitRouter(config)#ip dhcp exRouter(config)#ip dhcp excluded-address 192.168.2.1 ? //设置排除A.B.C.D High IP address<cr>Router(config)#ip dhcp excluded-address 192.168.2.1 192.168.2.10PPP认证:encapsulation ppp 在接口下封装pppppp authentication chap 启动ppp验证并指定为ppp chap验证方式username username password (0|7) password如:username rb password 0 111以对方路由器的名称作为用户名双方密码相同,0表示非密文,7表示密文在DCE端配置时钟为64000注:被验证方发送自己的主机名作为ppp用户名,chap协商由验证方发起,被验证方不需要启动ppp验证验证:sh int s0/0诊断:debug ppp authentication帧中继网:两种虚电路:PVC 永久虚电路SVC 交换式虚电路DLCI:数据链路连接标识符,用于标识DTE设备,一般由帧中继服务商提供,用于区分网络上不同的虚电路路由器DTE:数据终端设备Cloud0 DCE:数据电路终端设备LMI:帧中继本地管理接口帧中继技术提供面向连接的数据链路层的通信,在每对设备之间都存在一条定义好的通信链路,且该链路有一个链路识别码R1(config-if)#encapsulation frame-relay 帧中继封装R1(config-if)#frame-relay lmi-type cisco 帧中继类型为cisco/ansi/q933aR1(config)#int s1/0.1 point-to-point 配置子端口,并设置为点对点模式R1(config-subif)#ip add 192.168.1.1 255.255.255.0 分配子端口ip地址R1(config-subif)#frame-relay interface-dlci 102 指定点对点对应的DLCI值测试:Show frame-delay lmi/map/pvcPVC:列出所有配置的PVC和DLCI号,提供每个PVC连接的状态和流量统计Map:显示网络层到DLCI的映射Lmi:显示本地路由器和帧中继交换机之间的交换的LMI流量统计Router#sh interfaces s1/0诊断:debug frame-relay lmiVPN1、配置IKEIDE:internet密钥交换,提供IPSEC对等体验证,协商IPSEC密钥和协商IPSEC安全关联IPSEC:internet协议安全性Crypto isakmp enable 启动isakmpCrypto isakmp policy 10 //建立IKE策略,优先级为10authentication pre-share 使用预共享的密码进行身份验证,另外有rsa-encr(RSA加密)和RSA-sig(RSA签名)encryption 3des //使用3des加密方式3des:指三倍的数据加密标准DES:数据加密标准AES:高级加密标准hash md5 //指定hash算法为md5 sha(完整性算法)2、配置keyscrypto isakmp key tom address 200.1.1.2 //设置要使用的预定义密钥为tom,指定vpn另一端路由器IP地址为200.1.1.23、配置IPSECcrypto ipsec transform-set jizhen esp-3des esp-md5-hmac// 创建一个交换集,交换数据被md5保护,jizhen为交换集名字4、配置IPSEC加密映射crypto map tom 10 ipsec-isakmp //创建加密图,使用isakmp建立ipsec sa,以保护当前加密映射的指定数据库set peer 200.1.1.2 //标识对方路由器IP地址,指定对等体set transform-set jizhen //指定加密图使用IPSEC交换集match address 101 //用ACL来定义加密的通信access-list 101 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 //定义ACL,并用ACL来定义加密的通信5、应用加密图到接口int f 0/0crypto map tom验证:Show crypto ip saDebug crypto ip(isakmp)Show crypto isakmp sa (IKE阶段1)Show crypto ipsec sa (建立ipsec数据连接)Sh crypto map无线网配置:3560交换机划分了三个vlan0/1接vlan2 192.168.1.0 无线路由器的E1口接vlan2 0/2接vlan3 192.168.2.0 AP接vlan30/5接vlan1 192.168.0.0 pc2接vlan1 作为有线网络无线路由器:点击save settings保存设置PC机:三层交换机设置:划分vlan设置vlan接口地址interface Vlan1ip address 192.168.0.1 255.255.255.0 interface Vlan2ip address 192.168.1.1 255.255.255.0 interface Vlan3ip address 192.168.2.1 255.255.255.0 设置DHCPip dhcp excluded-address 192.168.0.1 ip dhcp excluded-address 192.168.0.254 ip dhcp excluded-address 192.168.1.1 ip dhcp excluded-address 192.168.1.254 ip dhcp excluded-address 192.168.2.1 !ip dhcp pool dhcpnetwork 192.168.0.0 255.255.255.0 default-router 192.168.0.1dns-server 61.139.2.69ip dhcp pool vlan2network 192.168.1.0 255.255.255.0 default-router 192.168.1.1dns-server 192.168.1.1ip dhcp pool vlan3network 192.168.2.0 255.255.255.0 default-router 192.168.2.1dns-server 192.168.2.1 ip routing。
层交换机与路由器的配置实例图解

三层交换机与路由器的配置实例(图解)目的:学会使用三层交换与路由器让处于不同网段的网络相互通信实验步骤:一:二层交换机的配置:在三个二层交换机上分别划出两VLAN,并将二层交换机上与三层交换或路由器上的接线设置为trunk接口二:三层交换机的配置:1:首先在三层交换上划出两个VLAN,并进入VLAN为其配置IP,此IP将作为与他相连PC的网关。
2:将与二层交换机相连的线同样设置为trunk接线,并将三层交换与路由器连接的线设置为路由接口(noswitchsport)3:将路由器和下面的交换机进行单臂路由的配置实验最终结果:拓扑图下各个PC均能相互通信交换机的配置命令:SW0:Switch>Switch>enSwitch#confConfiguringfromterminal,memory,ornetwork[terminal]?Enterconfigurationcommands,Z.Switch(config)#vlan2Switch(config-vlan)#exitSwitch(config)#intf0/2Switch(config-if)#switchportaccessvlan2Switch(config-if)#noshutSwitch(config-if)#intf0/3Switch(config-if)#switchportmodetrunk%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/3,changedstatetodown %LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/3,changedstatetoup Switch(config-if)#exitSwitch(config)#SW1:Switch>enSwitch#confConfiguringfromterminal,memory,ornetwork[terminal]? Enterconfigurationcommands,Z.Switch(config)#intf0/2Switch(config-if)#switchportaccessvlan2%Switch(config-if)#noshutSwitch(config-if)#exitSwitch(config)#intf0/3Switch(config-if)#switchportmodetrunk%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/3,changedstatetodown %LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/3,changedstatetoup Switch(config-if)#SW2:Switch>enSwitch#confConfiguringfromterminal,memory,ornetwork[terminal]? Enterconfigurationcommands,Z.Switch(config)#intf0/2Switch(config-if)#switchportaccessvlan2%Switch(config-if)#exitSwitch(config)#intf0/3Switch(config-if)#switchportmodetrunkSwitch(config-if)#三层交换的配置命令:Switch>enSwitch#confConfiguringfromterminal,memory,ornetwork[terminal]? Enterconfigurationcommands,Z.Switch(config)#intf0/1Switch(config-if)#switchportmodetrunk%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/2,changedstatetodown Switch(config-if)#exitSwitch(config)#intf0/2Switch(config-if)#switchportmodetrunkSwitch(config-if)#exitSwitch(config)#vlan2Switch(config-vlan)#exitSwitch(config)#intvlan1Switch(config-if)#noshut%LINK-5-CHANGED:InterfaceVlan1,changedstatetoup%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceVlan1,changedstatetoupSwitch(config-if)#ipaddressvlan2%LINK-5-CHANGED:InterfaceVlan2,changedstatetoup%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceVlan2,changedstatetoupSwitch(config-if)#ipadd Switch(config-if)#ipaddressInterfaceFastEthernet0/3,changedstatetoup%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/3,changedstatetoupSwitch(config-if)#exitSwitch(config)#intf0/3Switch(config-if)#noswitchport%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/3,changedstatetodown%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/3,changedstatetoupSwitch(config-if)# Switch(config-if)#ipaddressshutSwitch(config-if)#exitSwitch(config)#iproutingSwitch(config-if)#exitSwitch(config)#iproute路由器的配置:Router>enRouter#confConfiguringfromterminal,memory,ornetwork[terminal]?Enterconfigurationcommands,Z.Router(config)#intf0/0Router(config-if)#noshut%LINK-5-CHANGED:InterfaceFastEthernet0/0,changedstatetoupRouter(config-if)#exitRouter(config)#intf0/1Router(config-if)#noshut%LINK-5-CHANGED:InterfaceFastEthernet0/1,changedstatetoup%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/1,changedstatetoup Router(config-if)#exitRouter(config)#intf0/0Router(config-if)#noshutRouter(config-if)#exitRouter(config)#intf0/Router(config-subif)#encapsulationdot1Q1Router(config-subif)#ipaddressf0/Router(config-subif)#encapsulationdot1Q2Router(config-subif)#ipaddRouter(config-subif)#ipaddressrouteConfiguredfromconsolebyconsoleRouter#confConfiguringfromterminal,memory,ornetwork[terminal]? Enterconfigurationcommands,Z.Router(config)#intf0/1Router(config-if)#ipaddRouter(config-if)#ipaddress。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
路由器下接三层交换机配置文档
问题类别:基础配置适合:所有浏览:2901次
(一)IP规划及网络拓扑
假设VE1260下接一台三层交换机,三层交换机和VE1260相连的接口IP 地址是192.168.0.2,VE1260的内网口IP 地址是192.168.0.1;三层上划分了3个VLAN,IP段分别为192.168.1.0、192.168.2.0、192.168.3.0。
具体的网络拓扑结构如下:
现要实现内网3个网段的计算机都可正常上外网,可参考如下配置:
(二)在VE1260上的具体配置
注意:在配置VE1260之前请务必保证,下面三层交换机已配置静态路由,将所有出访的流量指向上层路由器(192.168.0.1)。
1、外网口配置照旧:外网口的配置和下面没接三层交换机的配置情况一致。
2、内网口配置为192.168.0.1,掩码同三层交换机一致。
3、路由器的模式选择为“NAT”模式。
4、配置内网扩展
在完成以上基本配置的基础之上,还需要在VE1260上分别把192.168.1.0、192.168.2.0、192.168.3.0添加到内网扩展中。
首先点击VE1260配置界面中的高级选项>>地址转换>>添加新规则,出现下图所示的界面。
上图是把192.168.1.0添加到内网扩展,同理按照相同的方式把192.168.2. 0和192.168.3.0分别添加到内网扩展中,出现下图所示的界面:
5、配置静态路由
配置完以上步骤之后,下面三个网段计算机还是不能正常打开网页,还需要在VE1260上分别添加指向下面三层交换机不同网段的静态路由。
首先添加指向192.168.1.0的静态路由,具体界面如下:
同理依次添加到192.168.2.0和192.168.3.0的静态路由,添加完全之后,出现下图所示的界面。
6、重启路由器:以上配置需要重启路由器才能生效。
通过以上配置,三层交换机下不同网段的计算机便可正常上外网。