您的位置:首页 > 其它

单区域ospf跟单臂路由结合配置实例

2017-10-11 14:12 531 查看


1.入门级别配置实例,主要联系ospf跟简单VLAN配置,最终实现跨路由之间各数据互访
switch0配置:
Switch#show runBuilding configuration...
Current configuration : 1185 bytes!version 12.1no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Switch!!!spanning-tree mode pvst!interface FastEthernet0/1switchport access vlan 2switchport mode access!interface FastEthernet0/2!interface FastEthernet0/3switchport access vlan 2switchport mode access!interface FastEthernet0/4switchport access vlan 3switchport mode access!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10!interface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24switchport trunk allowed vlan 2-3switchport mode trunk!interface Vlan1no ip addressshutdown!!!!line con 0!line vty 0 4loginline vty 5 15loginrouter0配置:Router#show runBuilding configuration...
Current configuration : 1494 bytes!version 12.4no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Router!enable secret 5 $1$mERr$MDeUpp7auYzHywLNEQqCL/enable password cisco!!ip dhcp excluded-address 192.168.2.1ip dhcp excluded-address 192.168.3.1!ip dhcp pool vlan2network 192.168.2.0 255.255.255.0default-router 192.168.2.1dns-server 58.242.2.2ip dhcp pool vlan3network 192.168.3.0 255.255.255.0default-router 192.168.3.1dns-server 58.242.2.2!!!no ip cefno ipv6 cef!
spanning-tree mode pvst!
interface FastEthernet0/0no ip addressduplex autospeed auto!interface FastEthernet0/0.1encapsulation dot1Q 2ip address 192.168.2.1 255.255.255.0!interface FastEthernet0/0.2encapsulation dot1Q 3ip address 192.168.3.1 255.255.255.0!interface FastEthernet0/1ip address 192.168.20.2 255.255.255.0duplex autospeed auto!interface FastEthernet0/1/0switchport mode access!interface FastEthernet0/1/1switchport mode access!interface FastEthernet0/1/2switchport mode access!interface FastEthernet0/1/3switchport mode access!interface Vlan1no ip addressshutdown!router ospf 1log-adjacency-changesnetwork 192.168.20.0 0.0.0.255 area 0network 192.168.2.0 0.0.0.255 area 0network 192.168.3.0 0.0.0.255 area 0!router rip!ip classless!ip flow-export version 9
line con 0!line aux 0!line vty 0 4password ciscologin
switch1配置:Switch#show runBuilding configuration...
Current configuration : 1135 bytes!version 12.1no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Switch!!!spanning-tree mode pvst!interface FastEthernet0/1switchport access vlan 4switchport mode access!interface FastEthernet0/2switchport access vlan 5switchport mode access!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10!interface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24switchport trunk allowed vlan 4-5switchport mode trunk!interface Vlan1no ip addressshutdown!!!!line con 0!line vty 0 4loginline vty 5 15login

router1配置:

Router#show runBuilding configuration...
Current configuration : 1223 bytes!version 12.4no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname Router!ip dhcp excluded-address 192.168.4.1ip dhcp excluded-address 192.168.5.1!ip dhcp pool vlan4network 192.168.4.0 255.255.255.0default-router 192.168.4.1dns-server 58.242.2.2ip dhcp pool vlan5network 192.168.5.0 255.255.255.0default-router 192.168.5.1dns-server 58.242.2.2!!!ip cefno ipv6 cef!
spanning-tree mode pvst!
interface FastEthernet0/0no ip addressduplex autospeed auto!interface FastEthernet0/0.1no ip address!interface FastEthernet0/0.4encapsulation dot1Q 4ip address 192.168.4.1 255.255.255.0!interface FastEthernet0/0.5encapsulation dot1Q 5ip address 192.168.5.1 255.255.255.0!interface FastEthernet0/1ip address 192.168.20.1 255.255.255.0duplex autospeed auto!interface Vlan1no ip addressshutdown!router ospf 1no log-adjacency-changesnetwork 192.168.4.0 0.0.0.255 area 0network 192.168.5.0 0.0.0.255 area 0network 192.168.20.0 0.0.0.255 area 0!ip classless!ip flow-export version 9!
line con 0!line aux 0!line vty 0 4login
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ospf vlan dot1Q