欢迎访问 生活随笔!

尊龙游戏旗舰厅官网

当前位置: 尊龙游戏旗舰厅官网 > 编程资源 > 编程问答 >内容正文

编程问答

网络设备配置与管理-尊龙游戏旗舰厅官网

发布时间:2025/1/21 编程问答 7 豆豆
尊龙游戏旗舰厅官网 收集整理的这篇文章主要介绍了 网络设备配置与管理--使用vtp实现扩展vlan配置 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

理论学习

问题1:本地vlan和扩展vlan有什么区别?

不需要跨交换机实现vlan中继,所有的vlan配置仅在本地交换机起作用,该种vlan配置方式为本地vlan

需通过vlan中继技术跨交换机实现统一vlan内主机通信的技术称为扩展vlan 

问题2:扩展vlan有哪些实现方式?

1 pvlan技术(private vlan

2 supervlan技术(supervlan)

3 svlan技术(stack vlan

问题3:vtp的含义是什么,有哪些特点?

vtp是一种cisco专有的消息协议,用于域内同步vlan信息(如vlan的添加、删除、或重命名)。配置vtp后,只要在一台交换机上配置vlan信息后,借助vtp即可自动完成网络中所有交换机内的vlan信息同步,实现vlan配置的一致性,以减少网络管理事务的繁琐性。

vtp的特点

l①vtp遵循c/s结构,采用域的管理模式。vtp服务器用于建立、管理和维护vlan信息。vtp客户机加入到域后可自动接收并使用vlan信息,但不能管理vlan(添加、修改、删除)。

l②vtp协议通过组播的方式向域内的交换机传送vlan信息。

l③使用vtp修剪可减少不必要的vlan信息发送到其它交换机,缺省为关闭状态。

问题4:vtp的工作模式有哪些?各有什么含义?

vtp域中,交换机可以工作于如下三种模式。

server模式:交换机配置为vtp server模式,可以为整个vtp域建立、修改和删除vlan信息,并制定其它配置参数。vtp服务器向其它在相同vtp域的交换机宣告自己的vlan配置,是交换机的默认vtp模式。

client模式:充当vtp client模式的交换机不能建立、修改或删除vlan信息,但可以查询和使用vlan信息。

transparent模式:vtp透明模式,配置为该模式的交换机不会加入到vtp域中,既不接收vlan信息也不宣告vlan信息,然而在vtp版本2transparent交换机可以向其中继接口转发它接收到的vtp宣告信息。

 

工作任务描述

某企业现有网络为二层网络结构,有一台三层交换机做核心交换机,下面通过trunk链路连接两台二层交换机作为接入层交换机。其中计财处和业务部分别有一台计算机连接在两台二层交换机上,管理部有一台计算机连接在核心交换机上,现在公司规定各部门之间不能进行网络通信,而部门内部可以通信,考虑如何实现该网络。

工作任务实施

网络拓扑结构设计(粘贴pt的拓扑图)

具体配置

(1) 各个交换机的vtp配置

 

rs:

rs>en

rs#conf t

enter configuration commands, one per line.  end with cntl/z.

rs(config)#h rs

rs(config)#vlan 2

rs(config-vlan)#vlan 3

rs(config-vlan)#vlan 4

rs(config-vlan)#e

rs(config)#vtp m,

rs(config)#vtp m

rs(config)#vtp mode s

rs(config)#vtp mode server 

device mode already vtp server.

rs(config)#vtp d

rs(config)#vtp domain vtp1

domain name already set to vtp1.

rs(config)#int f0/22

rs(config-if)#sw

rs(config-if)#switchport m

rs(config-if)#switchport mode a

rs(config-if)#switchport mode access 

rs(config-if)#sw

rs(config-if)#switchport a

rs(config-if)#switchport access vlan 4

rs(config-if)#int f0/23

rs(config-if)#sw

rs(config-if)#switchport t

rs(config-if)#switchport trunk e

rs(config-if)#switchport trunk encapsulation d

rs(config-if)#switchport trunk encapsulation dot1q 

rs(config-if)#sw

rs(config-if)#switchport m

rs(config-if)#switchport mode r

rs(config-if)#switchport mode t

rs(config-if)#switchport mode trunk 

rs(config-if)#int f0/24

rs(config-if)#sw

rs(config-if)#switchport t

rs(config-if)#switchport trunk e

rs(config-if)#switchport trunk encapsulation d

rs(config-if)#switchport trunk encapsulation dot1q 

rs(config-if)#sw

rs(config-if)#switchport m

rs(config-if)#switchport mode t

rs(config-if)#switchport mode trunk 

rs(config-if)#

 

sw1:

switch>en

switch#conf t

enter configuration commands, one per line.  end with cntl/z.

switch(config)#h sw1

sw1(config)#

sw1(config)#vtp d

sw1(config)#vtp domain c

sw1(config)#vtp domain c

changing vtp domain name from vtp1 to c

sw1(config)#vtp d

sw1(config)#vtp domain vtp1

changing vtp domain name from c to vtp1

sw1(config)#int f0/24

sw1(config-if)#sw

sw1(config-if)#switchport m

sw1(config-if)#switchport mode t

sw1(config-if)#switchport mode trunk 

sw1(config-if)#e

sw1(config)#int f0/1

sw1(config-if)#sw

sw1(config-if)#switchport m

sw1(config-if)#switchport mode a

sw1(config-if)#switchport mode access 

sw1(config-if)#sw

sw1(config-if)#switchport a

sw1(config-if)#switchport access vl

sw1(config-if)#switchport access vlan 2

sw1(config-if)#e

sw1(config)#int f0/2

sw1(config-if)#sw

sw1(config-if)#switchport m

sw1(config-if)#switchport mode a

sw1(config-if)#switchport mode access 

sw1(config-if)#sw

sw1(config-if)#switchport a

sw1(config-if)#switchport access v

sw1(config-if)#switchport access vlan 3

sw1(config-if)#

 

sw2:

switch>en

switch#conf t

enter configuration commands, one per line.  end with cntl/z.

switch(config)#h sw2

sw2(config)#vtp d

sw2(config)#vtp domain c

sw2(config)#vtp domain c

changing vtp domain name from vtp1 to c

sw2(config)#vtp 00:03:42 %dtp-5-domainmismatch: unable to perform trunk negotiation on port fa0/24 because of vtp domain mismatch.

 

m

sw2(config)#vtp mode c

sw2(config)#vtp mode client 

device mode already vtp client.

sw2(config)#vtp d

sw2(config)#vtp domain vtp1

changing vtp domain name from c to vtp1

sw2(config)#int f0/24

sw2(config-if)#sw

sw2(config-if)#switchport ,

sw2(config-if)#switchport m t

sw2(config-if)#int f0/1

sw2(config-if)#sw m a

sw2(config-if)#sw a v2

                     ^

% invalid input detected at '^' marker.


sw2(config-if)#sw a v 2

sw2(config-if)#int f0/2

sw2(config-if)#sw m a

sw2(config-if)#sw a v 3

sw2(config-if)#

 

2)vlan测试

pc>ping 192.168.1.3

 

pinging 192.168.1.3 with 32 bytes of data:

 

reply from 192.168.1.3: bytes=32 time=234ms ttl=128

reply from 192.168.1.3: bytes=32 time=125ms ttl=128

reply from 192.168.1.3: bytes=32 time=109ms ttl=128

reply from 192.168.1.3: bytes=32 time=93ms ttl=128

 

ping statistics for 192.168.1.3:

    packets: sent = 4, received = 4, lost = 0 (0% loss),

approximate round trip times in milli-seconds:

    minimum = 93ms, maximum = 234ms, average = 140ms

 

3)vtp查看

 

