Pages

Showing posts with label lab. Show all posts
Showing posts with label lab. Show all posts

Thursday, May 20, 2010

spanning tree on Cat 6500, 4510 and 3560


make sure all the cabling are fine and working, show CDP should be able to show all it's neighbor

set all the connected port above to be a trunking port

ex using int range command on CORE1 to set trunk on int Gi1/1 until Gi1/3


CORE1(config)#interface range gigabitEthernet 1/1 - 3
CORE1(config-if-range)#switchport trunk encapsulation dot1q
CORE1(config-if-range)#switchport mode trunk

configure etherchannel between CORE1 and CORE2

interface GigabitEthernet1/1 (same for Gi1/2)
 switchport
 switchport trunk encapsulation dot1q
 switchport mode trunk
 no ip address
 channel-protocol lacp
 channel-group 64 mode active
end

this will automatically create etherchannel, Po64, make sure all the attribute in physical port applied the same to the port channel

interface Port-channel64
 switchport
 switchport trunk encapsulation dot1q
 switchport mode trunk
 no ip address
end

*once you start your switch, check the name, if 'router>' then all ports are layer3 port and by default is administratively shutdown, change it to switchport (layer2)
*if start with 'switch>', then it shouldn't be any problem

make sure you configure this on all ports above, next is creating management VLAN interface, we'll use VLAN1 to be the management VLAN, by default all port are belong to this VLAN

configure on CORE1


interface Vlan1
 ip address 172.16.1.1 255.255.255.0
end

use the same subnet for int VLAN1 on CORE2, DIST1 and ACC1, just change the last octet to 2, 3 and 4 accordingly

now all the int VLAN are up, if not then you might want to check on the trunk conf, make sure it's working
use this command, and make sure all of your trunk ports are listed, check on all switch

DIST1#sh interface trunk

Port        Mode             Encapsulation  Status        Native vlan
Fa4/3       on               802.1q         trunking      1
Fa4/5       on               802.1q         trunking      1
Fa4/7       on               802.1q         trunking      1

Port        Vlans allowed on trunk
Fa4/3       1-4094
Fa4/5       1-4094
Fa4/7       1-4094

Port        Vlans allowed and active in management domain
..

configure enable and line vty password before you can telnet all the switch using VLAN1 ip address

DIST1(config)#enable secret cisco
DIST1(config)#line vty 0 15
DIST1(config-line)#password cisco
DIST1(config-line)#privilege level 15

the line will make sure you telnet session automatically goes into the enable mode
now you should be able to telnet to all the others switch

next we'll conf VTP for easy VLAN management, on CORE1

CORE1(config)#vtp mode server
CORE1(config)#vtp domain AMD
CORE1(config)#vtp version 2

conf the CORE2, DIST1 and ACC1 to be mode client

create 4 VLAN on CORE2

CORE1(config)#vlan 10
CORE1(config)#vlan 20
CORE1(config)#vlan 30
CORE1(config)#vlan 40

show vlan on all the switch, make sure all have the same VLAN, if not then troubleshoot your VTP


now we move to spanning-tree, how to configure it? no need, by default it is turned on already(PVST), but we can control the behavior of spanning tree by manipulating a few attributes

lowest priority will become a root, if all are same value, then lowest mac address take place
in this case CORE1 has the lowest priority

show spanning-tree vlan [VLAN number]
*use show spanning-tree to to get the result for every single VLAN

by default, a single switch will become a root bridge for every single VLAN inside your network

CORE1>sh span vlan 10

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192  this value should be same as Bridge ID (below), because the switch itself is Root
             Address     0019.0787.300a
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    8192 priority value and ID for this switch
             Address     0019.0787.300a
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi1/3            Desg FWD 19        128.3    P2p all ports in Root should be in FWD mode
Po64             Desg FWD 3         128.1665 P2p


CORE2#sh span vla 10

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     0019.0787.300a
             Cost        3
             Port        1665 (Port-channel64) local port going to Root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768 this switch can't become a Root because CORE1 has a lower priority
             Address     0019.a908.ac0a
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi7/5            Desg FWD 19        128.773  P2p port that forward traffic to the LAN segment
Po64             Root FWD 3         128.1665 P2p closest port to the root in term of cost

now we'll configure per VLAN spanning-tree, mean that we manually configure each VLAN it's own Root
there's two command to achieve this

spanning-tree vlan [VLAN X] root primary/secondary
OR
spanning-tree vlan [VLAN X] priority [Bridge ID]

we have created VLAN 10, 20, 30 and 40
divide into 2, 10 and 30 root on CORE1
20 and 40 root on CORE2

