首页 > 其他分享 >Cisco网络综合实验

Cisco网络综合实验

时间:2023-04-21 16:24:28浏览次数:39  
标签:Cisco Fa0 200.0 192.168 Switch 实验 Router config 网络综合

一、实验拓扑

二、实验步骤

2.1 配置路由器

# 步骤1:配置路由器接口、配置DHCP地址池
Router>en
Router#conf t
Router(config)#int g0/0
Router(config-if)#ip add 10.0.0.2 255.255.255.0
Router(config-if)#no sh
Router(config-if)#exit
配置路由条目
Router(config)#ip route 10.0.1.0 255.255.255.0 10.0.0.1
配置路由条目:
Router(config)#ip route 192.168.0.0 255.255.0.0 10.0.0.1

配置vlan10地址池
Router(config)#ip dhcp pool vlan10
Router(dhcp-config)#net 192.168.10.0 255.255.255.0
Router(dhcp-config)#default-router 192.168.10.1
Router(dhcp-config)#exit

配置vlan20地址池
Router(config)#ip dhcp pool vlan20
Router(dhcp-config)#net 192.168.20.0 255.255.255.0
Router(dhcp-config)#default-router 192.168.20.1
Router(dhcp-config)#exit

配置vlan30地址池
Router(config)#ip dhcp pool vlan30
Router(dhcp-config)#net 192.168.30.0 255.255.255.0
Router(dhcp-config)#default-router 192.168.30.1
Router(dhcp-config)#exit
Router(config)#


# 步骤2:配置NAT地址转换
Router>
Router>en
Router#conf t

设置内网
Router(config)#int g0/0
Router(config-if)#ip nat inside 

配置外网
Router(config-if)#int g0/1
Router(config-if)#ip add 200.0.0.1 255.255.255.0
Router(config-if)#no sh
Router(config-if)#ip nat outside 
Router(config-if)#exit
Router(config)#access-list 1 permit 192.168.0.0 0.0.255.255
Router(config)#ip nat pool kgc 200.0.0.11 200.0.0.20 netmask 255.255.255.0
Router(config)#ip nat inside source list 1 pool kgc overload 
Router(config)#ip route 0.0.0.0 0.0.0.0 g0/1
Router(config)#end
Router#
Router#sh ip route 
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - 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 - ODR
       P - periodic downloaded static route

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C       10.0.0.0/24 is directly connected, GigabitEthernet0/0
L       10.0.0.2/32 is directly connected, GigabitEthernet0/0
S       10.0.1.0/24 [1/0] via 10.0.0.1
S    192.168.0.0/16 [1/0] via 10.0.0.1
     200.0.0.0/24 is variably subnetted, 2 subnets, 2 masks
C       200.0.0.0/24 is directly connected, GigabitEthernet0/1
L       200.0.0.1/32 is directly connected, GigabitEthernet0/1
S*   0.0.0.0/0 is directly connected, GigabitEthernet0/1

2.2 配置3层交换机

# 步骤1:配置SWA
Switch>
Switch>en

三层交换机不能配置vlan,使用该命令三层交换机可以配置vlan
Switch#vlan database 
Switch(vlan)#vl 10
Switch(vlan)#exit
Switch#conf t


Switch(config)#int g0/1

三层交换机没有启用trunk功能,需要通过其命令启用trunk功能,将二层的trunk中继到三层
Switch(config-if)#sw tr encapsulation dot1q 
Switch(config-if)#sw mo tr

Switch(config-if)#int g0/2

用该命令把交换机功能转换成路由器功能
Switch(config-if)#no switchport 

配置的把交换机功能转换成路由器两边的ip
Switch(config-if)#ip add 10.0.1.1 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#int vlan 10
Switch(config-if)#ip add 192.168.10.1 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#exit

配置路由条目
Switch(config)#ip route 0.0.0.0 0.0.0.0 10.0.1.2

