一文教你明明白白完整配置大型企业网络( 三 )


active region-configuration
#
stp instance 1 root primary
stp instance 2 root secondary
#
#
interface Vlanif10
ip address 192.168.10.251 255.255.255.0
#
interface Vlanif20
ip address 192.168.20.251 255.255.255.0
#
interface Vlanif30
ip address 192.168.30.251 255.255.255.0
#
interface Vlanif40
ip address 192.168.40.251 255.255.255.0
#
interface Vlanif10
vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 120
#
interface Vlanif30
vrrp vrid 30 virtual-ip 192.168.30.254
vrrp vrid 30 priority 120
#
interface Vlanif20
vrrp vrid 20 virtual-ip 192.168.20.254
#
interface Vlanif40
vrrp vrid 40 virtual-ip 192.168.40.254
#
vlan batch 100 200
#
#
interface GigabitEthernet0/0/10
port link-type access
port default vlan 100
stp edged-port enable
#
interface GigabitEthernet0/0/11
port link-type access
port default vlan 200
stp edged-port enable
#
#
interface Vlanif100
ip address 10.1.100.10 255.255.255.0
#
interface Vlanif200
ip address 10.1.102.10 255.255.255.0
#
#
ospf 1 router-id 11.11.11.11
import-route direct
area 0
network 10.1.100.10 0.0.0.0
network 10.1.102.10 0.0.0.0
authentication-mode md5 1 cipher huawei@123
#
dhcp enable
#
interface vlan10
dhcp select relay
dhcp relay server-ip 10.1.14.4
#
interface vlan20
dhcp select relay
dhcp relay server-ip 10.1.14.4
#
interface vlan30
dhcp select relay
dhcp relay server-ip 10.1.14.4
#
interface vlan40
dhcp select relay
dhcp relay server-ip 10.1.14.4
#
vlan 101
SW2配置:
#
vlan batch 10 20 30 40
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface eth-Trunk 12
mode lacp-static
trunkport gig 0/0/19 to 0/0/20
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
stp region-configuration
region-name hcie
revision-level 1
instance 1 vlan 10 30
instance 2 vlan 20 40
active region-configuration
#
stp instance 1 root secondary
stp instance 2 root primary
#
interface Vlanif10
ip address 192.168.10.252255.255.255.0
#
interface Vlanif20
ip address 192.168.20.252 255.255.255.0
#
interface Vlanif30
ip address 192.168.30.252 255.255.255.0
#
interface Vlanif40
ip address 192.168.40.252 255.255.255.0
#
interface Vlanif10
vrrp vrid 10 virtual-ip 192.168.10.254
#
interface Vlanif30
vrrp vrid 30 virtual-ip 192.168.30.254
#
interface Vlanif20
vrrp vrid 20 virtual-ip 192.168.20.254
vrrp vrid 20 priority 120
#
interface Vlanif40
vrrp vrid 40 virtual-ip 192.168.40.254
vrrp vrid 40 priority 120
#
#
vlan batch 300 400
#
#
interface GigabitEthernet0/0/10
port link-type access
port default vlan 400
stp edged-port enable
#
interface GigabitEthernet0/0/11
port link-type access
port default vlan 300
stp edged-port enable
#
#
interface Vlanif300
ip address 10.1.103.10 255.255.255.0
#
interface Vlanif400
ip address 10.1.104.10 255.255.255.0
#
ospf 1 router-id 22.22.22.22
import-route direct
area 0
network 10.1.103.10 0.0.0.0
network 10.1.104.10 0.0.0.0
authentication-mode md5 1 cipher huawei@123
#
dhcp enable
#
interface vlan10
dhcp select relay
dhcp relay server-ip 10.1.14.4
#
interface vlan20
dhcp select relay
dhcp relay server-ip 10.1.14.4
#
interface vlan30
dhcp select relay
dhcp relay server-ip 10.1.14.4
#
interface vlan40
dhcp select relay
dhcp relay server-ip 10.1.14.4
#
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
#
vlan 101
SW3配置:
vlan batch 10 20 30 40
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
stp edged-port enable
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 30
stp edged-port enable
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
#


推荐阅读