4. Конфигурация оборудования
Пример конфигурации коммутатора уровня доступа (взят из первого отдела S3):
Switch#sh r
Building configuration...
Current configuration : 2284 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
enable password 123
!
spanning-tree mode rapid-pvst
spanning-tree vlan 14,101 priority 61440
!
interface FastEthernet0/1
switchport trunk allowed vlan 14,101
switchport mode trunk
!
interface FastEthernet0/2
switchport trunk allowed vlan 14,101
switchport mode trunk
!
interface FastEthernet0/3
switchport access vlan 101
switchport mode access
!
~~~~~~~~~~~~~~~~~~~~~
interface FastEthernet0/4 - 23
~~~~~~~~~~~~~~~~~~~~~
!
interface FastEthernet0/24
switchport access vlan 101
switchport mode access
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
password 123
login
line vty 5 15
password 123
login
!
!
end
Пример конфигурации корневого коммутатора уровня распределния (взят S1):
Switch#sh r
Building configuration...
Current configuration : 1573 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
enable password 123
!
spanning-tree mode rapid-pvst
spanning-tree vlan 14,101-104 priority 4096
!
interface FastEthernet0/1
switchport mode trunk
!
~~~~~~~~~~~~~~~~~~~~~
interface FastEthernet0/2 - 23
~~~~~~~~~~~~~~~~~~~~~
!
interface FastEthernet0/24
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
password 123
login
line vty 5 15
password 123
login
!
!
end
Пример конфигурации резервного коммутатора уровня распределния (взят S2):
Switch#sh r
Building configuration...
Current configuration : 1573 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
enable password 123
!
spanning-tree mode rapid-pvst
spanning-tree vlan 14,101-104 priority 8192
!
interface FastEthernet0/1
switchport mode trunk
!
~~~~~~~~~~~~~~~~~~~~~
interface FastEthernet0/2 - 23
~~~~~~~~~~~~~~~~~~~~~
!
interface FastEthernet0/24
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
password 123
login
line vty 5 15
password 123
login
!
!
end
Конфигурация коммутатора первого этажа (S0, конфигурация второго аналогична):
Switch#sh r
Building configuration...
Current configuration : 1607 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
enable password 123
!
spanning-tree mode rapid-pvst
spanning-tree vlan 14 priority 4096
spanning-tree vlan 101-104 priority 61440
!
interface FastEthernet0/1
switchport mode trunk
!
~~~~~~~~~~~~~~~~~~~~~
interface FastEthernet0/2 - 23
~~~~~~~~~~~~~~~~~~~~~
!
interface FastEthernet0/24
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
password 123
login
line vty 5 15
password 123
login
!
!
end
Конфигурация маршрутизатора первого этажа (OSPF):
Router#sh r
Building configuration...
Current configuration : 2083 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
enable password 123
!
!
ip dhcp excluded-address 172.16.0.1
ip dhcp excluded-address 172.16.4.1
!
ip dhcp pool otd1
network 172.16.0.0 255.255.255.0
default-router 172.16.0.1
ip dhcp pool otd3
network 172.16.4.0 255.255.255.224
default-router 172.16.4.1
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.14
encapsulation dot1Q 14
ip address 172.16.5.1 255.255.255.224
!
interface FastEthernet0/0.101
encapsulation dot1Q 101
ip address 172.16.0.1 255.255.255.0
ip access-group 1 out
!
interface FastEthernet0/0.102
encapsulation dot1Q 102
ip address 172.16.2.1 255.255.255.128
ip access-group 2 out
!
interface FastEthernet0/0.103
encapsulation dot1Q 103
ip address 172.16.4.1 255.255.255.224
ip access-group 3 out
!
interface FastEthernet0/0.104
encapsulation dot1Q 104
ip address 172.16.3.129 255.255.255.192
ip access-group 4 out
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/0/0
ip address 172.16.6.2 255.255.255.252
!
interface Serial0/0/1
no ip address
clock rate 2000000
shutdown
!
interface Vlan1
no ip address
shutdown
!
router ospf 2
log-adjacency-changes
network 172.16.6.0 0.0.0.3 area 0
network 172.16.5.0 0.0.0.31 area 0
network 172.16.0.0 0.0.0.255 area 0
network 172.16.2.0 0.0.0.127 area 0
network 172.16.4.0 0.0.0.31 area 0
network 172.16.3.128 0.0.0.63 area 0
!
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0/0/0
!
!
access-list 1 permit 172.16.2.128 0.0.0.127
access-list 1 deny any
access-list 2 permit 172.16.3.128 0.0.0.127
access-list 2 permit 172.16.4.0 0.0.0.31
access-list 2 deny any
access-list 3 permit 172.16.1.0 0.0.0.255
access-list 3 permit 172.16.2.0 0.0.0.127
access-list 3 permit 172.16.3.0 0.0.0.127
access-list 3 deny 172.16.0.0 0.0.7.255
access-list 3 permit any
access-list 4 deny any
!
!
!
!
!
line vty 0 4
password 123
login
line vty 5 15
password 123
login
!
!
!
end
Конфигурация маршрутизатора второго этажа (BGP):
Router#sh r
Building configuration...
Current configuration : 2077 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
enable password 123
!
!
ip dhcp excluded-address 172.16.3.1
ip dhcp excluded-address 172.16.3.193
!
ip dhcp pool otd5
network 172.16.3.192 255.255.255.192
default-router 172.16.3.193
ip dhcp pool otd8
network 172.16.3.0 255.255.255.128
default-router 172.16.3.1
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.14
encapsulation dot1Q 14
ip address 172.16.5.33 255.255.255.224
!
interface FastEthernet0/0.105
encapsulation dot1Q 105
ip address 172.16.3.193 255.255.255.192
ip access-group 5 out
!
interface FastEthernet0/0.106
encapsulation dot1Q 106
ip address 172.16.1.1 255.255.255.0
ip access-group 6 out
!
interface FastEthernet0/0.107
encapsulation dot1Q 107
ip address 172.16.2.129 255.255.255.128
ip access-group 7 out
!
interface FastEthernet0/0.108
encapsulation dot1Q 108
ip address 172.16.3.1 255.255.255.128
ip access-group 8 out
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/0/0
ip address 172.16.6.6 255.255.255.252
!
interface Serial0/0/1
no ip address
clock rate 2000000
!
interface Vlan1
no ip address
shutdown
!
router bgp 1
bgp log-neighbor-changes
no synchronization
neighbor 172.16.6.5 remote-as 2
network 172.16.1.0 mask 255.255.255.0
network 172.16.2.128 mask 255.255.255.128
network 172.16.3.0 mask 255.255.255.128
network 172.16.3.192 mask 255.255.255.192
network 172.16.5.32 mask 255.255.255.224
!
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0/0/1
ip route 0.0.0.0 0.0.0.0 Serial0/0/0
!
!
access-list 5 permit 172.16.2.0 0.0.0.127
access-list 5 deny 172.16.0.0 0.0.7.255
access-list 5 permit any
access-list 6 permit 172.16.4.0 0.0.0.31
access-list 6 deny any
access-list 7 permit 172.16.0.0 0.0.0.255
access-list 7 deny any
access-list 8 permit 172.16.4.0 0.0.0.31
access-list 8 deny any
!
!
!
line con 0
!
line vty 0 4
password 123
login
line vty 5 15
password 123
login
!
!
!
end
Конфигурация маршрутизатора выхода во внешнюю сеть (gateway):
Router#sh r
Building configuration...
Current configuration : 1159 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
enable password 123
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
interface FastEthernet0/0
ip address 95.107.47.4 255.0.0.0
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/0/0
ip address 172.16.6.1 255.255.255.252
ip nat inside
clock rate 9600
!
interface Serial0/0/1
ip address 172.16.6.5 255.255.255.252
ip nat inside
clock rate 9600
!
interface Vlan1
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
redistribute bgp 2 metric 10 subnets
redistribute static subnets
network 172.16.6.0 0.0.0.3 area 0
!
router bgp 2
bgp log-neighbor-changes
no synchronization
neighbor 172.16.6.6 remote-as 1
redistribute ospf 1
redistribute static
!
ip nat inside source list 1 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
!
!
access-list 1 permit 172.16.3.192 0.0.0.63
access-list 1 permit 172.16.4.0 0.0.0.31
!
!
!
!
!
line con 0
!
line vty 0 4
password 123
login
line vty 5 15
password 123
login
!
!
!
end