园区网的搭建

image.png

保存配置的命令:

save all test.cfg

步骤一.配置STP和Eth_Trunk

核心设备LSW1:

stp root primary

边缘设备LSW2 3 4 5:

port-group group-member e0/0/1 to e0/0/22
stp edged-port enable 

边缘交换机与核心交换机建立Eth-Trunk
例如LSW2建立Eth-Trunk

interface Eth-Trunk 2
mode lacp-static
trunkport gi 0/0/1 0/0/2
stp cost 10000

步骤二.设置vlan

接入层是access

vlan batch 10 20
port link-type access
port default vlan 10

接入层交换机干路设置:

interface Eth-Trunk 3
port link-type trunk
port trunk allow-pass  vlan  all

核心层交换机干路设置:

port-group group-member Eth-Trunk 2 to Eth-Trunk 5
port link-type trunk
port trunk allow-pass  vlan  all

步骤三:配置网关

配置vlan10网关,其他类似

interface Vlanif 10
ip address 192.168.10.1 24

interface Vlanif 20
ip address 192.168.20.1 24

interface Vlanif 30
ip address 192.168.30.1 24

interface Vlanif 40
ip address 192.168.40.1 24

interface Vlanif 200
ip address 192.168.200.1 24

核心交换机S1和出口路由R1的对接

S1:
vlan 800
q
interface gi 0/0/24
port link-type access
port default vlan 800
q
interface Vlanif 800
ip address 192.168.254.2 24

步骤四:DHCP配置

dhcp enable

销售部1和销售部2
ip pool XiaoShou_1
network 192.168.10.0 mask 24
gateway-list 192.168.10.1
dns-list 114.114.114.114 8.8.8.8

ip pool XiaoShou_2
network 192.168.20.0 mask 24
gateway-list 192.168.20.1
dns-list 114.114.114.114 8.8.8.8

财务部
ip pool CaiWu
network 192.168.30.0 mask 24
gateway-list 192.168.30.1
dns-list 114.114.114.114 8.8.8.8

技术部
ip pool JiShu
network 192.168.40.0 mask 24
gateway-list 192.168.40.1
dns-list 114.114.114.114 8.8.8.8

对应vlanif要配置

interface Vlanif 10
dhcp select global

interface Vlanif 20
dhcp select global

interface Vlanif 30
dhcp select global

interface Vlanif 40
dhcp select global

步骤五.设置NAT

配置核心交换机的静态路由到出口路由

ip route-static 0.0.0.0 0 192.168.254.1

出口路由器配置路由到运营商路由器

ip route-static 0.0.0.0 0 12.1.1.6

出口路由器配置路由到内网

ip route-static 192.168.0.0 16 192.168.254.2

配置出口路由器nat

#设置访问控制列表
acl 2000
rule permit source 192.168.0.0 0.0.255.255
interface gi 0/0/1
nat outbound 2000

步骤六.服务器端口映射

nat server protocol tcp global 12.1.1.2 inside 192.168.200.10

步骤七.ACL

让服务器192.168.200.20只能让vlan30的用户能够访问

acl 3000
rule permit ip source 192.168.30.0 0.0.0.255 destination 192.168.200.20 0
rule deny ip source any destination 192.168.200.20

步骤八.telnet管理

配置telnet

telnet server enable
aaa
local-user aa privilege level 3 password  cipher 123
local-user aa service-type telnet 
q
user-interface vty 0 4
authentication-mode aaa

增加vlan999作为管理vlan,接入层路由器还需要配置ip和路由

vlan 999
interface Vlanif 999
ip address 192.168.253.1 24

vlan 999
interface Vlanif 999
ip address 192.168.253.2 24

vlan 999
interface Vlanif 999
ip address 192.168.253.3 24

vlan 999
interface Vlanif 999
ip address 192.168.253.4 24

vlan 999
interface Vlanif 999
ip address 192.168.253.5 24
ip route-static 0.0.0.0 0 192.168.253.1

#交换机配置缺省路由,用于回包
ip route-static 0.0.0.0 0 192.168.253.1
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • IP 地址与路由控制 IP地址的网络地址这一部分是用于进行路由控制。 路由控制表中记录着网络地址与下一步应该发送至...
    TimLi_51bb阅读 1,034评论 1 4
  • 本文遵循「知识共享许可协议 CC-BY-NC-SA 4.0 International」,未经作者书面许可,不允许...
    laiwei阅读 11,864评论 1 24
  • 1、实验目标: (1)通过组网设计,掌握小型网络的组建、路由的设计,对小型网络系统进行分析,提 出建网解决方...
    GBde135147阅读 3,660评论 0 3
  • 一、Linux Bridge网桥管理 网络虚拟化是虚拟化技术中最复杂的部分,也是非常重要的资源。第一节中我们创建了...
    WickJohn阅读 1,195评论 0 1
  • 不知到该怎么吐槽,不过结局还好是我所期待的那样:本来想着早点准备可以留出更多的时间干其它的,结果奈何我们是在317...
    kuriyama阅读 423评论 0 0