CORE1(config)#spanning-tree vlan 10 root primary
CORE1(config)#spanning-tree vlan 30 root primary

CORE2(config)#spanning-tree vlan 20 root primary
CORE2(config)#spanning-tree vlan 40 root primary

CORE2#show spanning-tree vlan 20

let's confirm this
 
VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     0019.a908.ac14
             This bridge is the root now this switch is the root for VLAN 20
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    8192
             Address     0019.a908.ac14
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi7/5            Desg FWD 19        128.773  P2p
Po64             Desg FWD 3         128.1665 P2p

check on all the other 3 VLANs for their root

now you can configure secondary root for each VLAN using the same approach

for the second command,
remove all the configuration that we just put in, we should have the Bridge ID (by know you should know how to get the Bridge ID)
but now the problem is, all my switch have the same Bridge priority : 32788 and since CORE1 has the lowest mac, it's now the Root for all VLANs

so, I've set VLAN 10 and 30 to have a higher priority value than it's Root for now

CORE1#spanning-tree vlan 10,30 priority 36864

check on CORE2, that fella should be the Root for VLAN 20 and 30 right now

we can also confirm this on DIST1

DIST1#show spanning-tree vlan 10

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     0019.a908.ac0a
             Cost        19
             Port        197 (FastEthernet4/5)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)
             Address     0018.19b2.58c0
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa4/3               Altn BLK 19        128.195  P2p
Fa4/5               Root FWD 19        128.197  P2p  root port for VLAN 10 is different than 20 (below), Fa4/3 connect to CORE1, Fa4/5 to CORE2

DIST1#show spanning-tree vlan 20