启动路由器,用其功能
Switch(config)#ip routing
Switch(config)#exit

查看route的ip

Switch#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - 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 - ODR
       P - periodic downloaded static route

Gateway of last resort is 10.0.1.2 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 1 subnets
C       10.0.1.0 is directly connected, GigabitEthernet0/2
C    192.168.10.0/24 is directly connected, Vlan10
S*   0.0.0.0/0 [1/0] via 10.0.1.2

Switch#sh vl br

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
10   VLAN0010                         active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    


Switch#conf t

连接地址池,需要在vlan10里配置中继,能够通过DHCP获取pc机的ip
Switch(config)#int vlan 10
Switch(config-if)#ip helper-address 10.0.0.2
Switch(config-if)#end
Switch#


# 步骤2:配置SWB
Switch>
Switch>en

三层交换机不能配置vlan,使用该命令三层交换机可以配置两个vl
vl10和vl20
Switch#vl da
Switch(vlan)#vl 20
Switch(vlan)#vl 30
Switch(vlan)#exit


Switch#conf t
Switch(config)#int g0/1

三层交换机没有启用trunk功能,需要通过其命令启用trunk功能,将二层的trunk中继到三层
Switch(config-if)#sw tr en dot1q 
Switch(config-if)#sw mo tr

用该命令把交换机功能转换成路由器功能
Switch(config-if)#int g0/2
Switch(config-if)#no switchport 
Switch(config-if)#ip add 10.0.1.2 255.255.255.0
启动路由器其端口
Switch(config-if)#no sh

用该命令把交换机功能转换成路由器功能
Switch(config-if)#int f0/1
Switch(config-if)#no switchport 
Switch(config-if)#ip add 10.0.0.1 255.255.255.0

启动路由器其端口
Switch(config-if)#no sh

在路由器中添加vl20和vl30的ip,使其路由器能够获取到vl20和vl30的ip
Switch(config-if)#int vlan 20
Switch(config-if)#ip add 192.168.20.1 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#int vl 30
Switch(config-if)#ip add 192.168.30.1 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#exit

