温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

简单网络配置

发布时间:2020-07-20 22:05:10 来源:网络 阅读:195 作者:mb5cb1c13200b8c 栏目:系统运维

简单网络配置


sw1:
配置vlan:
[sw1]vlan batch 10 20
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 10
[sw1-Ethernet0/0/1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 20
[sw1]port-group 1
[sw1-port-group-1]group-member e0/0/3 e0/0/4
[sw1-port-group-1]port link-type trunk
[sw1-port-group-1]port trunk allow-pass vlan all

<sw1>save

sw2:
配置vlan:
[sw2]vlan batch 10 30
[sw2]int e0/0/1
[sw2-Ethernet0/0/1]port link-type access
[sw2-Ethernet0/0/1]port default vlan 10
[sw2-Ethernet0/0/1]int e0/0/2
[sw2-Ethernet0/0/2]port link-type access
[sw2-Ethernet0/0/2]port default vlan 30
[sw2]port-group 1
[sw2-port-group-1]group-member e0/0/3 e0/0/4
[sw2-port-group-1]port link-type trunk
[sw2-Ethernet0/0/1]port trunk allow-pass vlan all

<sw2>save

sw3:
配置vlan:
[sw3]vlan batch 20 30
[sw3]int e 0/0/1
[sw3-Ethernet0/0/1]port link-type access
[sw3-Ethernet0/0/1]port default vlan 20
[sw3-Ethernet0/0/1]int e0/0/2
[sw3-Ethernet0/0/2]port link-type access
[sw3-Ethernet0/0/2]port default vlan 30
[sw3-port-group-1]group-member e0/0/3 e0/0/4
[sw3-port-group-1]port link-type trunk
[sw3-port-group-1]port trunk allow-pass vlan all

<sw3>save

lsw4:
配置vlan:
[lsw4]vlan batch 10 20 30
[lsw4]port-group 1
[lsw4-port-group-1]group-member g0/0/1 to g0/0/4
[lsw4-port-group-1]port link-type trunk
[lsw4-port-group-1]port trunk allow-pass vlan all
配置vrrp:
[lsw4]int Vlanif 10
[lsw4-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.254
[lsw4-Vlanif10]vrrp vrid 10 priority 200
[lsw4-Vlanif10]int vlanif 20
[lsw4-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.254
[lsw4-Vlanif20]vrrp vrid 20 priority 200
[lsw4-Vlanif20]int vlanif 30
[lsw4-Vlanif30]vrrp vrid 30 virtual-ip 192.168.30.254

[lsw4]int vlanif 10
[lsw4-Vlanif10]ip add 192.168.10.253 24
[lsw4-Vlanif10]int vlanif 20
[lsw4-Vlanif20]ip add 192.168.20.253 24
[lsw4-Vlanif20]int vlanif 30
[lsw4-Vlanif30]ip add 192.168.30.253 24

[lsw4]dis vrrp bri

浮动路由:
[lsw4]vlan 2
[lsw4]int vlanif 2
[lsw4-Vlanif2]ip add 192.168.1.1 24

[lsw4]int g0/0/5
[lsw4-GigabitEthernet0/0/5]port link-type access
[lsw4-GigabitEthernet0/0/5]port default vlan 2

[lsw4]int vlanif 10
[lsw4-Vlanif10]vrrp vrid 10 track interface g0/0/5 reduced 110
[lsw4-Vlanif10]int vlanif 20
[lsw4-Vlanif20]vrrp vrid 20 track interface g0/0/6 reduced 110

[lsw4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.2

DHCP配置:
[lsw4]dhcp enable
[lsw4]ip pool v10
[lsw4-ip-pool-v10]network 192.168.10.0 mask 24
[lsw4-ip-pool-v10]gateway-list 192.168.10.254
[lsw4]int vlanif 10
[lsw4-Vlanif10]dhcp select global

[lsw4]display ip interface brief

lsw5:
配置vlan:
[lsw5]vlan batch 10 20 30
[lsw5]port-group 1
[lsw5-port-group-1]group-member g0/0/1 to g0/0/4
[lsw5-port-group-1]port link-type trunk
[lsw5-port-group-1]port trunk allow-pass vlan all
配置vrrp:
[lsw5]int vlanif 10
[lsw5-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.254
[lsw5-Vlanif10]int vlanif 20
[lsw5-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.254
[lsw5-Vlanif20]int vlanif 30
[lsw5-Vlanif30]vrrp vrid 30 virtual-ip 192.168.30.254
[lsw5-Vlanif30]vrrp vrid 30 priority 200

[lsw5]int vlanif 10
[lsw5-Vlanif10]ip add 192.168.10.252 24
[lsw5-Vlanif10]int vlanif 20
[lsw5-Vlanif20]ip add 192.168.20.252 24
[lsw5-Vlanif20]int vlanif 30
[lsw5-Vlanif30]ip add 192.168.30.252 24

[lsw5]dis vrrp bri

浮动路由:
[lsw5]vlan batch 2 3
[lsw5]int vlanif 2
[lsw5-Vlanif2]ip add 192.168.2.1 24
[lsw5-Vlanif2]int vlanif 3
[lsw5-Vlanif3]ip add 192.168.3.254 24

[lsw4]int g0/0/5
[lsw4-GigabitEthernet0/0/5]port link-type access
[lsw4-GigabitEthernet0/0/5]port default vlan 3

[lsw4]int g0/0/6
[lsw4-GigabitEthernet0/0/6]port link-type access
[lsw4-GigabitEthernet0/0/6]port default vlan 2

[lsw5]int vlanif 30
[lsw5-Vlanif30]vrrp vrid 30 track interface g0/0/6 reduced 110

[lsw5]ip route-static 0.0.0.0 0.0.0.0 192.168.2.2

DHCP配置:
[lsw5]dhcp enable
[lsw5]ip pool v20
[lsw5-ip-pool-v20]network 192.168.20.0 mask 24
[lsw5-ip-pool-v20]gateway-list 192.168.20.254
[lsw5]int vlanif 20
[lsw5-Vlanif20]dhcp select global

[lsw5]ip pool v30
[lsw5-ip-pool-v30]network 192.168.30.0 mask 24
[lsw5-ip-pool-v30]gateway-list 192.168.20.254
[lsw5]int vlanif 30
[lsw5-Vlanif20]dhcp select global

r1:
浮动路由:
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.2 24
[r1-GigabitEthernet0/0/1]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 192.168.2.2 24
[r1-GigabitEthernet0/0/2]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.100.1 24

[r1]ip route-static 192.168.10.0 24 192.168.1.1
[r1]ip route-static 192.168.10.0 24 192.168.2.1 preference 70
[r1]ip route-static 192.168.20.0 24 192.168.1.1
[r1]ip route-static 192.168.20.0 24 192.168.2.1 preference 70
[r1]ip route-static 192.168.30.0 24 192.168.2.1
[r1]ip route-static 192.168.30.0 24 192.168.1.1 preference 70

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI