论坛
潜水/灌水快乐,沉淀知识,认识更多同行。
ToB圈子
加入IT圈,遇到更多同好之人。
朋友圈
看朋友圈动态,了解ToB世界。
ToB门户
了解全球最新的ToB事件
博客
Blog
排行榜
Ranklist
文库
业界最专业的IT文库,上传资料也可以赚钱
下载
分享
Share
导读
Guide
相册
Album
记录
Doing
应用中心
搜索
本版
文章
帖子
ToB圈子
用户
免费入驻
产品入驻
解决方案入驻
公司入驻
案例入驻
登录
·
注册
账号登录
立即注册
找回密码
用户名
Email
自动登录
找回密码
密码
登录
立即注册
首页
找靠谱产品
找解决方案
找靠谱公司
找案例
找对的人
专家智库
悬赏任务
圈子
SAAS
qidao123.com技术社区-IT企服评测·应用市场
»
论坛
›
虚拟化.超融合.云计算
›
公有云
›
云计算网络vlan拓扑笔记
云计算网络vlan拓扑笔记
麻花痒
论坛元老
|
6 天前
|
显示全部楼层
|
阅读模式
楼主
主题
1971
|
帖子
1971
|
积分
5913
设置vlan和IP【VLAN 2---- ->10.0.2.0/24。VLAN 3--->10.0.3.0/24。VLAN 20---->10.0.20.0/24。VLAN 30---->10.0.30.0/24】
vlan【sw3vlan设置】
[sw3]vlan batch 2 3 20 30
0/0/1]port link-type access
0/0/1]port default vlan 2
0/0/2]port link-type access
0/0/2]port default vlan 3
0/0/3]port link-type
t
runk
0/0/3]port trunk allow-pass vlan 2 3 20 30
0/0/4]po li
t
0/0/4]po t all v 2 3 20 30
【sw4vlan设置】
[sw4]vlan batch 2 3 20 30
0/0/1]port link-type access
0/0/1]port default vlan 20
0/0/2]port link-type access
0/0/2]port default vlan 30
0/0/3]port link-type
t
runk
0/0/3]port trunk allow-pass vlan 2 3 20 30
0/0/4]po li
t
0/0/4]po t all v 2 3 20 30
【sw1和sw2链路聚合】
[sw1]vlan batch 2 3 20 30
[sw1]interface Eth-Trunk 0
[sw1-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 to 0/0/2
[sw1-Eth-Trunk0]port link-type trunk
[sw1-Eth-Trunk0]port trunk allow-pass vlan 2 3 20 30
0/0/3]port link-type trunk
0/0/3]port trunk allow-pass vlan 2 3 20 30
0/0/4]port link-type trunk
0/0/4]port trunk allow-pass vlan 2 3 20 30
dis vlan
[sw2]vlan batch 2 3 20 30
[sw2]interface Eth-Trunk 0
[sw2-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 to 0/0/2
[sw2-Eth-Trunk0]port link-type trunk
[sw2-Eth-Trunk0]port trunk allow-pass vlan 2 3 20 30
0/0/3]port link-type trunk
0/0/3]port trunk allow-pass vlan 2 3 20 30
0/0/4]port link-type trunk
0/0/4]port trunk allow-pass vlan 2 3 20 30
SW1为VLAN 2/3的主根及主网关,SW2为v1an 20/30的主根及主网关,sw1和sw2相互备份
天生树协议设置【sw3】
[sw3]stp enable
[sw3]stp mode mstp
[sw3]stp region-configuration
—进入MSTP域设置视图
[sw3-mst-region]region-name aa
修改域名【默认域名为当地MAC地址】
[sw3-mst-region]revision-level 100
[sw3-mst-region]instance 1 vlan 2 3
[sw3-mst-region]instance 2 vlan 20 30
[sw3-mst-region]active region-configuration 【激活域,无激活则无效】
【sw4】
[sw4]stp en
[sw4]stp m m
[sw4]stp re 【可以将 ] 后面的代码全部复制粘贴快速设置】
[sw4-mst-region]region-name aa
[sw4-mst-region]revision-level 100
[sw4-mst-region]instance 1 vlan 2 3
[sw4-mst-region]instance 2 vlan 20 30
[sw4-mst-region]active region-configuration
【sw1和sw2也是一样的设置】
[sw1]stp instance 1 root primary 做实例1主根
[sw1]stp instance 2 root secondary 备份根
[sw2]stp instance 2 root primary
[sw2]stp instance 1 root secondary
[sw3-GigabitEthernet0/0/1]stp edged-port enable
【
开启边缘端口功能,可不开
】
设置三层交换机要有VRRP,vlanif三层接口【sw1】
[sw1]int Vlanif 2
[sw1-Vlanif2]ip ad 10.0.2.1 24
[sw1-Vlanif2]vrrp vrid 1 virtual-ip 10.0.2.254
[sw1-Vlanif2]vrrp vrid 1 virtual-ip 10.0.2.100
[sw1-Vlanif2]vrrp vrid 1 priority 120
[sw1-Vlanif2]vrrp vrid 1 preempt-mode timer delay 20
[sw1-Vlanif2]vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30
[sw1]int Vlanif 3
[sw1-Vlanif3]ip ad 10.0.3.1 24
[sw1-Vlanif3]vrrp vrid 1 virtual-ip 10.0.3.254
[sw1-Vlanif3]vrrp vrid 1 priority 120
[sw1-Vlanif3]vrrp vrid 1 preempt-mode timer delay 20
[sw1-Vlanif3]vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30
备份网关20和30
[sw1]int Vlanif 20
[sw1-Vlanif20]ip ad 10.0.20.1 24
[sw1-Vlanif20]vrrp vrid 1 virtual-ip 10.0.20.254
[sw1]int Vlanif 30
[sw1-Vlanif30]ip ad 10.0.30.1 24
[sw1-Vlanif30]vrrp vrid 1 virtual-ip 10.0.30.254
dis cu
[sw2]interface Vlanif 2
[sw2-Vlanif2]ip ad 10.0.2.2 24
[sw2-Vlanif2]vrrp vrid 1 virtual-ip 10.0.2.254
[sw2]interface Vlanif 3
[sw2-Vlanif3]ip ad 10.0.3.2 24
[sw2-Vlanif3]vrrp vrid 1 virtual-ip 10.0.3.254
[sw2]int v 20
[sw2-Vlanif20]ip ad 10.0.20.2 24
[sw2-Vlanif20]vrrp vrid 1 virtual-ip 10.0.20.254
[sw2-Vlanif20]vrrp vrid 1 priority 120
[sw2-Vlanif20]vrrp vrid 1 preempt-mode timer delay 20
[sw2-Vlanif20]vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30
[sw2]int v 30
[sw2-Vlanif30]ip ad 10.0.30.2 24
[sw2-Vlanif30]vrrp vrid 1 virtual-ip 10.0.30.254
[sw2-Vlanif30]vrrp vrid 1 priority 120
[sw2-Vlanif30]vrrp vrid 1 preempt-mode timer delay 20
[sw2-Vlanif30]vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30
dis vrrp brief
交换机DHCP设置
[sw1]dhcp enable
[sw1]ip pool vlan2
[sw1-ip-pool-vlan2]network 10.0.2.0 mask 25
[sw1-ip-pool-vlan2]gateway-list 10.0.2.100
[sw1-ip-pool-vlan2]dns-list 8.8.8.8
[sw2]dhcp enable
[sw2]ip pool vlan2
[sw2-ip-pool-vlan2]network 10.0.2.128 mask 25
[sw2-ip-pool-vlan2]gateway-list 10.0.2.254
[sw2-ip-pool-vlan2]dns-list 8.8.8.8
[sw2]int v 2
[sw2-Vlanif2]dhcp select global
互联网vlan设置
[sw1]vlan 11
[sw1-vlan11]q
[sw1]int g 0/0/5
0/0/5]port link-type access
0/0/5]port default vlan 11
[sw1]int v 11
[sw1-Vlanif11]ip ad 10.0.11.1 30
[sw2]vlan 12
[sw2-vlan12]q
[sw2]int g 0/0/5
0/0/5]port link-type access
0/0/5]port default vlan 12
[sw2]int v 12
[sw2-Vlanif12]ip ad 10.0.11.5 30
[r1]int g 0/0/1
0/0/1]ip ad 10.0.11.2 30
0/0/1]int g 0/0/2
0/0/2]ip ad 10.0.11.6 30
[sw1]ospf 1
[sw1-ospf-1]area 0
0.0.0.0]network 10.0.2.1 0.0.0.0
0.0.0.0]network 10.0.3.1 0.0.0.0
0.0.0.0]network 10.0.11.1 0.0.0.0
0.0.0.0]network 10.0.20.1 0.0.0.0
0.0.0.0]network 10.0.30.1 0.0.0.0
[sw2]ospf 1
[sw2-ospf-1]area 0
0.0.0.0]network 10.0.2.2 0.0.0.0
0.0.0.0]network 10.0.3.2 0.0.0.0
0.0.0.0]network 10.0.11.5 0.0.0.0
0.0.0.0]network 10.0.20.2 0.0.0.0
0.0.0.0]network 10.0.30.2 0.0.0.0
[r1]ospf 1
[r1-ospf-1]area 0
0.0.0.0]network 10.0.11.2 0.0.0.0
0.0.0.0]network 10.0.11.6 0.0.0.0
dis ospf p b
[sw1-ospf-1]silent-interface Vlanif 2
[sw1-ospf-1]silent-interface Vlanif 3
[sw1-ospf-1]silent-interface Vlanif 20
[sw1-ospf-1]silent-interface Vlanif 30
[sw2]ospf 1
[sw2-ospf-1]silent-interface Vlanif 2
[sw2-ospf-1]silent-interface Vlanif 3
[sw2-ospf-1]silent-interface Vlanif 20
[sw2-ospf-1]silent-interface Vlanif 30
[sw1]vlan 13
[sw1]int e 0
[sw1-Eth-Trunk0]port trunk allow-pass vlan 13
[sw2]vlan 13
[sw2]int e 0
[sw2-Eth-Trunk0]port trunk allow-pass vlan 13
[sw1]和[sw2]
int v 13
[sw1-Vlanif13]ip ad 10.0.13.1 30
[sw2-Vlanif13]ip ad 10.0.13.2 30
[sw1]0.0.0.0]network 10.0.13.1 0.0.0.0
[sw2]0.0.0.0]network 10.0.13.2 0.0.0.0
路由器之间使用静态协议设置
外网设置
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip ad 202.1.1.1 30
[isp]int g 0/0/0
[isp-GigabitEthernet0/0/0]ip ad 202.1.1.2 30
[isp]interface LoopBack 0
【环回接口】
[isp-LoopBack0]ip ad 100.100.100.100 32
[isp]ip route-static 0.0.0.0 0 202 1 1 2
【缺省路由】
[r1]ospf 1
[r1-ospf-1]default-route-advertise
[sw1]dis ip ro p o
AR1设置为企业出口路由器
因为是公网,不能有私有路由,要用ACL
[r1]acl 2000
[r1-acl-basic-2000]ru p s 10.0.0.0 0.0.255.255
0/0/0]nat o 2000
创建sub-vlan,并将相关接口划入VLAN中
设置super-vlan
[sw1]int e 0
[sw1-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 to 0/0/2
[sw1]vlan b 2 3 20 30 301 302
[sw1]vlan 100
[sw1-vlan100]aggregate-vlan
【超级vlan,将vlan 100设定为spuer-vlan】
[sw1-vlan100]access-vlan 2 3 301
---将sub-vlan参加到super-vlan中
[sw1]vlan 200
[sw1-vlan200]aggregate-vlan
[sw1-vlan200]access-vlan 20 30 302
[sw1]interface Eth-Trunk 0
[sw1-Eth-Trunk0]port link-type trunk
[sw1-Eth-Trunk0]port trunk allow-pass vlan 2 3 20 30 301 302
0/0/3]port link-type trunk
0/0/3]port trunk allow-pass vlan 2 to 3 20 30 301 to 302
0/0/4]port link-type trunk
0/0/4]port trunk allow-pass vlan 2 to 3 20 30 301 to 302
[sw2]int e 0
[sw2-Eth-Trunk0]trunkport GigabitEthernet 0/0/1 to 0/0/2
[sw2]vlan b 2 3 20 30 301 302
[sw2]vlan 100
[sw2-vlan100]aggregate-vlan
[sw2-vlan100]access-vlan 2 3 301
[sw2]vlan 200
[sw2-vlan200]aggregate-vlan
[sw2-vlan200]access-vlan 20 30 302
[sw2]interface Eth-Trunk 0
[sw2-Eth-Trunk0]po li t
[sw2-Eth-Trunk0]po t all v 2 3 20 30 301 302
0/0/3]port link-type trunk
0/0/3]port trunk allow-pass vlan 2 to 3 20 30 301 to 302
0/0/4]port link-type trunk
0/0/4]port trunk allow-pass vlan 2 to 3 20 30 301 to 302
[sw3]和[sw4]
vlan b 2 3 20 30 301 302
vlan 100
aggregate-vlan
access-vlan 2 3 301
vlan 200
aggregate-vlan
access-vlan 20 30 302
[sw3]0/0/1]po li a [sw4]0/0/1]po li a
0/0/1]po de v 2 0/0/1]po de v 20
0/0/2]po li a 0/0/2]po li a
0/0/2]po de v 3 0/0/2]po de v 30
0/0/3]port link-type trunk
0/0/3]port trunk allow-pass vlan 2 to 3 20 30 301 to 302
0/0/4]port link-type trunk
0/0/4]port trunk allow-pass vlan 2 to 3 20 30 301 to 302
[sw1—4]
stp region-configuration
region-name aa
revision-level 100
instance 1 vlan 2 3 301
instance 2 vlan 20 30 302
active region-configuration
[sw1]stp instance 1 root primary 做实例1主根
[sw1]stp instance 2 root secondary 备份根
[sw2]stp instance 2 root primary
[sw2]stp instance 1 root secondary
[sw1]interface Vlanif 100
[sw1-Vlanif100]ip ad 10.0.100.1 24
[sw1-Vlanif100]vrrp vrid 1 virtual-ip 10.0.100.254
[sw1-Vlanif100]vrrp vrid 1 priority 120
[sw1]interface Vlanif 200
[sw1-Vlanif200]ip ad 10.0.200.1 24
[sw1-Vlanif200]vrrp vrid 1 virtual-ip 10.0.200.254
[sw1-Vlanif200]vrrp vrid 1 priority 120
[sw2]interface Vlanif 100
[sw2-Vlanif100]ip ad 10.0.100.2 24
[sw2-Vlanif100]vrrp vrid 1 virtual-ip 10.0.100.254
[sw2-Vlanif100]vrrp vrid 1 priority 120
[sw2]interface Vlanif 200
[sw2-Vlanif200]ip ad 10.0.200.2 24
[sw2-Vlanif200]vrrp vrid 1 virtual-ip 10.0.200.254
[sw2-Vlanif200]vrrp vrid 1 priority 120
[sw1]和[sw2]实现super-vlan之间的PC通讯
int v 100
vrrp advertise send-mode 301
arp-proxy inter-sub-vlan-proxy enable
int v 200
vrrp advertise send-mode 302
arp-proxy inter-sub-vlan-proxy enable
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
本帖子中包含更多资源
您需要
登录
才可以下载或查看,没有账号?
立即注册
x
回复
使用道具
举报
0 个回复
倒序浏览
返回列表
快速回复
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
or
立即注册
本版积分规则
发表回复
回帖并转播
回帖后跳转到最后一页
发新帖
回复
麻花痒
论坛元老
这个人很懒什么都没写!
楼主热帖
【SQL server速成之路】——身份验证及 ...
2022年安装Kali Linux最详细过程,以及 ...
ping命令 网络抓包 分析
容器开发运维人员的 Linux 操作机配置 ...
我今年12岁了,我喜欢打游戏,怎么能成 ...
窄带传输与LoRa扩频传输技术应用方案对 ...
程序员坐牢了,会被安排去写代码吗? ...
猜
密码学奇妙之旅、02 混合加密系统、AES ...
kubectl使用技巧:如何更方便地操作多 ...
标签云
渠道
国产数据库
集成商
AI
运维
CIO
存储
服务器
浏览过的版块
Postrge-SQL技术社区
快速回复
返回顶部
返回列表