VLAN0020
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     0019.0787.3014
             Cost        19
             Port        195 (FastEthernet4/3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32788  (priority 32768 sys-id-ext 20)
             Address     0018.19b2.58c0
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa4/3               Root FWD 19        128.195  P2p connect to CORE1, it's the Root for VLAN20
Fa4/5               Altn BLK 19        128.197  P2p

another useful command

DIST1#show spanning-tree interface fastEthernet 4/5

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001            Altn BLK 19        128.197  P2p
VLAN0010            Root FWD 19        128.197  P2p
VLAN0020            Altn BLK 19        128.197  P2p
VLAN0030            Root FWD 19        128.197  P2p
VLAN0040            Altn BLK 19        128.197  P2p
VLAN0050            Altn BLK 19        128.197  P2p

Friday, April 9, 2010

3 method configuring default route on hub-spoke network - GNS3

dg

  • ip default-network
  • ip route
  • ip default-gateway
this example we’ll use RIP, you can also use EIGRP but not OSPF
prepare the network
R1
interface FastEthernet0/0
ip address 10.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface Serial0/0
ip address 192.168.1.1 255.255.255.0
clock rate 64000
!
interface Serial0/1
ip address 172.16.1.1 255.255.255.0
clock rate 64000
!
router rip
network 172.16.0.0
network 192.168.1.0

R2
interface Serial0/0
ip address 192.168.1.2 255.255.255.0
!
router rip
network 172.16.0.0
network 192.168.1.0

R3
interface Serial0/0
ip address 172.16.1.2 255.255.255.0
!
router rip
network 172.16.0.0

make sure R1, R2 and R3 learn all the advertised interfaces and RIP working fine by pinging from one to other interfaces
R1>sh ip rou
R    99.0.0.0/8 [120/1] via 192.168.1.2, 00:00:16, Serial0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.1.0 is directly connected, Serial0/1
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, FastEthernet0/0
C    192.168.1.0/24 is directly connected, Serial0/0


R2#show ip route
     99.0.0.0/24 is subnetted, 1 subnets
C       99.99.99.0 is directly connected, Loopback99
R    172.16.0.0/16 [120/1] via 192.168.1.1, 00:00:15, Serial0/0
C    192.168.1.0/24 is directly connected, Serial0/0

R3#sh ip rou
R    99.0.0.0/8 [120/1] via 172.16.1.1, 00:00:21, Serial0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.1.0 is directly connected, Serial0/0
R    192.168.1.0/24 [120/1] via 172.16.1.1, 00:00:21, Serial0/0

now issue this command on R1
R1(config)#ip default-network 10.0.0.0
*again, remember, this only work on hub spoke network only !!!
now, show ip route on R2 and R3
notice there are default route in the routing table
R2#sh ip route
     99.0.0.0/24 is subnetted, 1 subnets
C       99.99.99.0 is directly connected, Loopback99
R    172.16.0.0/16 [120/1] via 192.168.1.1, 00:00:12, Serial0/0
R    10.0.0.0/8 [120/1] via 192.168.1.1, 00:00:12, Serial0/0
C    192.168.1.0/24 is directly connected, Serial0/0
R*   0.0.0.0/0 [120/1] via 192.168.1.1, 00:00:12, Serial0/0

R3#sh ip route
R    99.0.0.0/8 [120/1] via 172.16.1.1, 00:00:17, Serial0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.1.0 is directly connected, Serial0/0
R    10.0.0.0/8 [120/1] via 172.16.1.1, 00:00:17, Serial0/0
R    192.168.1.0/24 [120/1] via 172.16.1.1, 00:00:17, Serial0/0
R*   0.0.0.0/0 [120/1] via 172.16.1.1, 00:00:17, Serial0/0

now we'll configure configure static ip route, using this method we need to redistribute the route to R2 and R3 manually
remove default-network and clear the routing table to make sure it's not gonna influence our new conf in any possible way
on R1
R1(config)#no ip default-network 10.0.0.0
on R1, R2 and R3
R1#clear ip route *

issue the static route command on R1 and specified the exit interface
R1(config)#ip route 0.0.0.0 0.0.0.0 fastEthernet 0/0
then redistribute this static route to RIP
R1(config)#router rip
R1(config-router)#redistribute static
show ip route on R2 and R3 should show the default route now
R3#sh ip route
Gateway of last resort is 172.16.1.1 to network 0.0.0.0

R    99.0.0.0/8 [120/1] via 172.16.1.1, 00:00:15, Serial0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.1.0 is directly connected, Serial0/0
R    10.0.0.0/8 [120/1] via 172.16.1.1, 00:00:15, Serial0/0
R    192.168.1.0/24 [120/1] via 172.16.1.1, 00:00:15, Serial0/0
R*   0.0.0.0/0 [120/1] via 172.16.1.1, 00:00:15, Serial0/0

R2#sh ip route
Gateway of last resort is 192.168.1.1 to network 0.0.0.0

     99.0.0.0/24 is subnetted, 1 subnets
C       99.99.99.0 is directly connected, Loopback99
R    172.16.0.0/16 [120/1] via 192.168.1.1, 00:00:01, Serial0/0
R    10.0.0.0/8 [120/1] via 192.168.1.1, 00:00:01, Serial0/0
C    192.168.1.0/24 is directly connected, Serial0/0
R*   0.0.0.0/0 [120/1] via 192.168.1.1, 00:00:01, Serial0/0
this conf also work with EIGRP, but not with OSPF

another way is to use command ip default-gateway, but you need to turn off ip routing to use this
R3(config)#no ip routing
R3(config)#ip default-gateway 172.16.1.1

R3#sh ip route
Default gateway is 172.16.1.1

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty

Wednesday, April 7, 2010

EIGRP over Frame-relay

framerelay_eigrp
EIGRP over frame relay with two spokes and a hub
R1
interface Serial0/0
ip address 10.1.123.1 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 10.1.123.1 102
frame-relay map ip 10.1.123.2 102 broadcast
frame-relay map ip 10.1.123.3 103 broadcast
no frame-relay inverse-arp
router eigrp 1
network 0.0.0.0
no auto-summary

R2
interface Serial0/0
ip address 10.1.123.2 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 10.1.123.1 201 broadcast
frame-relay map ip 10.1.123.2 201
frame-relay map ip 10.1.123.3 201 broadcast
no frame-relay inverse-arp
router eigrp 1
network 0.0.0.0
no auto-summary

R3
interface Serial0/0
ip address 10.1.123.3 255.255.255.0
encapsulation frame-relay
clock rate 2000000
frame-relay map ip 10.1.123.1 301 broadcast
frame-relay map ip 10.1.123.2 301 broadcast
frame-relay map ip 10.1.123.3 301
no frame-relay inverse-arp
router eigrp 1
network 0.0.0.0
no auto-summary

i still have a problem, EIGRP on spoke(R1 and R2) can’t learn each other.. can anyone help me with this?


now i know why !!

it is because if the split-horizon, it deny the interface from advertise any route out if it learning from it

so, just turn off split-horizon on that interface

 R2(config)#int ser 0/0
R2(config-if)#no ip split-horizon eigrp 1

Tuesday, March 23, 2010

multicast lab - GNS3


setup the lab as below, bear in mind that multicast is depend on the routing table, so make sure all network are reachable to each other.

enable the multicast routing on both router, R1 and R2

R1(config)#ip multicast-routing

configure PIM on the interfaces R1 : fa0/0 and ser0/0 and R2 fa0/0 and ser0/0


R1
interface FastEthernet0/0
 ip address 192.168.1.99 255.255.255.0
 ip pim sparse-dense-mode
 duplex auto
 speed auto
end
interface Serial0/0
 ip address 10.1.1.1 255.255.255.252
 ip pim sparse-dense-mode
 clock rate 56000
end

R2
interface FastEthernet0/0
 ip address 172.16.1.99 255.255.255.0
 ip pim sparse-dense-mode
 duplex auto
 speed auto
end
interface Serial0/0
 ip address 10.1.1.2 255.255.255.252
 ip pim sparse-dense-mode
end

this is it !! now our multicast traffic should run smoothly on our network. But how to test, there's a few method out there, but let's try this way first.

we'll generate multicast 224.1.1.1 on Source, and interface on Receiver will catch this.

Source

ip sla monitor 1
 type udpEcho dest-ipaddr 224.1.1.1 dest-port 12001 source-ipaddr 192.168.1.10 control disable
 timeout 0
 frequency 5
ip sla monitor schedule 1 start-time now

Receiver

interface FastEthernet1/0
 no switchport
 ip address 172.16.1.10 255.255.255.0
 ip igmp join-group 224.1.1.1
end

Source will generate multicast traffic 224.1.1.1 and start to multicast to the network, any interface that join 224.1.1.1 will grab this packet.

run debug on R1 and R2 to see this packet

R1#debug ip mpacket

focus on the highlighted line, you can see the source of the packet, and to which interface it'll be forwarded. There's another instant of multicast if you notice, that is because i try another method, but.. still working on that ;)
R1
*Mar  1 01:12:59.975: IP(0): s=172.16.1.10 (Serial0/0) d=224.0.1.111 (FastEthernet0/0) id=339, prot=17, len=120(120), mforward
*Mar  1 01:14:59.427: IP(0): s=192.168.1.10 (FastEthernet0/0) d=239.1.1.1 (Serial0/0) id=6548, prot=17, len=44(44), mforward
*Mar  1 01:18:03.727: IP(0): s=192.168.1.10 (FastEthernet0/0) d=239.1.1.1 (Serial0/0) id=8407, prot=17, len=44(44), mforward
*Mar  1 01:23:59.031: IP(0): s=192.168.1.10 (FastEthernet0/0) d=239.1.1.1 (Serial0/0) id=8511, prot=17, len=44(44), mforward
*Mar  1 01:24:59.651: IP(0): s=172.16.1.10 (Serial0/0) d=224.0.1.111 (FastEthernet0/0) id=441, prot=17, len=120(120), mforward

