华为NAT+VLAN+路由+三层交换典型配置实例.docVIP

  • 33
  • 0
  • 约3.5千字
  • 约 4页
  • 2019-10-11 发布于江西
  • 举报

华为NAT+VLAN+路由+三层交换典型配置实例.doc

VLAN+路由器典型配置实例 近期看到有些朋友问交换机划 VLAN 后接路由器如何配置访问外网,其实这是个比较简单,也比较典型的配置。网上也很容易找到,但都不系统很零散。这里针对几种常见的情况,分别做了配置: 1、 拓扑结构图: 1) 本例中的路由器均为华为 AR28-10,交换机 SW1为华为的 S3526 带3 层交换功能,SW2为华为 2403H-EI二层交换机。 2) 图模拟了常见的拓扑结构。也没有用到任何厂商特性,因此也适用于其他厂商的设备,只是命令行有所不同。 2、基础配置: ISP: interface Serial0/0 #配置和RA相连的接口 clock DTECLK1 link-protocol ppp ip address 10.0.1.1 255.255.255.252 interface LoopBack0 #配置该接口模拟 internet 的一个 IP。 ip address 1.1.1.1 255.255.255.255 ip route-static 59.61.94.144 255.255.255.248 10.0.1.2 preference 60 #将该地址段指向 RA,也即分配地址池给 RA。 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#启

文档评论(0)

1亿VIP精品文档

相关文档