前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >企业网络配置ensp模拟

企业网络配置ensp模拟

作者头像
网络工程师笔记
发布2024-05-23 12:58:03
1510
发布2024-05-23 12:58:03
举报

企业网络拓扑

拓扑需求

交换部分:

1.将SW1-SW2间的e0/0/5、e0/0/6配置为手工方式的eth-trunk,链路编号为eth-trunk 12

2.将SW1、SW2、SW3、SW4间的所有链路配置为trunk

3.在SW1、SW2、SW3、SW4上创建vlan10、vlan20、vlan11、vlan12:

4.在SW1、SW2、SW3、SW4上开启STP协议

5.将SW1设置为所有VLAN的根交换机,将SW2设置为所有VLAN的备份根交换机

6.将PC3、PC4划入vlan10、将PC7、PC8划入vlan20:

路由部分:

1.IP地址规划如下:

vlan10 ----------- 10.1.10.0/24

vlan20 ----------- 10.1.20.0/24

vlan11 ----------- 10.1.11.0/24

vlan12 ----------- 10.1.12.0/24

R1-R2 ------------ 12.1.1.0/24

R2-Client2 ------------ 20.1.1.0/24

2.将SW1设置为vlan10、vlan20的网关,IP地址为vlan对应网段的最后一个可用IP

3.将SW2设置为vlan10、vlan20的备份网关,IP地址为vlan对应网段的倒数第二个可用IP:

4.将SW1的e0/0/1接口划入vlan11,并为vlan11配置对应网段的第一个可用IP:

5.将SW2的e0/0/1接口划入vlan12,并为vlan12配置对应网段的第一个可用IP:

6.将R1的g0/0/0接口IP配置为10.1.11.0/24网段的最后一个可用IP:

7.将R1的g0/0/1接口IP配置为10.1.12.0/24网段的最后一个可用IP:

8.配置R1-R2相连接口的IP地址,R1配置网段第一个可用IP,R2配置网段第二个可用IP:

9.配置R2-Client2相连接口的IP地址,Client2配置网段第一个可用IP,R2配置网段最后一个可用IP

10.在SW1、SW2、R1间运行OSPF 100,将vlan10、vlan20、vlan11、vlan12对应网段宣告进area0

11.在R1上添加缺省静态路由,将下一跳指向R2

12.在R1上将缺省静态路由发布进OSPF 100

13.在R1-R2间运行OSPF 200,将R1-R2间网段以及R2-Client2间网段宣告进area0

访问控制部分:

1.在R1上配置PAT,让vlan10、vlan20内的所有主机共用12.1.1.10/24这个IP访问Client2

2.要求vlan10内的主机可以访问Client2的web服务,但不能访问Client2的ftp服务;

vlan20内的主机可以访问Client2的ftp服务,但不能访问Client2的web服务

其余流量不做限制:

SW1配置

代码语言:javascript
复制
vlan batch 10 to 12 20
stp mode stp
stp instance 0 priority 0
interface Vlanif10
 ip address 10.1.10.254 255.255.255.0
#
interface Vlanif11
 ip address 10.1.11.1 255.255.255.0
#
interface Vlanif20
 ip address 10.1.20.254 255.255.255.0

interface Eth-Trunk12
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/1
 port link-type access
 port default vlan 11

interface Ethernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/5
 eth-trunk 12
#
interface Ethernet0/0/6
 eth-trunk 12

ospf 100 router-id 1.1.1.1
 area 0.0.0.0
  network 10.1.10.0 0.0.0.255
  network 10.1.20.0 0.0.0.255
  network 10.1.11.0 0.0.0.255
#

SW2配置

代码语言:javascript
复制
vlan batch 10 to 12 20stp mode stp
stp instance 0 priority 4096

interface Vlanif10
 ip address 10.1.10.253 255.255.255.0
#
interface Vlanif12
 ip address 10.1.12.1 255.255.255.0
#
interface Vlanif20
 ip address 10.1.20.253 255.255.255.0

interface Eth-Trunk12
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/1
 port link-type access
 port default vlan 12

interface Ethernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
interface Ethernet0/0/5
 eth-trunk 12
#
interface Ethernet0/0/6
 eth-trunk 12

ospf 100 router-id 2.2.2.2
 area 0.0.0.0
  network 10.1.10.0 0.0.0.255
  network 10.1.20.0 0.0.0.255
  network 10.1.12.0 0.0.0.255

SW3配置

代码语言:javascript
复制
vlan batch 10 to 12 20
stp mode stp
 interface Ethernet0/0/1 
port link-type access 
port default vlan 10 
interface Ethernet0/0/2 
port link-type access 
port default vlan 20 
interface Ethernet0/0/3 
port link-type trunk 
port trunk allow-pass vlan 2 to 4094

interface Ethernet0/0/4

 port link-type trunk port 
trunk allow-pass vlan 2 to 4094

SW4配置

代码语言:javascript
复制
vlan batch 10 to 12 20
stp mode stp
interface Ethernet0/0/1

 port link-type access
 port default vlan 10 
 interface Ethernet0/0/2 
port link-type access 
port default vlan 20

interface Ethernet0/0/3

 port link-type trunk
 port trunk allow-pass vlan 2 to 4094 
interface Ethernet0/0/4 
port link-type trunk 
port trunk allow-pass vlan 2 to 4094

AR1配置

代码语言:javascript
复制
acl number 2000  
 rule 5 permit source 10.1.10.0 0.0.0.255 
 rule 10 permit source 10.1.20.0 0.0.0.255 
#
acl number 3000  
 rule 5 permit tcp source 10.1.10.0 0.0.0.255 destination 20.1.1.1 0 destination
-port eq www 
 rule 10 deny tcp source 10.1.10.0 0.0.0.255 destination 20.1.1.1 0 destination-
port eq ftp 
 rule 15 permit tcp source 10.1.20.0 0.0.0.255 destination 20.1.1.1 0 destinatio
n-port eq ftp 
 rule 20 deny tcp source 10.1.20.0 0.0.0.255 destination 20.1.1.1 0 destination-
port eq www 

nat address-group 0 12.1.1.10 12.1.1.10
#
interface GigabitEthernet0/0/0
 ip address 10.1.11.254 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 10.1.12.254 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 12.1.1.1 255.255.255.0 
 traffic-filter outbound acl 3000
 nat outbound 2000 address-group 0 

ospf 100 router-id 3.3.3.3 
 default-route-advertise
 area 0.0.0.0 
  network 10.1.11.0 0.0.0.255 
  network 10.1.12.0 0.0.0.255 
#
ospf 200 router-id 3.3.3.3 
 area 0.0.0.0 
  network 12.1.1.0 0.0.0.255 
#
ip route-static 0.0.0.0 0.0.0.0 12.1.1.2

AR2配置

代码语言:javascript
复制
interface GigabitEthernet0/0/0
 ip address 20.1.1.254 255.255.255.0 

interface GigabitEthernet0/0/2
 ip address 12.1.1.2 255.255.255.0 

ospf 200 router-id 5.5.5.5 
 area 0.0.0.0 
  network 12.1.1.0 0.0.0.255 
  network 20.1.1.0 0.0.0.255

---END--

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2024-05-22,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 网络工程师笔记 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档