rs

 

rs#show vtp status 

vtp version                     : 2

configuration revision          : 0

maximum vlans supported locally : 1005

number of existing vlans        : 8

vtp operating mode              : server

vtp domain name                 : vtp1

vtp pruning mode                : disabled

vtp v2 mode                     : disabled

vtp traps generation            : disabled

md5 digest                      : 0x6f 0xc6 0x69 0xd0 0x95 0x73 0x0f 0xaa 

configuration last modified by 0.0.0.0 at 3-1-93 00:23:34

local updater id is 0.0.0.0 (no valid interface found)

 

sw1

 

switch1#show vtp status 

vtp version                     : 2

configuration revision          : 0

maximum vlans supported locally : 255

number of existing vlans        : 8

vtp operating mode              : client

vtp domain name                 : vtp1

vtp pruning mode                : disabled

vtp v2 mode                     : disabled

vtp traps generation            : disabled

md5 digest                      : 0x6f 0xc6 0x69 0xd0 0x95 0x73 0x0f 0xaa 

configuration last modified by 0.0.0.0 at 3-1-93 00:23:34

 

sw2

 

switch2#show vtp status 

vtp version                     : 2

configuration revision          : 0

maximum vlans supported locally : 255

number of existing vlans        : 8

vtp operating mode              : client

