网络设备配置与管理-综合实验1

实验任务

(1)实现不同vlan之间互访。
(2)SW1、SW2和SW3之间实现高速双链路。
(3)利用动态路由实现内部网络互联互通
(4)VLAN10-30互访
(5)VLAN40只能访问财务服务器
(6)VLAN30可以访问FTP和WEB
(7)VLAN10和VLAN20可以访问FTP服务器
这个任务有点凑数的嫌疑。。。且不管这个。

实验拓扑

在这里插入图片描述

实验过程

S1:
Switch>en
Switch#conf
Switch#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#in
Switch(config)#interface f0/10
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport mode a
Switch(config-if)#switchport mode access
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface r
Switch(config)#interface range f0/1-2
Switch(config-if-range)#sw
Switch(config-if-range)#switchport m
Switch(config-if-range)#switchport mode t
Switch(config-if-range)#switchport mode trunk

Switch(config-if-range)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up

Switch(config-if-range)#
Switch(config-if-range)#chanee
Switch(config-if-range)#channe
Switch(config-if-range)#channel
Switch(config-if-range)#channel-g
Switch(config-if-range)#channel-group 1 mo
Switch(config-if-range)#channel-group 1 mode on
Switch(config-if-range)#channel-group 1 mode on
Switch(config-if-range)#
Creating a port-channel interface Port-channel 1

%LINK-5-CHANGED: Interface Port-channel 1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel 1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up

Switch(config-if-range)#exit

S2:
Switch>en
Switch#conf
Switch#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#in
Switch(config)#interface f0/10
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport mode a
Switch(config-if)#switchport mode access
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface f0/3
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport mode t
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%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 up

Switch(config-if)#exit

S3:
Switch>en
Switch#conf
Switch#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 30
Switch(config-vlan)#exit
Switch(config)#in
Switch(config)#interface f0/10
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport mode a
Switch(config-if)#switchport mode access
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport a
Switch(config-if)#switchport access vlan 30
Switch(config-if)#exit
Switch(config)#
Switch(config)#in
Switch(config)#interface f0/4
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport mode t
Switch(config-if)#switchport mode trunk

Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up

Switch(config-if)#exit

S4:
Switch>en
Switch#cong
Switch#conf
Switch#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 40
Switch(config-vlan)#exit
Switch(config)#in
Switch(config)#interface f0/10
Switch(config-if)#sw
Switch(config-if)#switchport m
Switch(config-if)#switchport mode a
Switch(config-if)#switchport mode access
Switch(config-if)#sw
Switch(config-if)#switchport a
Switch(config-if)#switchport access vlan 40
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface r
Switch(config)#interface range f0/5-6
Switch(config-if-range)#sw
Switch(config-if-range)#switchport m
Switch(config-if-range)#switchport mode t
Switch(config-if-range)#switchport mode trunk

Switch(config-if-range)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up

Switch(config-if-range)#channel
Switch(config-if-range)#channel-g
Switch(config-if-range)#channel-group 2 mo
Switch(config-if-range)#channel-group 2 mode on
Switch(config-if-range)#
Creating a port-channel interface Port-channel 2

%LINK-5-CHANGED: Interface Port-channel 2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel 2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up

Switch(config-if-range)#
Switch(config-if-range)#exit

三层交换机:
Switch>en
Switch#conf
Switch#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#ip routing
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#vlan 30
Switch(config-vlan)#exit
Switch(config)#vlan 40
Switch(config-vlan)#exit
Switch(config)#in
Switch(config)#in
Switch(config)#interface vlan 10
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

Switch(config-if)#ip add
Switch(config-if)#ip address 99.1.10.254 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface vlan 20
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

Switch(config-if)#ip ad
Switch(config-if)#ip address 99.1.20.254 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface vlan 30
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan30, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up

Switch(config-if)#ip ad
Switch(config-if)#ip address 99.1.30.254 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface vlan 40
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan40, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan40, changed state to up

Switch(config-if)#ip ad
Switch(config-if)#ip address 99.1.40.254 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit

Switch(config)#interface r
Switch(config)#interface range f0/1-2
Switch(config-if-range)#sw
Switch(config-if-range)#switchport t
Switch(config-if-range)#switchport trunk e
Switch(config-if-range)#switchport trunk encapsulation
Switch(config-if-range)#switchport trunk encapsulation dot1q
Switch(config-if-range)#sw
Switch(config-if-range)#switchport m
Switch(config-if-range)#switchport mode t
Switch(config-if-range)#switchport mode trunk
Switch(config-if-range)#channel
Switch(config-if-range)#channel-g
Switch(config-if-range)#channel-group 1 mod
Switch(config-if-range)#channel-group 1 mode on
Switch(config-if-range)#
Creating a port-channel interface Port-channel 1

%LINK-5-CHANGED: Interface Port-channel 1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel 1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up