在其路由器上配置两端的静态路由条目
Switch(config)#ip route 192.168.10.0 255.255.255.0 10.0.1.1
Switch(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.2

启动路由器
Switch(config)#ip routing

配置两台vl20和vl30的中继
Switch(config)#int vl 20
Switch(config-if)#int vl 20
Switch(config-if)#ip helper-address 10.0.0.2
Switch(config-if)#int vl 30
Switch(config-if)#ip helper-address 10.0.0.2
Switch(config-if)#end
Switch#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - 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 - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
C       10.0.0.0 is directly connected, FastEthernet0/1
C       10.0.1.0 is directly connected, GigabitEthernet0/2
S    192.168.10.0/24 [1/0] via 10.0.1.1
C    192.168.20.0/24 is directly connected, Vlan20
C    192.168.30.0/24 is directly connected, Vlan30

2.3 配置2层交换机

# 步骤1:配置SW1
Switch>en
Switch#conf t

两层交换机创建vl10
Switch(config)#vl 10
Switch(config-vlan)#exit

创建两层交换机的vl10
Switch(config)#int f0/1
Switch(config-if)#sw mo ac
Switch(config-if)#sw ac vl 10

进入g0/1,配置trunk
Switch(config-if)#int g0/1
Switch(config-if)#sw mo tr
Switch(config-if)#end
Switch#sh vl br

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15, Fa0/16, Fa0/17
                                                Fa0/18, Fa0/19, Fa0/20, Fa0/21
                                                Fa0/22, Fa0/23, Fa0/24, Gig0/2
10   VLAN0010                         active    Fa0/1
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    


# 步骤2:配置SW2

Switch>
Switch>en
Switch#conf t

两层交换机创建两个vl,vl20和vl30
Switch(config)#vl 20
Switch(config-vlan)#vl 30
Switch(config-vlan)#

创建两层交换机的vl20和vl30
Switch(config-vlan)#int f0/2
Switch(config-if)#sw mo ac
Switch(config-if)#sw ac vl 20
Switch(config-if)#int f0/3
Switch(config-if)#sw mo ac
Switch(config-if)#sw ac vl 30

进入g0/1,配置trunk
Switch(config-if)#int g0/1
Switch(config-if)#sw mo tr

2.4 测试全网连通

# 步骤1:在PC2上ping其他PC和外网服务器
C:\>ipconfig

FastEthernet0 Connection:(default port)

   Connection-specific DNS Suffix..: 
   Link-local IPv6 Address.........: FE80::2D0:BCFF:FE33:403B
   IPv6 Address....................: ::
   IPv4 Address....................: 192.168.30.2
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: ::
                                     192.168.30.1

C:\>ping 192.168.20.2

Pinging 192.168.20.2 with 32 bytes of data:

Request timed out.
Reply from 192.168.20.2: bytes=32 time<1ms TTL=127
Reply from 192.168.20.2: bytes=32 time=6ms TTL=127
Reply from 192.168.20.2: bytes=32 time<1ms TTL=127

C:\>ping 192.168.10.2

Pinging 192.168.10.2 with 32 bytes of data:

Request timed out.
Reply from 192.168.10.2: bytes=32 time<1ms TTL=126
Reply from 192.168.10.2: bytes=32 time<1ms TTL=126
Reply from 192.168.10.2: bytes=32 time<1ms TTL=126

C:\>ping 200.0.0.200

Pinging 200.0.0.200 with 32 bytes of data:

Reply from 200.0.0.200: bytes=32 time=1ms TTL=126
Reply from 200.0.0.200: bytes=32 time=11ms TTL=126
Reply from 200.0.0.200: bytes=32 time<1ms TTL=126
Reply from 200.0.0.200: bytes=32 time<1ms TTL=126

Ping statistics for 200.0.0.200:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 11ms, Average = 3ms



# 步骤2:在路由器上查看NAT地址映射

Router#sh ip nat tr
Pro  Inside global     Inside local       Outside local      Outside global
icmp 200.0.0.11:10     192.168.30.2:10    200.0.0.200:10     200.0.0.200:10
icmp 200.0.0.11:11     192.168.30.2:11    200.0.0.200:11     200.0.0.200:11
icmp 200.0.0.11:12     192.168.30.2:12    200.0.0.200:12     200.0.0.200:12
icmp 200.0.0.11:1      192.168.20.2:1     200.0.0.200:1      200.0.0.200:1
icmp 200.0.0.11:2      192.168.20.2:2     200.0.0.200:2      200.0.0.200:2
icmp 200.0.0.11:3      192.168.20.2:3     200.0.0.200:3      200.0.0.200:3
icmp 200.0.0.11:4      192.168.20.2:4     200.0.0.200:4      200.0.0.200:4
icmp 200.0.0.11:5      192.168.10.2:5     200.0.0.200:5      200.0.0.200:5
icmp 200.0.0.11:6      192.168.10.2:6     200.0.0.200:6      200.0.0.200:6
icmp 200.0.0.11:7      192.168.10.2:7     200.0.0.200:7      200.0.0.200:7
icmp 200.0.0.11:8      192.168.10.2:8     200.0.0.200:8      200.0.0.200:8
icmp 200.0.0.11:9      192.168.30.2:9     200.0.0.200:9      200.0.0.200:9

 

标签:Cisco,Fa0,200.0,192.168,Switch,实验,Router,config,网络综合
From: https://www.cnblogs.com/wang97bk/p/17340812.html

相关文章

  • ORB305与CISCO路由器构建L2TP over IPSec VPN操作手册
    1、网络拓扑在思科路由器与ORB305之间建立一个安全隧道,对客户路由器端设备子网,与思科路由器端服务器子网之间的数据流进行安全保护,组网拓扑图如图所示。2、思科路由器端配置指导(此处以多数客户使用专线上网形式为例)Cisco(AR1)配置配置1.AAA配置aaanew-model//启用AAAaaaaut......
  • 操作系统实验 & bochs 环境配置
    wsl2-Ubuntu22.04+VSCode+bochs+xfce4+VcXsrv笔者环境wsl2-Ubuntu22.040.安装WSL2&VSCode网上教程千千万,请自行查找WSL2:WSL2安装教程_pengege666的博客-CSDN博客​ 切换清华源:ubuntu|镜像站使用帮助|清华大学开源软件镜像站|TsinghuaOpenSourc......
  • 链路聚合-实验
    一、实验背景什么是链路聚合?将多个物理端口汇聚在一起,形成一个逻辑端口,以实现出/入吞吐量在各成员端口的负载分担当交换机检测到其中一个成员端口的链路发生故障时,就停止在此端口上发送封包,并根据负荷分担策略在剩下的链路中重新计算报文的发送端口,故障端口恢复后再次担......
  • UML时序图实验报告
    1,这是一张向我们直接展示了银行取款活动图,首先我们需要填写表单,其次需要输入密码,根据判断条件,检查密码的正误,密码错误直接结束,密码正确,根据用户的需求,如果取款则出款并结束,如果是计算利息,则执行打印清单操作,并结束。   2,这张图片展示了用户想要续借图书的时序图,这里的目......
  • 【原创】实验验证 -fstack-protector 编译选项效果
     使用 -fstack-protector选项的编译脚本  [root@Bettystack_smash_test]#catmk.sh  #!/bin/bash g++-O2-Wall-m32-shared-Wl,-fpiccaptureexception.cpp-olibcaptureexception.so gcc-g-fstack-protector-Wall-U_FORTIFY_......
  • 实验四
    #include<stdio.h>#defineN4intmain(){inta[N]={2,0,2,3};charb[N]={'2','0','2','3'};inti;printf("sizeof(int)=%d\n",sizeof(int));printf("sizeof(char)=%d\n",size......
  • Spark+HBase数据处理与存储实验部分内容
    0.Scala+Spark+HBase的IDEA环境配置需要下载的内容:Scala、Java,注意两者之间版本是否匹配。环境:Win10,Scala2.10.6,JDK1.7,IDEA2022.3.1创建maven工程。下载Scala插件。右键项目,添加Scala框架支持。项目结果如图所示:scala添加为源目录,下存scala代码添加依赖包。将property的......
  • 网络对抗实验五 信息搜集与漏洞扫描--20201313
    目录网络对抗实验五信息搜集与漏洞扫描一、实践目标及实践内容1.实践目标2.实践内容二、实践原理1.信息搜集三、实践过程记录1、各种搜索技巧的应用搜索网址目录结构使用traceroute命令进行路由侦查2、DNSIP注册信息的查询whois查询nslookup查询dig查询LP2Location地理位置查......
  • VSCode修饰器报错,对修饰器的实验支持功能在将来的版本中可能更改
    报错内容对修饰器的实验支持功能在将来的版本中可能更改。在“tsconfig”或“jsconfig”中设置“experimentalDecorators”选项以删除此警告解决办法方法一:设置VSCode选项管理==>设置==>搜索experimentalDecorators==>打上勾勾方法二:增加jsconfig文件在根目录下新......
  • Cisco SD-WAN (Viptela) version 20.11.1 ED - 软件定义广域网
    请访问原文链接:https://sysin.org/blog/cisco-sd-wan-20/,查看最新版。原创作品,转载请保留出处。作者主页:sysin.org支持SASE的架构,其集成了面向多云、安全、统一通信和应用优化的各种功能,可用于轻松安全地将任何用户连接至任何应用。阅读IDC报告CiscoSD-WANpoweredby......