vtp domain name                 : vtp1

vtp pruning mode                : disabled

vtp v2 mode                     : disabled

vtp traps generation            : disabled

md5 digest                      : 0x6f 0xc6 0x69 0xd0 0x95 0x73 0x0f 0xaa 

configuration last modified by 0.0.0.0 at 3-1-93 00:23:34

 

工作扩展

扩展acl的配置

如果上面的任务要求通过某一个vlan实现对所有交换机进行全局管理(比如使用telnet调试),考虑该如何实现?

     具体配置:

rs

building configuration...

 

current configuration : 1492 bytes

!

version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname rs

!

!

!

enable password cisco

!

!

!

ip routing

!

!

!

spanning-tree mode pvst

!

interface fastethernet0/1

!

(省略……)

!

interface fastethernet0/21

!

interface fastethernet0/22

 switchport access vlan 4

 switchport mode access

!

interface fastethernet0/23

 switchport trunk encapsulation dot1q

 switchport mode trunk

!

interface fastethernet0/24

 switchport trunk encapsulation dot1q

 switchport mode trunk

!

interface gigabitethernet0/1

!

interface gigabitethernet0/2

!

interface vlan1

 ip address 192.168.100.1 255.255.255.0

!

interface vlan2

 ip address 192.168.1.254 255.255.255.0

!

interface vlan3

 ip address 192.168.2.254 255.255.255.0

!

interface vlan4

 ip address 192.168.3.254 255.255.255.0

!

ip classless

!

!

line con 0

!

line aux 0

!

line vty 0 4

 password cisco

 login

!

end 

 

 

sw1

 

building configuration...

 

current configuration : 1181 bytes

!

version 12.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname sw1

!

enable password cisco

!

!

spanning-tree mode pvst

!

interface fastethernet0/1

 switchport access vlan 2

 switchport mode access

!

interface fastethernet0/2

 switchport access vlan 3

 switchport mode access

!

interface fastethernet0/3

!

(省略……)

!

interface fastethernet0/23

!

interface fastethernet0/24

 switchport mode trunk

!

interface vlan1

 ip address 192.168.100.2 255.255.255.0

!

ip default-gateway 192.168.100.1

!

!

line con 0

!

line vty 0 4

 password cisco

 login

line vty 5 15

 login

!

!

end

 

 

sw2

 

building configuration...

 

current configuration : 1181 bytes

!

version 12.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname sw2

!

enable password cisco

!

!

spanning-tree mode pvst

!

interface fastethernet0/1

 switchport access vlan 2

 switchport mode access

!

interface fastethernet0/2

 switchport access vlan 3

 switchport mode access

!

interface fastethernet0/3

!

(省略……)

!

interface fastethernet0/23

!

interface fastethernet0/24

 switchport mode trunk

!

interface vlan1

 ip address 192.168.100.3 255.255.255.0

!

ip default-gateway 192.168.100.1

!

!

line con 0

!

line vty 0 4

 password cisco

 login

line vty 5 15

 login

!

!

end

 

 

telnet rs

telnet  sw1


 

telnet sw2

思考问题:

问题1:管理vlan的作业是什么?

 

用来远程管理的,后期维护的时候不用管理员跑到机器跟前,你在网络内任意一台电脑可以登录任意一台网管交换机。

 


转载于:https://blog.51cto.com/shan123/1666103

总结

以上是尊龙游戏旗舰厅官网为你收集整理的网络设备配置与管理--使用vtp实现扩展vlan配置的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得尊龙游戏旗舰厅官网网站内容还不错,欢迎将尊龙游戏旗舰厅官网推荐给好友。

网站地图