R2
*Mar  1 01:11:55.651: IP(0): s=192.168.1.10 (Serial0/0) d=239.1.1.1 (FastEthernet0/0) id=4729, prot=17, len=44(44), mforward
*Mar  1 01:12:56.051: IP(0): s=172.16.1.10 (FastEthernet0/0) d=224.0.1.111 (Serial0/0) id=339, prot=17, len=120(120), mforward
*Mar  1 01:14:59.503: IP(0): s=192.168.1.10 (Serial0/0) d=239.1.1.1 (FastEthernet0/0) id=6590, prot=17, len=44(44), mforward
*Mar  1 01:23:53.903: IP(0): s=192.168.1.10 (Serial0/0) d=239.1.1.1 (FastEthernet0/0) id=8511, prot=17, len=44(44), mforward
*Mar  1 01:24:54.567: IP(0): s=172.16.1.10 (FastEthernet0/0) d=224.0.1.111 (Serial0/0) id=441, prot=17, len=120(120), mforward

To check the routing and path for multicast, run show ip mroute, there's more detail you can check here

R2#sh ip mroute
..
(*, 224.1.1.1), 02:10:47/00:02:13, RP 0.0.0.0, flags: DC
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet0/0, Forward/Sparse-Dense, 02:09:46/00:00:00
    Serial0/0, Forward/Sparse-Dense, 02:10:47/00:00:00

(*, 224.0.1.40), 02:18:14/00:02:05, RP 0.0.0.0, flags: DCL
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    Serial0/0, Forward/Sparse-Dense, 02:17:05/00:00:00
    FastEthernet0/0, Forward/Sparse-Dense, 02:17:46/00:00:00

(*, 224.0.1.111), 01:48:01/00:02:14, RP 0.0.0.0, flags: DC
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    Serial0/0, Forward/Sparse-Dense, 01:48:01/00:00:00
    FastEthernet0/0, Forward/Sparse-Dense, 01:48:01/00:00:00