在这里我们使用三个路由器来做。
R1的配置
R1#sho run
Building configuration...
Current configuration : 576 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
interface FastEthernet0/0
ip address 192.168.3.1 255.255.255.0
duplex auto
speed auto
!
ip http server
ip route 192.168.1.0 255.255.255.0 FastEthernet0/0
ip route 192.168.2.0 255.255.255.0 FastEthernet0/0
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
End
PC1配置
Building configuration...
Current configuration : 541 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
no ip route-cache
duplex auto
speed auto
!
ip default-gateway 192.168.3.1
ip http server
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
!
End
PC2配置
R3#sho run
Building configuration...
Current configuration : 541 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
!
interface FastEthernet0/0
ip address 192.168.2.1 255.255.255.0
no ip route-cache
duplex auto
speed auto
!
ip default-gateway 192.168.3.1
ip http server
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
!
End
Current configuration : 574 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
interface FastEthernet0/0
ip address 192.168.1.254 255.255.255.0 secondary
ip address 192.168.2.254 255.255.255.0 secondary
ip address 192.168.3.1 255.255.255.0
duplex auto
speed auto
!
ip http server
!
line con 0
line aux 0
line vty 0 4
!
!
End
PC1配置
Building configuration...
Current configuration : 543 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
no ip route-cache
duplex auto
speed auto
!
ip default-gateway 192.168.1.254
ip http server
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
!
End
PC2配置
Building configuration...
Current configuration : 543 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip routing
!
!
no ip cef
no ip domain lookup
!
interface FastEthernet0/0
ip address 192.168.2.1 255.255.255.0
no ip route-cache
duplex auto
speed auto
!
ip default-gateway 192.168.2.254
ip http server
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
!
End