乾颐堂 发表于 2023-3-9 17:19:59

军哥笔记之【综合实验】

一、实验目的了解CCNA综合实验中所应用到的知识,并能够让网络能够正常访问外网,总公司和分公司能够互通。二、实验过程本次实验思路为,先做好内网二层,再做好三层,最后做好外网互通及公司之间互通主要步骤及图为以下:1.交换机的vlan –ACCESS –trunk配置SW1的配置sysname SW3//设备命名vlan batch 8 to 10//创建多个vlanstp edged-port default//全局开启边缘端口stp mode rstp//配置STP模式为RSTP模式stp bpdu-protection//开启BPDU防止误接到其他交换机interface GigabitEthernet0/0/1 port link-type trunk//接口为trunk模式 port trunk allow-pass vlan 2 to 4094//允许所有vlan数据通过 stp edged-port disable//当前端口关闭边缘端口(优先级高于全局边缘端口配置)#interface GigabitEthernet0/0/3 port link-type trunk//接口为trunk模式 port trunk allow-pass vlan 2 to 4094//允许所有vlan数据通过 stp edged-port disable//当前接口关闭边缘端口(优先级高于全局边缘端口配置)#interface GigabitEthernet0/0/10 port link-type access//接口设置为ACCESS模式 port default vlan 8//接口允许vlan8数据通过stp edged-port disable//当前接口关闭边缘端口(优先级高于全局边缘端口配置)#interface GigabitEthernet0/0/11 port link-type access//接口设置为access模式 port default vlan 9//端口允许vlan9数据通过 stp edged-port disable //当前接口关闭边缘端口(优先级高于全局边缘端口配置)#interface GigabitEthernet0/0/12 port link-type access//端口模式为access port default vlan 10//端口允许vlan10 数据通过 stp edged-port disable //当前接口关闭边缘端口(优先级高于全局边缘端口配置)SW4的配置sysname SW4//设备命名#vlan batch 20 30//创建多个vlan#interface GigabitEthernet0/0/1    port link-type access//端口模式为ACCESS模式 port default vlan 20//端口允许vlan20数据通过#interface GigabitEthernet0/0/2 port link-type access//端口模式设置为access模式 port default vlan 30//允许vlan30数据通过interface GigabitEthernet0/0/10 port link-type trunk//端口模式为trunk模式 port trunk allow-pass vlan 2 to 4094//允许所有vlan数据通过SW1的配置sysname SW1//设备命名vlan batch 8 to 11//配置多个vlan#interface GigabitEthernet0/0/1 port link-type access端口模式为access port default vlan 11//允许vlan11数据通过 stp edged-port disable //当前端口关闭边缘端口(单个端口关闭优先级高于全局开启端口)#interface GigabitEthernet0/0/3 port link-type trunk//端口模式为trunk模式 port trunk allow-pass vlan 2 to 4094//允许所有vlan数据通过 stp edged-port disable   // 当前端口关闭边缘端口(单个端口关闭优先级高于全局开启端口)SW2的配置sysname SW2//设备命名vlan batch 8 to 10 12//创建多个vlan#interface GigabitEthernet0/0/1 port link-type trunk//端口模式为trunk模式 port trunk allow-pass vlan 8 to 10 //允许vlan 8 9 10数据通过 stp edged-port disable//当前端口关闭边缘端口(单个端口关闭优先级高于全局开启端口)#interface GigabitEthernet0/0/2 port link-type access端口模式为access模式 port default vlan 12端口允许vlan12通过 stp edged-port disable//当前端口关闭边缘端口(单个端口关闭优先级高于全局开启端口)2.配置动态链路聚合LACP,并允许通过vlanSW1interface Eth-Trunk1//创建eth-trunk1端口 port link-type trunk//eth-trunk1端口模式为trunk模式 port trunk allow-pass vlan 8 to 10//eth-trunk1端口允许vlan 8 9 10数据通过 stp edged-port disable//当前端口关闭边缘端口(单个端口关闭优先级高于全局开启端口) mode lacp-static//链路聚合模式为LACP自动模式lacp priority 0//LACP优先级为0(LACP优先级数值越低越优先)SW2interface Eth-Trunk1//创建eth-trunk1端口 port link-type trunk//eth-trunk1端口模式为trunk模式 port trunk allow-pass vlan 8 to 10端口允许vlan 8 9 10数据通过 stp edged-port disable//当前端口关闭边缘端口(单个端口关闭优先级高于全局开启端口) mode lacp-static//链路聚合模式为LACP自动模式lacp priority 32768//LACP优先级为32768(LACP优先级数值越低越优先)3.STP配置分清根交换机,模式设置为rstp,配置好边缘端口,最后配置BPDUSW1stp edged-port default//全局开启边缘端口stp mode rstp//STP模式为RSTPstp priority 0//优先级为0设置为根交换机(在stp生成树选举当中,设备的stp优先级月小越优先)SW2stp edged-port default//全局开启边缘端口stp mode rstp//STP模式为RSTPstp priority 4096//优先级为4096设置为备用根交换机(在stp生成树选举当中,设备的stp优先级月小越优先)SW3stp edged-port default//全局开启边缘端口stp mode rstp//STP 模式为RSTP模式stp bpdu-protection//启用BPDU,防止接入其他交换机(检测到接入的设备为交换机后2秒后端口状态为down)4.二层虚拟成三层,配置ip和网关 5.做好VRRP配置,分清master和buckup关系,其中注意master和根交换是同一台交换机SW1interface Vlanif8   //创建虚拟三层端口 ip address 192.168.8.252 255.255.255.0//配置三层虚拟端口ip vrrp vrid 8 virtual-ip 192.168.8.254//vrid为8(VRID后面的数值需要与vlan相对应,vlanif通常用来充当网关)的VRRP配置共同的虚拟网关 vrrp vrid 8 priority 200 //VRRP优先级为200 (vrrp优先值越大越优先,值大的为master)interface Vlanif9   //创建虚拟三层端口 ip address 192.168.9.252 255.255.255.0 //配置三层虚拟端口ip vrrp vrid 9 virtual-ip 192.168.9.254//VRID为9(vrid后面的数值需要与vlan相对应,vlanif通常充当网关)的vrrp配置共同的虚拟网关 vrrp vrid 9 priority 200//VRRP优先级为200(vrrp优先值越大越优先,值大的为master)interface Vlanif10 //创建虚拟三层端口ip address 192.168.10.252 255.255.255.0//配置三层虚拟端口ip vrrp vrid 10 virtual-ip 192.168.10.254//VRID为10(vrid后面的数值需要与vlan相对应,vlanif通常充当网关)的vrrp配置共同的虚拟网关 vrrp vrid 10 priority 200//VRRP优先级为200(vrrp优先值越大越优先,值大的为master)interface Vlanif11   //创建虚拟三层端口 ip address 192.168.11.2 255.255.255.0 //配置三层虚拟端口ipSW2interface Vlanif8//创建三层虚拟接口 ip address 192.168.8.253 255.255.255.0//配置三层虚拟接口ip vrrp vrid 8 virtual-ip 192.168.8.254//VRID为8(vrid后面的数值需要与vlan相对应,vlanif通常充当网关)的vrrp配置共同的虚拟网关interface Vlanif9 ip address 192.168.9.253 255.255.255.0 vrrp vrid 9 virtual-ip 192.168.9.254vrrp vrid 10 priority 100//VRRP优先级为100默认值(vrrp优先值越大越优先,值小的为buckup)interface Vlanif10//创建三层虚拟接口 ip address 192.168.10.253 255.255.255.0//设置三层虚拟接口ip vrrp vrid 10 virtual-ip 192.168.10.254//VRID为8(vrid后面的数值需要与vlan相对应,vlanif通常充当网关)的vrrp配置共同的虚拟网关interface Vlanif12//创建三层虚拟接口 ip address 192.168.12.2 255.255.255.0//配置三层虚拟接口ipR1interface Serial1/0/0ip address 12.1.1.1 255.255.255.252//端口配置ipinterface GigabitEthernet0/0/0 ip address 202.100.1.1 255.255.255.252//端口配置ipinterface GigabitEthernet0/0/1 ip address 192.168.11.1 255.255.255.0//端口配置ipinterface GigabitEthernet0/0/2 ip address 192.168.12.1 255.255.255.0//端口配置ipISPinterface Serial1/0/0ip address 12.1.1.2 255.255.255.252    //端口配置ipinterface GigabitEthernet0/0/0 ip address 202.100.1.2 255.255.255.252   //端口配置ipinterface GigabitEthernet0/0/1 ip address 61.128.1.2 255.255.255.252   //端口配置ip6.配置好外网静态路由,和分公司的单臂路由R1ip route-static 61.128.1.0 255.255.255.252 202.100.1.2//到分公司对端的静态路由ip route-static 0.0.0.0 0.0.0.0 202.100.1.2//浮动路由主出接口默认路由ip route-static 0.0.0.0 0.0.0.0 12.1.1.2   //浮动路由备用出接口默认路由R3interface GigabitEthernet0/0/0.20   //创建三层虚拟子接口dot1q termination vid 20剥离子接口vid 20的vlan标志(在单臂路由中vlan数值与vid相同时,该接口收到报文后可以剥离vlan的tag标志) ip address 192.168.20.254 255.255.255.0   //配置三层虚拟子接口ip arp broadcast enable//开启ARP广播报文功能(在华为设备单臂路由中,默认关闭ARP广播报文,需要手工开启)#interface GigabitEthernet0/0/0.30//创建三层虚拟子接口 dot1q termination vid 30剥离子接口vid 20的vlan标志(在单臂路由中vlan数值与vid相同时,该接口收到报文后可以剥离vlan的tag标志) ip address 192.168.30.254 255.255.255.0//配置三层虚拟子接口ip arp broadcast enable//开启ARP广播报文功能(在华为设备单臂路由中,默认关闭ARP广播报文,需要手工开启)ip route-static 0.0.0.0 0.0.0.0 61.128.1.2   //配置到外网的默认路由ip route-static 202.100.1.0 255.255.255.252 61.128.1.2 //配置到总公司的静态路由7.配置好内网动态路由ospf,和出口的缺省路由R1ospf 10 router-id 1.1.1.1   //创建ospf进程为10 ,并创建RID为1.1.1.1在ospf当中RID必须是唯一的才能建立起邻居) default-route-advertise //配置ospf10进程下全局出口的缺省路由 area 0.0.0.0 //在ospf10下创建区域0nterface Serial1/0/0 ospf enable 10 area 0.0.0.0 //接口宣告加入ospf 10的区域0内interface GigabitEthernet0/0/0 ip address 202.100.1.1 255.255.255.252 ospf enable 10 area 0.0.0.0//接口宣告加入ospf 10的区域0内interface GigabitEthernet0/0/1 ip address 192.168.11.1 255.255.255.0 ospf enable 10 area 0.0.0.0   //接口宣告加入ospf 10的区域0内#interface GigabitEthernet0/0/2 ip address 192.168.12.1 255.255.255.0 ospf enable 10 area 0.0.0.0    //接口宣告加入ospf 10的区域0内SW1ospf 10 router-id 2.2.2.2//创建ospf进程10 并创建RID为2.2.2.2(在ospf当中RID必须是唯一的才能建立起邻居) area 0.0.0.0//在ospf10进程中创建区域0interface Vlanif8 ip address 192.168.8.252 255.255.255.0 vrrp vrid 8 virtual-ip 192.168.8.254 vrrp vrid 8 priority 200 ospf enable 10 area 0.0.0.0 //接口宣告加入ospf 10的区域0内#interface Vlanif9 ip address 192.168.9.252 255.255.255.0 vrrp vrid 9 virtual-ip 192.168.9.254 vrrp vrid 9 priority 200 ospf enable 10 area 0.0.0.0 //接口宣告加入ospf 10的区域0内#interface Vlanif10 ip address 192.168.10.252 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254 vrrp vrid 10 priority 200 ospf enable 10 area 0.0.0.0//接口宣告加入ospf 10的区域0内#interface Vlanif11 ip address 192.168.11.2 255.255.255.0 ospf enable 10 area 0.0.0.0 //接口宣告加入ospf 10的区域0内SW2ospf 10 router-id 3.3.3.3//创建ospf 10进程,并创建RID为3.3.3.3(在ospf当中RID必须是唯一的才能建立起邻居) area 0.0.0.0// 在ospf10进程中创建区域0interface Vlanif8 ip address 192.168.8.253 255.255.255.0 vrrp vrid 8 virtual-ip 192.168.8.254 ospf enable 10 area 0.0.0.0//接口宣告加入ospf 10的区域0内#interface Vlanif9 ip address 192.168.9.253 255.255.255.0 vrrp vrid 9 virtual-ip 192.168.9.254 ospf enable 10 area 0.0.0.0//接口宣告加入ospf 10的区域0内#interface Vlanif10 ip address 192.168.10.253 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254 ospf enable 10 area 0.0.0.0//接口宣告加入ospf 10的区域0内#interface Vlanif12 ip address 192.168.12.2 255.255.255.0 ospf enable 10 area 0.0.0.0//接口宣告加入ospf 10的区域0内8.配置好两边公司的aclR1总公司acl number 2000//创建基本acl 2000 访问控制 rule 5 permit source 192.168.8.0 0.0.0.255 //在acl 2000访问控制下,设置默认规则允许源地址为192.168.8.0/24段数据通过(华为的规则号默认初始为5,步长为5) rule 10 permit source 192.168.9.0 0.0.0.255 //在acl 2000访问控制下,设置默认规则允许源地址为192.168.9.0/24段数据通过(华为的规则号默认初始为5,步长为5) rule 15 permit source 192.168.10.0 0.0.0.255//在acl 2000访问控制下,设置默认规则允许源地址为192.168.10.0/24段数据通过(华为的规则号默认初始为5,步长为5)R3分公司acl number 2000//创建基本acl 2000访问控制 rule 5 permit source 192.168.20.0 0.0.0.255 //在acl 2000访问控制下,设置默认规则允许源地址为192.168.20.0/24段数据通过(华为的规则号默认初始为5,步长为5) rule 10 permit source 192.168.30.0 0.0.0.255//在acl 2000访问控制下,设置默认规则允许源地址为192.168.20.0/24段数据通过(华为的规则号默认初始为5,步长为5) 9、两边公司配置边界出口做好NATR1总公司interface Serial1/0/0link-protocol ppp ip address 12.1.1.1 255.255.255.252 ospf enable 10 area 0.0.0.0 nat outbound 2000//边界出接口调用acl 2000,进行nat地址转换(私网地址转换为出接口公网地址)#interface Serial1/0/1 link-protocol ppp#interface GigabitEthernet0/0/0 ip address 202.100.1.1 255.255.255.252 ospf enable 10 area 0.0.0.0 nat server protocol tcp global current-interface 2323 inside 192.168.11.2 telnet nat outbound 2000//边界出接口调用acl 2000,进行nat地址转换(私网地址转换为出接口公网地址)R3分公司interface GigabitEthernet0/0/1 ip address 61.128.1.1 255.255.255.252 nat outbound 2000//边界出接口调用acl 2000,进行nat地址转换(私网地址转换为出接口公网地址)10、两边公司配置模式为GRE的隧道配置R1总公司interface Tunnel0/0/0//创建虚拟隧道的接口 ip address 20.1.1.1 255.255.255.252 //配置虚拟隧道接口ip tunnel-protocol gre//在虚拟隧道接口下配置模式为GRE模式 source 202.100.1.1//虚拟隧道接口下配置源ip destination 61.128.1.1//虚拟隧道接口下配置目的ip(此项需要注意目的与描述的单词区别,防止出错)ip route-static 192.168.20.0 255.255.255.0 20.1.1.2//创建一条到对端的明细路由,下一跳为对端的虚拟隧道出接口ip route-static 192.168.30.0 255.255.255.0 20.1.1.2//创建一条到对端的明细路由,下一跳为对端的虚拟隧道出接口R3分公司ip route-static 192.168.8.0 255.255.255.0 20.1.1.1 //创建一条到对端的明细路由,下一跳为对端的虚拟隧道出接口ip route-static 192.168.9.0 255.255.255.0 20.1.1.1//创建一条到对端的明细路由,下一跳为对端的虚拟隧道出接口ip route-static 192.168.10.0 255.255.255.0 20.1.1.1//创建一条到对端的明细路由,下一跳为对端的虚拟隧道出接口R3分公司interface Tunnel0/0/0//创建虚拟隧道接口 ip address 20.1.1.2 255.255.255.252   //设置虚拟隧道接口ip tunnel-protocol gre   //在虚拟隧道接口下配置模式为GRE模式 source 61.128.1.1 //在虚拟隧道接口下配置源ip destination 202.100.1.1   //虚拟隧道接口下配置目的ip(此项需要注意目的与描述的单词区别,防止出错)#ip route-static 0.0.0.0 0.0.0.0 61.128.1.2ip route-static 61.128.1.0 255.255.255.0 202.100.1.2 直连路由ip route-static 192.168.8.0 255.255.255.0 20.1.1.1//创建一条到对端的明细路由,下一跳为对端的虚拟隧道出接口ip route-static 192.168.9.0 255.255.255.0 20.1.1.1//创建一条到对端的明细路由,下一跳为对端的虚拟隧道出接口ip route-static 192.168.10.0 255.255.255.0 20.1.1.1//创建一条到对端的明细路由,下一跳为对端的虚拟隧道出接口11.对 SW1做好nat server以便能够从外网访问此设备。R1的配置interface GigabitEthernet0/0/0nat server protocol tcp global current-interface 2323 inside 192.168.11.2 telnet //在出接口上配置nat server公网的ip和端口映射到内网的ip和端口nat outbound 2000//出接口调用acl 2000SW1的配置user-interface vty 0 4//创建vty 0 4线路[SW1-ui-vty0-4]authentication-mode password//配置vty线路密码模式[SW1-ui-vty0-4]set authenticationpassword simple qyt //配置vty线路密码qyt[SW1-ui-vty0-4]user privilege level 15//配置vty线路下用户权限[SW1-ui-vty0-4]protocolinbound telnet//vty线路下开Telnetacl 2000 inbound//接口入方向调用acl 2000三、实验验证1、验证总公司二层是否有环路、BPDU是否有效、边缘端口是否有效1.查看SW3的mac地址表,然后关闭stp,在打开stp,发现SW1上的三个接有PC端口上的mac地址没有漂移,说明没有环路。2、使用命令dis loop-detect查看是否有环路,反馈信息显示没有二层环路3.在SW3上接入一个交换机,开启后2秒发现接口转态改变为down状态,手工开启端口后2秒依然转变为down状态,说明BPDU已经配置正确4.对同一vlan 8内的PC进行关闭,启动,发现可以马上进行通讯,说明边缘端口配置有效2、验证总公司根交换机和VRRP主虚拟路由是否为同一台交换机1.在SW1上使用命令dis stp查看发现SW1位根桥2.在SW1上使用命令dis vrrp brief发现SW1即为主虚拟路由如下图说明SW1配置上STP根桥和VRRP主虚拟路由均为同一台设备3、验证总公司vrrp是否正常,验证lacp是否正常,验证ACCESS和trunk模式与vlan是否正确1.dow掉SW1上的2层接口,然后使用命令查看SW2的VRRP状态,发现SW2的状态为主状态,此时PC应该能够通讯,说明配置正确2.使用命令查看发现链路聚合状态下,链路接口的带宽为2G,关闭其中一个物理端口后状态变为1G说明能够正常使用。3.变更PC1的ip地址为vlan 9的地址和网关,发现无法ping通网关,说明access配置正确,pc之间相互ping发现可以正确通讯,说明trunk和vlan配置正确4、验证分公司单臂路由是否能够正常通讯1.在接入交换机没有路由功能的情况下,路由器需要使用单臂路由功能做网关,使用电脑ping不同的网关及PC发现可以正常通讯,说明单臂路由能够正常通讯5、验证总公司和分公司是否能够访问外网1.使用总部任意一台pc访问网外地址,发现可以进行通讯2.使用分公司任意一台电脑访问外网,发现可以通讯说明2边公司配置正确,都能够访问外网6、验证虚拟三层路由和出接口是否在同一个区域0内形成ospf邻居1.使用命令dis ospf peer brief 查看邻居是否建立,发现三设备均已建立邻居关系7、验证区域0内的设备路由是否有对外的缺省路由使用命令dis ip routing-table对2台交换机进行查看,发现均有对外的缺省路由8.验证总公司和分公司是否可以正常通讯1.查看2边的路由表发现相互之间已经有对端隧道ip的路由表,两端任意电脑可以进行通讯,说明隧道配置成功9、验证NAT server 是否可以从外网访问到SW11.在isp上telnet到 交换机1发现可以通讯,说明验证成功四、配置命令SW3配置其他相同配置不做解析vlan batch 8 to 10//配置多个vlan#stp edged-port default //全部设置边缘端口stp mode rstp//stp模式为rstp模式stp bpdu-protection //开启BPDU保护,防止误接其他交换机interface GigabitEthernet0/0/1 port link-type trunk//接口设置为trunk模式 port trunk allow-pass vlan 2 to 4094//接口允许所有vlan数据通过 stp edged-port disable//当前接口关闭边缘端口interface GigabitEthernet0/0/3 port link-type trunk port trunk allow-pass vlan 2 to 4094 stp edged-port disableinterface GigabitEthernet0/0/4 port link-type access//接口设置为access模式 port default vlan 8//接口允许vlan 8数据通过interface GigabitEthernet0/0/10 port link-type access port default vlan 8 stp edged-port disable#interface GigabitEthernet0/0/11 port link-type access port default vlan 9 stp edged-port disable#interface GigabitEthernet0/0/12 port link-type access port default vlan 10SW1配置vlan batch 8 to 11#stp edged-port defaultstp mode rstpstppriority 0// 设置当前交换机最优权限,为根交换机#lacp priority 0//设置当前交换机lacp最优权限,为主端口interface Vlanif8//创建三层虚拟子接口 ip address 192.168.8.252 255.255.255.0 //三层虚拟子接口配置ip vrrp vrid 8 virtual-ip 192.168.8.254 //配置vrrp虚拟网关 vrrp vrid 8 priority 200 //配置vrrp权限(默认权限100,数值高的为主虚拟路由) ospf enable 10 area 0.0.0.0 //当前接口宣告ospf进程10加入区域0#interface Vlanif9 ip address 192.168.9.252 255.255.255.0 vrrp vrid 9 virtual-ip 192.168.9.254 vrrp vrid 9 priority 200 ospf enable 10 area 0.0.0.0#interface Vlanif10 ip address 192.168.10.252 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254 vrrp vrid 10 priority 200 ospf enable 10 area 0.0.0.0#interface Vlanif11 ip address 192.168.11.2 255.255.255.0 ospf enable 10 area 0.0.0.0#interface Eth-Trunk1//创建链路聚合接口 port link-type trunk port trunk allow-pass vlan 8 to 10 stp edged-port disable mode lacp-static//链路聚合模式为lacp自动模式#interface GigabitEthernet0/0/1 port link-type access port default vlan 11 stp edged-port disable#interface GigabitEthernet0/0/3 port link-type trunk port trunk allow-pass vlan 2 to 4094 stp edged-port disable #interface GigabitEthernet0/0/5 eth-trunk 1//当前接口加入链路聚合端口#interface GigabitEthernet0/0/6 eth-trunk 1ospf 10 router-id 2.2.2.2//创建ospf进程10 ,路由ID为2.2.2.2 area 0.0.0.0 //在ospf进程下创建区域0user-interfac vty 0 4//创建远程线路 user privilege level 15//远程线路用户权限为15 set authentication password simple qyt //vty 0 4用户密码为qyt#rotocolinbound telnet//vty线路下开TelnetSW3配置vlan batch 8 to 10 12#stp edged-port defaultstp mode rstpstp instance 0 priority 4096#interface Vlanif8 ip address 192.168.8.253 255.255.255.0 vrrp vrid 8 virtual-ip 192.168.8.254 ospf enable 10 area 0.0.0.0#interface Vlanif9 ip address 192.168.9.253 255.255.255.0 vrrp vrid 9 virtual-ip 192.168.9.254 ospf enable 10 area 0.0.0.0#interface Vlanif10 ip address 192.168.10.253 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254 ospf enable 10 area 0.0.0.0#interface Vlanif12 ip address 192.168.12.2 255.255.255.0 ospf enable 10 area 0.0.0.0interface Eth-Trunk1 port link-type trunk port trunk allow-pass vlan 8 to 10 stp edged-port disable mode lacp-static#interface GigabitEthernet0/0/1 port link-type trunk port trunk allow-pass vlan 8 to 10 stp edged-port disable#interface GigabitEthernet0/0/2 port link-type access port default vlan 12 stp edged-port disableinterface GigabitEthernet0/0/5 eth-trunk 1#interface GigabitEthernet0/0/6 eth-trunk 1#ospf 10 router-id 3.3.3.3 area 0.0.0.0 R1配置sysname R1acl number 2000//设置使用基础acl 2000 rule 5 permit source 192.168.8.0 0.0.0.255 //规则5运行源192.168.8.0/24网段数据通过 rule 10 permit source 192.168.9.0 0.0.0.255 rule 15 permit source 192.168.10.0 0.0.0.255#interface Serial1/0/0 link-protocol ppp ip address 12.1.1.1 255.255.255.252 ospf enable 10 area 0.0.0.0 nat outbound 2000//出接口nat地址转换调用acl 2000interface GigabitEthernet0/0/0 ip address 202.100.1.1 255.255.255.252 ospf enable 10 area 0.0.0.0 nat server protocol tcp global current-interface 2323 inside 192.168.11.2 telnet    //nat server 内网ip和端口转换为当前外网接口的ip和端口 nat outbound 2000//出接口nat地址转换调用acl 2000#interface GigabitEthernet0/0/1 ip address 192.168.11.1 255.255.255.0 ospf enable 10 area 0.0.0.0#interface GigabitEthernet0/0/2 ip address 192.168.12.1 255.255.255.0 ospf enable 10 area 0.0.0.0##interface Tunnel0/0/0//创建虚拟隧道接口 ip address 20.1.1.1 255.255.255.252 //配置虚拟隧道接口ip tunnel-protocol gre//虚拟隧道模式为GRE模式 source 202.100.1.1//虚拟隧道源地址 destination 61.128.1.1//虚拟隧道目的地址#ospf 10 router-id 1.1.1.1 default-route-advertise//在ospf 10进程下创建对外的默认路由 area 0.0.0.0#ip route-static 0.0.0.0 0.0.0.0 202.100.1.2//到服务商的默认路由ip route-static 0.0.0.0 0.0.0.0 12.1.1.2    //到服务商的备份路线默认路由ip route-static 61.128.1.0 255.255.255.252 202.100.1.2 //直连路由ip route-static 192.168.20.0 255.255.255.0 20.1.1.2 //配置一条明细路由,下一跳是对端的隧道地址ip route-static 192.168.30.0 255.255.255.0 20.1.1.2ip route-static 202.100.1.0 255.255.255.0 61.128.1.2#user-interface con 0 authentication-mode passworduser-interface vty 0 4user-interface vty 16 20ISP配置nterface Serial1/0/0 link-protocol ppp ip address 12.1.1.2 255.255.255.252   #interface GigabitEthernet0/0/0 ip address 202.100.1.2 255.255.255.252#interface GigabitEthernet0/0/1 ip address 61.128.1.2 255.255.255.252#interface GigabitEthernet0/0/2#interface NULL0#interface LoopBack0//创建环回接口 ip address 8.8.8.8 255.255.255.255//设置环回接口ipR3配置 sysname R3acl number 2000 rule 5 permit source 192.168.20.0 0.0.0.255 rule 10 permit source 192.168.30.0 0.0.0.255#interface GigabitEthernet0/0/0.20//创建单臂路由虚拟子接口 dot1q termination vid 20//虚拟纸接口vid与vlan相对应 ip address 192.168.20.254 255.255.255.0//设置虚拟子接口ip arp broadcast enable//开启虚拟子接口arp广播(华为默认在虚拟子接口应用中关闭arp需要手工开启)#interface GigabitEthernet0/0/0.30 dot1q termination vid 30 ip address 192.168.30.254 255.255.255.0 arp broadcast enable#interface GigabitEthernet0/0/1 ip address 61.128.1.1 255.255.255.252 nat outbound 2000 //出接口地址转换调用acl 2000#interface Tunnel0/0/0 ip address 20.1.1.2 255.255.255.252 tunnel-protocol gre source 61.128.1.1 destination 202.100.1.1#ip route-static 0.0.0.0 0.0.0.0 61.128.1.2//到服务商的默认路由ip route-static 61.128.1.0 255.255.255.0 202.100.1.2//到总公司的静态路由ip route-static 192.168.8.0 255.255.255.0 20.1.1.1//一条明细路由,下一跳是对端的隧道地址ip route-static 192.168.9.0 255.255.255.0 20.1.1.1ip route-static 192.168.10.0 255.255.255.0 20.1.1.1ip route-static 202.100.1.0 255.255.255.252 61.128.1.2 SW4的配置<SW4>dis cu#sysname SW4#vlan batch 20 30interface GigabitEthernet0/0/1 port link-type access port default vlan 20#interface GigabitEthernet0/0/2 port link-type access port default vlan 30interface GigabitEthernet0/0/10 port link-type trunk port trunk allow-pass vlan 2 to 4094

wjlovezzd 发表于 2023-3-9 17:33:45

{:6_267:}{:6_267:}{:6_267:}{:6_267:}{:6_267:}{:6_267:}{:6_267:}

h446843457 发表于 2023-5-23 15:31:59

顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶

mybigwei 发表于 2023-9-4 16:11:00

{:6_267:}{:6_267:}{:6_267:}{:6_267:}

judsonjia1 发表于 2023-9-10 20:24:54

好资料

dxqjdj 发表于 2023-10-30 20:35:33

这个必须顶

Shark-pc 发表于 2024-3-12 16:05:20

https://www.bilibili.com/video/BV18G4y1s7ZK/?vd_source=e846806e0a0a9468a7c7a8bcb4e07be7
页: [1]
查看完整版本: 军哥笔记之【综合实验】