作者:月夜行舟
实验拓扑
图 1-1
注:如无特别说明,描述中的 R1 或 SW1 对应拓扑中设备名称末尾数字为 1 的设备,R2 或 SW2 对应拓扑中设备名称末尾数字为 2 的设备,以此类推;另外,同一网段中,IP 地址的主机位为其设备编号,如 R3 的 g0/0 接口若在192.168.1.0/24[1]网段,则其 IP 地址为192.168.1.3/24[2],以此类推
实验需求
按照图示配置 IP 地址
sw2和sw10使用链路聚合
四个部门:地址为dhcp获取
sw2,r13,sw10,运行ospf,使其内网互通,ospf使用命令下发缺省网关
R13与R14采用双向认证。
仅允许技术部和产品研发部方位外网,财务部门访问财务服务器
R11作为ftp服务器,要求外网用户可以访问
实验解法
8,配置 IP 地址部分
R14
sys SystemView:returntoUserViewwithCtrl+Z. [H3C]sysnr14 [r14]intmp-gr1 [r14-MP-group1]ints1/0 [r14-Serial1/0]pppmpmp-gr1 [r14-Serial1/0] [r14-Serial1/0]ints2/0 [r14-Serial2/0]pppmpmp-gr1 [r14]intmp-gr1 [r14-MP-group1]ipadd100.1.1.224
R13
SYS [H3C]SYSNr13 [r13]intmp-gr1 [r13-MP-group1]ints1/0 [r13-Serial1/0]pppmpmp-gr1 [r13-Serial1/0]ints2/0 [r13-Serial2/0]pppmpmp-gr1 [r13-Serial2/0]intmp-gr1 [r13-MP-group1]ipadd100.1.1.124 [r13]intg0/0 [r13-GigabitEthernet0/0]ipadd192.168.60.224 [r13-GigabitEthernet0/0]intg0/1 [r13-GigabitEthernet0/1]ipadd192.168.70.224
SW2
sys SystemView:returntoUserViewwithCtrl+Z. [H3C]syssw2 [sw2]vlan10 [sw2-vlan10]vlan20 [sw2-vlan20]vlan30 [sw2-vlan30]vlan40 [sw2-vlan40]vlan50 [sw2-vlan50]vlan60 [sw2-vlan60]intvlan10 [sw2-Vlan-interface10]ipadd192.168.1.25424 [sw2-Vlan-interface10]intvlan20 [sw2-Vlan-interface20]ipadd192.168.2.25424 [sw2-Vlan-interface20]intvlan30 [sw2-Vlan-interface30]ipadd192.168.3.25424 [sw2-Vlan-interface30]intvlan40 [sw2-Vlan-interface40]ipadd192.168.4.25424 [sw2-Vlan-interface40]intvlan50 [sw2-Vlan-interface50]ipadd192.168.50.124 [sw2-Vlan-interface50]intvlan60 [sw2-Vlan-interface60]ipadd192.168.60.124 [sw2-Vlan-interface60]intg1/0/5 [sw2-GigabitEthernet1/0/5]portlink-tyac [sw2-GigabitEthernet1/0/5]portacvlan60 [sw2]intrangeg1/0/1tog1/0/2 [sw2-if-range]porttrpevlanall
SW10
SYS SystemView:returntoUserViewwithCtrl+Z. [H3C]SYSNsw10 [sw10]vlan10 [sw10-vlan10]vlan20 [sw10-vlan20]vlan50 [sw10-vlan50]vlan70 [sw10-vlan70]intvlan10 [sw10-Vlan-interface10]ipadd192.168.80.224 [sw10-Vlan-interface10]intvlan20 [sw10-Vlan-interface20]ipadd192.168.90.224 [sw10-Vlan-interface20]intvlan50 [sw10-Vlan-interface50]ipadd192.168.50.224 [sw10-Vlan-interface50]intvlan70 [sw10-Vlan-interface70]ipadd192.168.70.124 [sw10-Vlan-interface70]intrang1/0/1tog1/0/2 [sw10-if-range]portlink-tyac [sw10-if-range]intg1/0/1 [sw10-GigabitEthernet1/0/1]portacvlan10 [sw10-GigabitEthernet1/0/1]intg1/0/2 [sw10-GigabitEthernet1/0/2]portacvlan20
SW1
SYS SystemView:returntoUserViewwithCtrl+Z. [H3C]SYSNSW1 [SW1]vlan10 [SW1-vlan10]vlan20 [SW1]INTG1/0/4 [SW1-GigabitEthernet1/0/4]portlink-tytr [SW1-GigabitEthernet1/0/4]porttrpevlanall [SW1-vlan20]intrang1/0/1tog1/0/2 [SW1-if-range]portlink-tyaccess [SW1-if-range]portacvlan10 [SW1-if-range]intg1/0/3 [SW1-GigabitEthernet1/0/3]portlink-tyacc [SW1-GigabitEthernet1/0/3]portacvlan20
SW3
SYS SystemView:returntoUserViewwithCtrl+Z. [H3C]SYSNSW3 [SW3-vlan20]intg1/0/4 [SW3-GigabitEthernet1/0/4]portlink-tytr [SW3-GigabitEthernet1/0/4]porttrpevlanall [SW3-GigabitEthernet1/0/1]portlink-tyac [SW3-GigabitEthernet1/0/1]portacvlan30 [SW3-GigabitEthernet1/0/1]intrang1/0/2tog1/0/3 [SW3-if-range]portlink-tyac [SW3-if-range]portacvlan40
R11(路由作为电脑设备使用需要增加缺省路由,服务器系统自动添加,这个只是模拟器,你自己的电脑也会添加缺省路由来上网,模拟器需要自己手动配置下)
SYS SystemView:returntoUserViewwithCtrl+Z. [H3C]SYSNR11 [R11]intg0/0 [R11-GigabitEthernet0/0]ipadd192.168.80.124 [R11]iproute-static0.0.0.00.0.0.0192.168.80.2
R12
SYS SystemView:returntoUserViewwithCtrl+Z. [H3C]SYSNR12 [R12]intg0/0 [R12-GigabitEthernet0/0]ipadd192.168.90.124 [R12]iproute-static0.0.0.00.0.0.0192.168.90.2
PC4-PC9(DHCP分配地址)
9,sw2和sw10使用链路聚合
步骤 1:在 SW2上创建 聚合组,并添加端口,双方都建立后不会警告(默认vlan)PVID不匹配
SW2
sys SystemView:returntoUserViewwithCtrl+Z. [sw2]intBridge-Aggregation1 [sw2-Bridge-Aggregation1]intrang1/0/3tog1/0/4 [sw2-if-range]portlink-agggr1 [sw2-if-range]intBridge-Aggregation1 [sw2-Bridge-Aggregation1]portlink-typeac ConfiguringGigabitEthernet1/0/3done. ConfiguringGigabitEthernet1/0/4done. [sw2-Bridge-Aggregation1]portacvlan50 ConfiguringGigabitEthernet1/0/3done. ConfiguringGigabitEthernet1/0/4done.
步骤2:在 SW10上创建 聚合组,并添加端口
SW10
SYS SystemView:returntoUserViewwithCtrl+Z. [sw10]intBridge-Aggregation1. [sw10-Bridge-Aggregation1]intrang1/0/3tog1/0/4 [sw10-if-range]portlink-agggr1 [sw10-if-range]intBridge-Aggregation1 [sw10-Bridge-Aggregation1]portlink-tyac ConfiguringGigabitEthernet1/0/3done. ConfiguringGigabitEthernet1/0/4done. [sw10-Bridge-Aggregation1]portacvlan50 ConfiguringGigabitEthernet1/0/3done. ConfiguringGigabitEthernet1/0/4done.
10,四个部门:地址为dhcp获取
步骤 1:在 SW2上创建 DHCP地址池,网关为vlan地址,开启DHCP全局模式,不同vlan配置不同的地址池,dns设置为114.114.114.114[3]
[sw2]dhcpenable [sw2]dhcpserveripvlan10 [sw2-dhcp-pool-vlan10]netw192.168.1.0ma255.255.255.0 [sw2-dhcp-pool-vlan10]gat192.168.1.254 [sw2-dhcp-pool-vlan10]dns114.114.114.114 [sw2-dhcp-pool-vlan10]dhcpseripvlan20 [sw2-dhcp-pool-vlan20]netw192.168.2.0ma255.255.255.0 [sw2-dhcp-pool-vlan20]gat192.168.2.254 [sw2-dhcp-pool-vlan20]dns114.114.114.114 [sw2-dhcp-pool-vlan20]dhcpseripvlan30 [sw2-dhcp-pool-vlan30]netw192.168.3.0ma255.255.255.0 [sw2-dhcp-pool-vlan30]gat192.168.3.254 [sw2-dhcp-pool-vlan30]dns114.114.114.114 [sw2]dhcpseripvlan40 [sw2-dhcp-pool-vlan40]netw192.168.4.0ma255.255.255.0 [sw2-dhcp-pool-vlan40]gat192.168.4.254 [sw2-dhcp-pool-vlan40]dns114.114.114.114
步骤 2:查看各个部门的电脑ip已经自动分配或者使用dis arp all 命令也可以查询
11,sw2,r13,sw10,运行ospf,使其内网互通,ospf使用命令下发缺省网关
R13(ospf下发缺省路由指向互联网)
[r13]ospf [r13-ospf-1]a0 [r13-ospf-1-area-0.0.0.0]netw192.168.60.20.0.0.0 [r13-ospf-1-area-0.0.0.0]netw192.168.70.20.0.0.0 [r13-ospf-1-area-0.0.0.0]netw100.1.1.10.0.0.0 [r13-ospf-1-area-0.0.0.0]q [r13-ospf-1]q [r13]iproute-static0.0.0.00.0.0.0100.1.1.2 [r13]ospf [r13-ospf-1]default-route-advertise
SW2
[sw2]ospf [sw2-ospf-1]a0 [sw2-ospf-1-area-0.0.0.0]netw192.168.1.2540.0.0.0 [sw2-ospf-1-area-0.0.0.0]netw192.168.2.2540.0.0.0 [sw2-ospf-1-area-0.0.0.0]netw192.168.3.2540.0.0.0 [sw2-ospf-1-area-0.0.0.0]netw192.168.4.2540.0.0.0 [sw2-ospf-1-area-0.0.0.0]netw192.168.50.10.0.0.0 [sw2-ospf-1-area-0.0.0.0]netw192.168.60.10.0.0.0
SW10
[sw10]ospf [sw10-ospf-1]a0 [sw10-ospf-1-area-0.0.0.0]netw192.168.80.20.0.0.0 [sw10-ospf-1-area-0.0.0.0]netw192.168.90.20.0.0.0 [sw10-ospf-1-area-0.0.0.0]netw192.168.50.20.0.0.0 [sw10-ospf-1-area-0.0.0.0]netw192.168.70.10.0.0.0
12,R13与R14采用双向认证。
步骤一:创建用户han,密码为123,设置为用户名单,直接修改端口模式为chap,直接调用用户名单进行双向验证,端口切记关闭在开启才能生效
R13
[r13]local-userhanclanetw Newlocaluseradded. [r13-luser-network-han]passi123 [r13-luser-network-han]serppp [r13]ints1/0 [r13-Serial1/0]pppauthchap [r13-Serial1/0]pppchapuserhan [r13-Serial1/0]ints2/0 [r13-Serial2/0]pppauthchap [r13-Serial2/0]pppchapuserhan
R14
[r14]local-userhanclanetw Newlocaluseradded. [r14-luser-network-han]passi123 [r14-luser-network-han]serppp [r14]ints1/0 [r14-Serial1/0]pppauthchap [r14-Serial1/0]pppchapuserhan [r14-Serial1/0]ints2/0 [r14-Serial2/0]pppauthchap [r14-Serial2/0]pppchapuserhan
仅允许技术部和产品研发部方位外网,只允许财务部门访问财务服务器
步骤一,使用acl策略匹配技术部与产品研发部的流量,在验证mp-group使用简单nat进行外网访问控制
R13
[r13]aclbasic2000 [r13-acl-ipv4-basic-2000]rulepersource192.168.2.00.0.0.255 [r13-acl-ipv4-basic-2000]rulepermitsource192.168.4.00.0.0.255 [r13]intMP-group1 [r13-MP-group1]natoutbound2000
sw10
步骤二利用acl策略匹配流量,第一条如果没有匹配上会进行第二条,只会生效一条,注意顺序,vlan调用acl为出口方向(答案不唯一多种方式都可以)
[sw10]aclbasic2000 [sw10-acl-ipv4-basic-2000]ruledenysource192.168.1.00.0.0.255 [sw10-acl-ipv4-basic-2000]ruledenysource192.168.2.00.0.0.255 [sw10-acl-ipv4-basic-2000]ruledenysource192.168.4.00.0.0.255 [sw10]intvlan20 [sw10-Vlan-interface20]packet-filter2000out
13,R11作为ftp服务器,要求外网用户可以访问
步骤一,创建ftp服务器,密码为1234,用户名为hany
R11
[R11]ftpseren [R11]local-userhanyclassmanage Newlocaluseradded. [R11-luser-manage-han]passim1234 [R11-luser-manage-han]authorization-attributeuser-rolelevel-15 [R11-luser-manage-han]service-typeftp
步骤二:在 R3 的公网接口上配置 NAT SERVER,映射端口 20 和 21,这里映射ftp服务器的地址为192.168.80.1,映射后地址为R3外网出口地址
[r13]intmp-gr1 [r13-MP-group1]natserprotcpglobalcurrent-interface2021inside192.168.80.12021
最后在R14上测试ftp登录正常
vlan10 vlan20 vlan 40无法访问财务服务器
审核编辑:汤梓红
-
服务器
+关注
关注
12文章
8933浏览量
85049 -
FTP
+关注
关注
0文章
106浏览量
40563 -
ip地址
+关注
关注
0文章
290浏览量
16985 -
命令
+关注
关注
5文章
674浏览量
21962
原文标题:H3CNE综合小实验,值得一试!
文章出处:【微信号:网络技术干货圈,微信公众号:网络技术干货圈】欢迎添加关注!文章转载请注明出处。
发布评论请先 登录
相关推荐
评论