不同VLAN走不同路由

SW3560#sh run
Building configuration...
 
Current configuration : 1592 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW3560
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/1
 switchport access vlan 10
 switchport mode access
!
interface FastEthernet0/2
 switchport access vlan 20
 switchport mode access
!
interface FastEthernet0/3
 switchport access vlan 30
 switchport mode access
!
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/24
!
interface GigabitEthernet0/1
 switchport access vlan 100
 switchport mode access
!
interface GigabitEthernet0/2
 switchport access vlan 200
 switchport mode trunk
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan10
 ip address 10.1.1.1 255.255.255.0
!
interface Vlan20
 ip address 20.1.1.1 255.255.255.0
!
interface Vlan30
 ip address 30.1.1.1 255.255.255.0
!
interface Vlan100
 ip address 100.1.1.1 255.255.255.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 100.1.1.2
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line vty 0 4
 login
!
!
!
end
 
 
SW3560#
 
 
 
SW3560#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
 
Gateway of last resort is 100.1.1.2 to network 0.0.0.0
 
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Vlan10
     20.0.0.0/24 is subnetted, 1 subnets
C       20.1.1.0 is directly connected, Vlan20
     30.0.0.0/24 is subnetted, 1 subnets
C       30.1.1.0 is directly connected, Vlan30
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, Vlan100
S*   0.0.0.0/0 [1/0] via 100.1.1.2
SW3560#
 
 
R1#sh run
Building configuration...
 
Current configuration : 1088 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R1
!
!
!
!
!
!
!
!
!
!
!
!
!
class-map match-any qos
!
policy-map nexthop
 class qos
!
!
!
interface FastEthernet0/0
 ip address 100.1.1.2 255.255.255.0
 ip nat inside
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 202.102.1.2 255.255.255.0
 ip nat outside
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
ip nat inside source list 101 interface FastEthernet0/1 overload
ip classless
ip route 10.1.1.0 255.255.255.0 100.1.1.1
ip route 20.1.1.0 255.255.255.0 100.1.1.1
ip route 0.0.0.0 0.0.0.0 202.102.1.1
ip route 30.1.1.0 255.255.255.0 100.1.1.1
!
!
access-list 101 permit ip 10.1.1.0 0.0.0.255 any
access-list 101 permit ip 20.1.1.0 0.0.0.255 any
access-list 101 permit ip 30.1.1.0 0.0.0.255 any
access-list 101 deny ip any any
access-list 100 permit ip 30.1.1.0 0.0.0.255 any
access-list 100 deny ip any any
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line vty 0 4
 login
!
!
!
end
 
 
R1#
R1#
 
 
 
R1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
 
Gateway of last resort is 202.102.1.1 to network 0.0.0.0
 
     10.0.0.0/24 is subnetted, 1 subnets
S       10.1.1.0 [1/0] via 100.1.1.1
     20.0.0.0/24 is subnetted, 1 subnets
S       20.1.1.0 [1/0] via 100.1.1.1
     30.0.0.0/24 is subnetted, 1 subnets
S       30.1.1.0 [1/0] via 100.1.1.1
     100.0.0.0/24 is subnetted, 1 subnets
C       100.1.1.0 is directly connected, FastEthernet0/0
C    202.102.1.0/24 is directly connected, FastEthernet0/1
S*   0.0.0.0/0 [1/0] via 202.102.1.1
 
 
R0#sh run
Building configuration...
 
Current configuration : 1028 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R0
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 ip nat inside
 duplex auto
 speed auto
!
interface FastEthernet0/0.1
 encapsulation dot1Q 10
 ip address 10.1.1.3 255.255.255.0
!
interface FastEthernet0/0.2
 encapsulation dot1Q 20
 ip address 20.1.1.3 255.255.255.0
!
interface FastEthernet0/0.3
 encapsulation dot1Q 30
 ip address 30.1.1.3 255.255.255.0
 ip nat inside
!
interface FastEthernet0/1
 ip address 202.102.2.2 255.255.255.0
 ip nat outside
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
ip nat inside source list 101 interface FastEthernet0/1 overload
ip classless
ip route 30.1.1.0 255.255.255.0 200.1.1.1
ip route 0.0.0.0 0.0.0.0 202.102.2.1
!
!
access-list 101 permit ip 30.1.1.0 0.0.0.255 any
access-list 101 deny ip any any
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line vty 0 4
 login
!
!
!
end
 
 
R0#
R0#
 
 
R0#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
 
Gateway of last resort is 202.102.2.1 to network 0.0.0.0
 
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, FastEthernet0/0.1
     20.0.0.0/24 is subnetted, 1 subnets
C       20.1.1.0 is directly connected, FastEthernet0/0.2
     30.0.0.0/24 is subnetted, 1 subnets
C       30.1.1.0 is directly connected, FastEthernet0/0.3
C    202.102.2.0/24 is directly connected, FastEthernet0/1
S*   0.0.0.0/0 [1/0] via 202.102.2.1
R0#
 
R2#sh run
Building configuration...
 
Current configuration : 567 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R2
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
 ip address 202.102.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 202.102.2.1 255.255.255.0
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line vty 0 4
 login
!
!
!
end
 
 
 
 
R2#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
 
Gateway of last resort is not set
 
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
C    202.102.1.0/24 is directly connected, FastEthernet0/0
C    202.102.2.0/24 is directly connected, FastEthernet0/1
R2#
 
 
IP:10.1.1.2
mask:255.255.255.0
gateway:10.1.1.1
 
IP:20.1.1.2
mask:255.255.255.0
gateway:20.1.1.1
 
IP:30.1.1.2
mask:255.255.255.0
gateway:30.1.1.3

你可能感兴趣的:(职场,休闲,不同VLAN走不同路由)