Switch(config-if-range)#
Switch(config-if-range)#exit
Switch(config)#in
Switch(config)#in
Switch(config)#interface f0/3
Switch(config-if)#sw
Switch(config-if)#switchport t
Switch(config-if)#switchport trunk en
Switch(config-if)#switchport trunk encapsulation
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface f0/4
Switch(config-if)#sw
Switch(config-if)#switchport t
Switch(config-if)#switchport trunk e
Switch(config-if)#switchport trunk encapsulation
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#exit
Switch(config)#in
Switch(config)#interface r
Switch(config)#interface range f0/5-6
Switch(config-if-range)#sw
Switch(config-if-range)#switchport en
Switch(config-if-range)#switchport t
Switch(config-if-range)#switchport trunk en
Switch(config-if-range)#switchport trunk encapsulation
Switch(config-if-range)#switchport trunk encapsulation dot1q
Switch(config-if-range)#sw
Switch(config-if-range)#switchport m
Switch(config-if-range)#switchport mode t
Switch(config-if-range)#switchport mode trunk
Switch(config-if-range)#channel-g
Switch(config-if-range)#channel-group 2 mo
Switch(config-if-range)#channel-group 2 mode on
Switch(config-if-range)#
Creating a port-channel interface Port-channel 2

%LINK-5-CHANGED: Interface Port-channel 2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel 2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to up

Switch(config-if-range)#exit

Switch(config)#interface f0/10
Switch(config-if)#no sw
Switch(config-if)#no switchport
Switch(config-if)#ip ad
Switch(config-if)#ip address 99.1.100.1 255.255.255.0
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#
%LINK-5-CHANGED: Interface FastEthernet0/10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/10, changed state to up

Switch(config)#
Switch(config)#rotu
Switch(config)#rout
Switch(config)#router r
Switch(config)#router rip
Switch(config-router)#ne
Switch(config-router)#network 99.1.100.0
Switch(config-router)#network 99.1.10.0
Switch(config-router)#network 99.1.20.0
Switch(config-router)#network 99.1.30.0
Switch(config-router)#network 99.1.40.0
Switch(config-router)#

Switch(config)#ip route 0.0.0.0 0.0.0.0 99.1.100.2
Switch(config)#

R0:

Router(config)#router rip
Router(config-router)#net
Router(config-router)#network 99.1.100.0
Router(config-router)#network 99.1.101.0
Router(config)#router rip
Router(config-router)#n
Router(config-router)#ne
Router(config-router)#network 99.1.102.0
Router(config-router)#

Router#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip route 0.0.0.0 0.0.0.0 99.1.102.2

Vlan40 只可以访问财务服务器:
Router(config)#access-list 100 deny tcp 99.1.40.0 0.0.0.255 host 99.1.101.1 eq ftp
Router(config)#access-list 100 deny tcp 99.1.40.0 0.0.0.255 host 99.1.101.3 eq www
Router(config)#access-list 100 p
Router(config)#access-list 100 permit ip a
Router(config)#access-list 100 permit ip any a
Router(config)#access-list 100 permit ip any any
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#
Router#conf
Router#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#in
Router(config)#interface g0/1
Router(config-if)#ac
Router(config-if)#acc
Router(config-if)#ip ac
Router(config-if)#ip access-group 100 out
Router(config-if)#
Router(config-if)#exit

R1:
Router(config)#router rip
Router(config-router)#net
Router(config-router)#network 99.1.102.0

Router(config)#acc
Router(config)#access-list 10 p
Router(config)#access-list 10 permit 99.1.10.0 0.0.0.255
Router(config)#access-list 10 permit 99.1.20.0 0.0.0.255
Router(config)#access-list 10 permit 99.1.30.0 0.0.0.255
Router(config)#access-list 10 d
Router(config)#access-list 10 deny a
Router(config)#access-list 10 deny any
Router(config)#ip nat
Router(config)#ip nat p
Router(config)#ip nat pool zlk 210.41.2.3 210.41.2.100 n
Router(config)#ip nat pool zlk 210.41.2.3 210.41.2.100 netmask 255.255.255.0
Router(config)#ip nat in
Router(config)#ip nat inside s
Router(config)#ip nat inside source l
Router(config)#ip nat inside source list 10 p
Router(config)#ip nat inside source list 10 pool zlk
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console

Router#con
Router#conf
Router#configure r
^
% Invalid input detected at ‘^’ marker.
Router#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#in
Router(config)#interface g0/0
Router(config-if)#ip na
Router(config-if)#ip nat in
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#in
Router(config)#interface g0/0/0
%Invalid interface type and number
Router(config)#interface s0/0/0
%Invalid interface type and number
Router(config)#interface g0/1
Router(config-if)#ip na
Router(config-if)#ip nat ou
Router(config-if)#ip nat outside
Router(config-if)#exit

Router(config)#
Router(config)#
Router(config)#ip route 0.0.0.0 0.0.0.0 210.41.2.2
Router(config)#

R2:
Router(config)#router rip
Router(config-router)#net
Router(config-router)#network 210.41.2.0
Router(config-router)#network 180.97.33.0
Router(config-router)#

实验验证

不同vlan可以通信
在这里插入图片描述
可以和服务器通信:
在这里插入图片描述
Vlan10-30访问互联网:
在这里插入图片描述
Vlan40不能访问互联网:
在这里插入图片描述
Vlan40 不可以访问FTP服务器和web服务器:
在这里插入图片描述
在这里插入图片描述
可以访问财务服务器:
在这里插入图片描述

结语

通过三层交换机实现不通vlan之间的通信。

  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值