新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 网络学院 > 网络应用 > 路由技术 > 正文:详解:VLAN+路由器典型配置实例

详解:VLAN+路由器典型配置实例

新客网 XKER.COM 2008-05-13 来源:互联网实验室 收藏本文

RA:

nat address-group 0 59.61.94.145 59.61.94.150 #配置NAT 地址池,也即 ISP分配的地址段。(如果外网接口类型为广播,则最好把这些地址配置给 LOOPBACK接口,否则可能不同,但此例是点对点接口,无此问题)

acl number 2000 #配置 NAT 用的 ACL列表
rule 0 permit source 172.16.0.0 0.0.0.255
rule 1 permit source 172.16.1.0 0.0.0.255
rule 2 permit source 10.0.0.0 0.0.0.3

interface Ethernet0/0 #配置内网口
ip address 10.0.0.1 255.255.255.252

interface Serial0/0 #配置外网口
link-protocol ppp
ip address 10.0.1.2 255.255.255.252
nat outbound 2000 address-group 0 #做 NAT,采用先前配置的地址池。

ip route-static 0.0.0.0 0.0.0.0 10.0.1.1 preference 60 配置默认路由

SW1:
gvrp #启用 GVRP 注册协议,用于动态创建 SW2的 VLAN,实现 VLAN 的集中管理。

vlan 2 #创建各 VLAN
vlan 3
vlan 24#因为S3526 不支持被路由接口,因此将 E0/24 划到 VLAN24,给 VLAN24 配置虚接口 IP用于路由。(cisco 则可以在 e0/24接口用 no switchport 配置为被路由接口,直接配置 IP即可)

interface Vlan-interface2 #配置 VLAN 虚接口 IP
ip address 172.16.0.254 255.255.255.0

interface Vlan-interface3 配置 VLAN 虚接口 IP
ip address 172.16.1.254 255.255.255.0

interface Vlan-interface24 配置 VLAN 虚接口 IP
ip address 10.0.0.2 255.255.255.252

interface Ethernet0/1 #划分接口到 VLAN
port access vlan 2

interface Ethernet0/10 #配置和 SW2 互联的 E0/10接口为 Trunk 接口,并启用 GVRP协议。
port link-type trunk
port trunk permit vlan 2 to 3
gvrp registration fixed
gvrp

interface Ethernet0/24 #划分接口到 VLAN

port access vlan 24

SW2:
gvrp#启用 GVRP 协议,接收 SW1 配置的 VLAN

interface Ethernet0/1 #给 VLAN划接口
port access vlan 3

interface Ethernet0/10 #配置和 SW1 相连的 Trunk口,并启用 GVRP
port link-type trunk
port trunk permit vlan 1 to 3
gvrp

共4页: 上一页 [1] [2] [3] [4] 下一页
标签:VLAN   路由器  
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
推荐阅读
阅读排行
随机推荐
实用信息推荐