Friday, June 26, 2009

BGP policy processing order

BGP Policy Processing Order

Inbound

1. Route map
2. Filter list, AS-path access list, or IP policy
3. IP prefix list or Distribute list

Outbound
1. IP prefix list or Distribute-list
2. Filter list, AS-path access list, or IP policy
3. Route map

Wednesday, June 24, 2009

BGP OSPF redistribution.

1. By default, BGP only redistribute ospf network type internal. To redistribute other type of ospf network, you need to add to the redistribution
redistribute ospf 1 ------ Only internal (intra and inter-area) routes
redistribute ospf 1 match external ---- Only external type 1 and 2 route
redistribute ospf 1 match internal external 2 --- only internal and external type 2
redistribute ospf 1 match nssa-external 1 ---- Only nssa-external type 1.

2. By default, iBGP redistribution into IGP is disabled.
Issue the bgp redistribute-internal command under router bgp process in order to enable redistribution of iBGP routes into IGP.

3. BGP and OSPF router-id
If BGP synchronization is enabled, there must be a match for the prefix in the IP routing table in order for an internal BGP (iBGP) path to be considered a valid path.

4. Link for tips. 911network.

Thursday, June 11, 2009

IPv6 ACL implicit rules

IPv6 ACL Implicit Rules
• Implicit permit rules allow neighbor discovery

The following implicit rules exist at the end of each IPv6 ACL to allow ICMPv6 neighbor discovery:

permit icmp any any nd-na
permit icmp any any nd-ns
deny ipv6 any any

Friday, June 05, 2009

Timer for different routing protocol

1. OSPF
Both sides must match the hello and hold timer.
For fast hello which the hello intervla is lower than 1 second, the hello is carried as 0. So the hello multipler dose not need to be match.


2. EIGRP
Two sides will exchange the hold time. It does not need to be matched. The router will use the hold time learn from the neighbor as the hold timer.
Let's say you configure R1 hello=10 Hold=60. R2 with default hello=5, hold=15.
On R1 show ip eigrp neighbor, it will should hold time 15 for R2.
On R2 show ip eigrp neighbor, it will should hold time 60 for R1.

3. BGP
Two sides will exchange the hold time. But the difference between EIGRP and BGP is, BGP will choose the small one as the hold time for both side. And if hello time is not configure, it will calculator from hold time.

Wednesday, April 22, 2009

PIM v2 State refresh

State refresh is used in PIM Dense mode.

By default cisco router will process state-refresh message and forward it. It won't originate the state-refresh message by default.

To enable originate state-refresh message, you need to enable it in the interface on the router that directly connect to the source. This way the router knows when the mroute will be timeout and stop generate the state-refresh message.

interface ser 1/0.25
ip pim state-refresh originate-interval [sec]

Monday, April 13, 2009

How to generate a valid ike debug, vpn debug and fw monitor

Solution
It is very helpful to gather the IKE information in both directions by having both endpoints initiate communications at different times so you can see what each machine proposes to the other and then reconcile the differences. Generate debugs for ike and vpnd on both endpoints.

These debugs are valid for VPN connections between SecureClient and Security Gateways, as well as for site to site VPN connections.

Follow the steps below to generate debug information:

Note: For SecurePlatform you must be logged in as Expert.

  1. Initiate vpn debug on both Security Gateways from the CLI:

    # vpn debug trunc

    Notes:

    • # vpn debug trunc initiates both vpn debug and ike debug. # vpn debug on only initiates vpn debug.

    • If you need the level of detail provided by TDERROR_ALL_ALL=5, then you need to run: vpn debug on TDERROR_ALL_ALL=5.


  2. Initiate packet capture on both Security Gateways (or tcpdump, or Wireshark pcap):

    Note: You can press "Alt + F1" to open a second terminal, or open a second ssh session, or (for Windows) open a second command prompt.

    # fw monitor -e "accept;" -o monitor.out

    or

    fw monitor -e "accept sport=500 or dport=500;" -o monitor.out

    Note: Since VPN-1 Pro NGX R60, you can also run

    # fw monitor -e "accept port(500) or port(4500);" -o monitor.out

    or

    # vpn debug mon

    If you run # vpn debug mon, the output file is ikemonitor.snoop. In this output file, all the IKE payloads are in clear. Whereas, in monitor.out, all the IKE payloads are encrypted.


  3. Run vpn tu.

    Note: Before running vpn tu, kill all traffic over the VPN.


  4. Then select the option that reads "Delete all IPsec+IKE SAs for a given peer (GW)".

  5. Enter your remote Security Gateway IP address.

  6. Exit the utility.

    Important This procedure closes open VPN tunnels. It may be useful, in that, the next time communication is attempted, you will capture the VPN tunnel creation information. Please be aware that existing VPN tunnels with this remote peer will be closed and will have to be reestablished. This is especially important in a Production environment.


  7. Reproduce the issue, attempt to connect FROM YOUR NETWORK to a device in the remote encryption domain. This initiates the tunnel.

  8. Run vpn tu.

    Note: Before running vpn tu, kill all traffic over the VPN.


  9. Then select the option that reads "Delete all IPsec+IKE SAs for a given peer (GW)".

  10. Enter your remote Security Gateway IP address.

  11. Exit the utility.

  12. Reproduce the issue, attempt to connect FROM THE REMOTE NETWORK to a device in the local encryption domain. This initiates the tunnel.

  13. Stop vpn debug on both Security Gateways:

    # vpn debug off

    # vpn debug ikeoff


    Notes:

    • If you used vpn debug on TDERROR_ALL_ALL=5, you only have to run # vpn debug off.

    • If you run # vpn debug mon, you need to run # vpn debug moff.


  14. Stop packet capture by pressing "CTRL+C".


  15. Please send the following files from the Security Gateways to Check Point Support:

    • $FWDIR/log/ike.elg

    • $FWDIR/log/vpnd.elg

    • monitor.out

    • ikemonitor.snoop.

Reseting IKE/IPSec SA in Checkpoint

In VPN-1 NG all IKE/IPSec SAs are saved in the kernal. Therefore, deleting the appropriate kernal table is sufficent.

1. To delete IKE SAs, delete the IKE_SA_table;
2. To delete IPSec SAs, delete the inbound_SPI and the outbound_SPI table.

Notes: All three tables are 'keep' and, therefore, will not be deleted upon policy installation.

To delete a table,

1. Run the command fw -t table_name -x
2. Type 'yes' in the confirmation prompt.

Thursday, March 19, 2009

IGMP v2 Timer

The following timer(1-3) are configurable in the Cisco router under the interface.

1. Query interval: (ip igmp query-interval)
A time period between General Queries sent by a router. Cisco default is 60 sec. (RFC is 125 sec)

2. Query Response Interval: (ip igmp max-response-time)
The maximum response time (MRT) for hosts to respond to the periodic general Queries. Default is 10 sec. MRT timer to suppress many of the unnecessary IGMP reports. Report suppression is when a host receives a report sent by another host for the same mcast group for which it is planning to send a report, host does not send. 3 second MRT is expressed as 30.

3. Other Querier Present Interval (RFC) or Querier Timeout (Cisco)
To configure the timeout period before the router triggers Internet Group Management Protocol (IGMP) querier reelection for the interface, use the ip igmp querier-timeout command in interface configuration mode. To restore the default value, use the no form of this command.

4. Last Member Query Interval and Last Member Query Count
These values determine how long it takes a router to believe that all hosts on a LAN have left a particular group. By default, routers use an MRT of 10 (1 second) for Group-Specific Queries; because a router should receive a response to a Group-Specific Query in that amount of time, the router uses the MRT value as the value of the Last Member Query Interval. So, the router uses the following process:
1). Send a Group-Specific Query in response to an IGMP Leave.
2). If no Report is received within the Last Member Query Interval, repeat Step 1.
3). Repeat Step 1 the number of times defined by the value of the Last Member Query Count.
The Last Member Query Count is the number of consecutive Group-Specific Queries sent for the same group before the router concludes that there are no active members of the group on a subnet.
The default value for the Last Member Query Count is 2. So, the leave latency is typically less than 3 seconds, compared to up to 3 minutes with IGMPv1.
ip igmp last-member-query-count
ip igmp last-member-query-interval


The following ones are not configurable.
1. Group Membership Interval
The Group Membership Interval is the amount of time that must pass before a multicast router decides there are no more members of a group on a network. This value MUST be ((the Robustness Variable) times (the Query Interval)) plus (one Query Response Interval).

Friday, March 06, 2009

Using IP Multicast Over Frame Relay Networks

A few concern.

A multipoint interface won't, by default, send multicast received from one spoke out to another spoke.

Either of the following recommended solutions—which are described in this document—can be used to configure IP multicast over Frame Relay:
•NBMA mode
•Point-to-point subinterfaces

Cisco suggests to use P2P. But in the lab, you have no choise to choose.


NBMA interface:
In reality, however, broadcast or multicast traffic sent by a remote site router will be received only by the central site router, not by the other remote site routers, because each remote site router is connected point-to-point to the central site router.

The following example illustrates a specific issue regarding IP multicast deployment within the partial mesh design of Frame Relay networks. If a remote site router sends a Protocol Independent Multicast (PIM) prune message, only the central site router will receive the prune message. Consequently, other remote site routers cannot override this prune message. This situation could prevent members of multicast groups from receiving multicast traffic that they want.

NBMA mode solution:

In a Frame Relay network that uses IP multicast, NBMA mode improves router performance for the following reasons:
•Traffic is fast-switched rather than process-switched.
•Routers receive traffic only for the multicast groups to which they are joined.


When using the ip pim nbma-mode command, note the following usage guidelines:
•This command applies to only PIM sparse mode configurations because its functionality is dependent on the PIM sparse mode join message.
•As the number of PIM neighbors increases, the outgoing interface list increases. Each interface entry requires additional resources from the NBMA mode-enabled router, therefore increasing data replication time and memory utilization.


Auto-RP Issues with NBMA Mode
The NBMA mode feature does not support PIM dense mode. Auto-RP, a method for disseminating rendezvous point (RP) information in an IP multicast network, relies on dense mode flooding of data from two well-known multicast group addresses, 224.0.1.39 and 224.0.1.40. These groups are candidate RP and RP mapping information groups. Without dense mode flooding capability, multicast routers in a Frame Relay network using Auto-RP may have problems receiving RP mapping information unless the Mapping Agent (MA) is placed in the appropriate location within the network or a more costly full mesh architecture is created.
Use the following guidelines when placing the MA in your network:
•All candidate RPs must be connected to the MA.
•All MAs must be connected to all PIM routers.

Friday, February 20, 2009

IP SLA - Timeout or Threshold

Timeout is the maximum time required for SLA operation to complete - for example the timeout waiting for probe response. Threshold is boundary value measured ove the operation RESULT (e.g. RTT, or jitter value collected during the opearation). Crossing threshold usually means SLA contract violation. Note that these two values apply to DIFFERENT objects.

Timeout is directly used to restart the operation. Threshold is used to activate a response to IP SLA violation, e.g. send SNMP trap or start seconday SLA operation.

You should configure the sla based on Frequency > Timeout > Threshold.



For Cisco.com

Q. What does the term threshold and timeout in IP SLA operation mean?

A. Threshold sets the rising threshold that generates a reaction event and stores history information for an IP SLAs operation.
Timeout sets the amount of time an IP SLAs operation waits for a response from its request packet.


Example:

If you configure Timeout > Threshold, you can see the RTT and if the RTT exceed Threshold, it is a failure. If you configure Threshold > Timeout, if the RTT exceed timeout but less than Threshold, it won't show the RTT but it is still a failure.
So failure is RTT exceed either Timeout or Threshold.

ip sla monitor 1
type echo protocol ipIcmpEcho 115.0.0.1
timeout 500
threshold 20
frequency 10

Rack1R6#show ip sla monitor statistics
Round trip time (RTT) Index 1
Latest RTT: 36 ms
Latest operation start time: *04:12:47.001 UTC Mon Mar 4 2002
Latest operation return code: Over threshold
Number of successes: 0
Number of failures: 6
Operation time to live: Forever

Traffic filter

1. Using ACL

2. Using policy-map.

class-map from-bb1
match input-interface fa 0/0
policy-map
class from-bb1
drop.

IPV6 redistribution.

1. By default it won't redistribute the connect interfaces over which the source protocol is running.

To enable it, there is an option " include-connected"

ipv6 router rip 1
redistribute ospf 1 include-connected.

Thursday, February 19, 2009

Auto-RP Access-list filter

To enable rp mapping for special group, you need to configure the send-rp-announce filter first on rp, and the use rp-anounce-filter on rp mapping agent.


1. It is not support fancy acl.
access-list 1 permit 224.0.0.0 8.255.255.255
or
access-list 1 permit 224.0.0.0 1.255.255.255
are same, which will cause the rp announce 224.0.0.0/7 out.
Answer:
8 - 00001000
1 - 00000001
both have 7 bits of 0 so it useing 224.0.0.0/7

You can try 14.255.255.255 and 7.255.255.255.
14 - 00001110
7 - 00000111
and they are same. 224.0.0.0/5


So you should just use all right side 1 ACL, cannot have 0 between 1. Just like network mask.

Reason: In the annoucement and mapping messages, it only carries mask length instead of the whole wide card mask.

Wednesday, February 18, 2009

MLPoFR

In my example, I will show how I bundle two 2 Mbps frame relay line to act as one 4 Mbps line.

We have to do below configuration on both sides.
1)We will make an ordinary frame relay configuration on serial interfaces except “frame-relay interface-dlci 16 ppp Virtual-Template1” line. Here we are adding Virtual-Template1. frame-relay traffic-shaping command is a MUST. (otherwise it will show an error.)
2)Under “interface Virtual-Template1“ we describe that it is a part of multilink interface
3)Under “interface Multilink1” we will configure IP settings.


interface Multilink1
ip address 174.1.23.3 255.255.255.0
no peer neighbor-route
ppp authentication chap
ppp multilink
ppp multilink group 1

interface Virtual-Template1
no ip address
ppp multilink
ppp multilink group 1 (To restrict a physical link to joining only a designated multilink-group interface. By default this command is disabled, which means the link can negotiate to join any bundle in the system.)

interface Serial1/0
no ip address
encapsulation frame-relay
serial restart-delay 0
no dce-terminal-timing-enable
frame-relay interface-dlci 302 ppp Virtual-Template1
!
interface Serial1/1
no ip address
encapsulation frame-relay
serial restart-delay 0
no dce-terminal-timing-enable
frame-relay interface-dlci 312 ppp Virtual-Template1



Note:
1. You can configure both bandwidth under multilink or virtual-template interface. If you only configure virtual-template, the multilink interface will automatically calculator the bandwidth based on how many links. Or if you configure bandwidth under multilink, then it will keep the bandwidth regardless how many links in the bundle.

Tuesday, January 13, 2009

LAB Strategy

1. Copy running-config to flash for later review.
copy runn flash://bk-confg

2. Put in alias
config t
no ip domain-lookup
alias exec begin show running begin
alias exec section show running section
alias exec sip show ip interface brief excl una
alias exec sir show ip route
alias exec cdp show cdp neighbor
ip cef
line con 0
exec-timeout 0
logging syn
end
wr

3. Find out the physical connection.
For each router, list ethernet connection and cdp neighbor, vlan.
For each switch, list SVI interface.
For each switch has the layer 3 interface, find out the cdp neighbor(It must be connect to another switch port that has the actual vlan configured)

R1 e0/0 -------vl5-------- Sw2 fa1/0
SW1 vlan 7, 77, 777
SW1 fa1/12 IP ------ vl32 --------- SW2 1/12 layer2

4. Draw Layer 2 topology. Based on step 3, you should be able to place routers around and make a better picture. You can use show cdp neighbor to find out the connection to BB routers.

Monday, December 29, 2008

RIPv2

1. RIP v1 &2 has a maximum datagram size (with an eight-byte UDP header) of 512 octets. So it is up to 25 route entries (each is 20 bytes).


2. RIP v2 support authentication.
Simple password authentication: it will use the first route entry. So it leaves only 24.
MD5 authentication: it will use the first and last one. So it leaves only 23.
You need to configure the authentication under interface.
3. Unicast update.
By default RIP uses broadcast(v1) or multicast(v2) to send updates. To use unicast update, you need to enable the interface to be part of the network, then mark it as passive interface and finally configure neighbor.
Passive interface just makes the interface no sending out broadcast or multicast updates. But it will still listen to the updates.

Tuesday, December 23, 2008

AD and EIGRP

1. When receiving a new EIGRP update, Will it compare inside the EIGRP topology firstly and then AD?

Let's look at the sample.

10.1.0.0 learn from BGP and then redistributed into EIGRP on R1.

default-metric 10000 10 1 255 1500
distance 200 0.0.0.0 255.255.255.255 10
access-list 10 permit 10.1.0.0

Then R1 receives an new update from its neighbor R2 with 10000 1200 1 255 1500.

So from the eigrp topology perspective, the one redistributed from BGP has better metrci than the one from R2. But the AD for R2 is 170, and 200 for BGP. Which one is prefer????

Answer, it prefers the AD first. So in R1's routing table, 10.1.0.0 is from EIGRP instead of R2.

ip alias

1. show ip alias

It will should all the IP address, it is better than using show ip int bri.

2. ip alias can be use for un-exist host.
Sample configuration:
R1#(config)int fa 1/0
R1#(config-inf) ip add 192.168.1.2 255.255.255.0
R1#(config)ip alias 192.168.1.10 23

when you ping 192.168.1.10, the arp will resolve from 192.168.1.2. When you telnet 192.168.1.10, it will actually telnet to 192.168.1.2.

Usually, it will be used in reverse telnet.
ip alias 172.16.1.10 2001
ip alias 172.16.1.11 2002

So you can just "telnet 172.16.1.10" than it will reverse telnet to one of the serial ports.

Tuesday, December 09, 2008

PVST+

Cisco switches run different types of STP protocol, depending on whether the connected port is access, ISL trunk or 802.1q trunk. Natively, a Cisco switch runs a separate STP instance for each configured and active VLAN (this is called Per-VLAN Spanning Tree or PVST) and standard IEEE compliant switches run just one instance of STP protocol shared by all VLANs. Due to that, a group of switches running IEEE compatible STP protocol is called MST (Mono Spanning Tree) region.

Access Ports. Cisco switches run classic version of IEEE STP protocol on the access ports. The IEEE STP BPDUs are sent to IEEE reserved multicast MAC address “0180.C200.0000” using IEEE 802.2 LLC SAP encapsulation with both SSAP and DSAP fields equal to “0×42”. (By the way, for the purpose of Layer2 filtering, IEEE BPDUs could be matched using a MAC ACL with LSAP value of ”0×4242”). Note that you can plug any standard IEEE compliant switch into a Cisco switch access port and they will interoperate perfectly, joining the respective access VLAN STP instance with the IEEE STP instance (MST).

ISL Trunks. Across ISL trunks, Cisco switches run PVST (Per-VLAN Spanning Tree). (Note that PVST feature is limited to ISL trunks only). The same IEEE STP BPDUs are sent for each VLAN, encapsulated in additional ISL header (which also carries the VLAN number). The magic part is that ISL header has special flag to distinguish frames carrying STP BPDUs and this is how PVST can re-use the regular IEEE BPDUs to simulate multiple spanning trees. Since PVST BPDUs have the same format as IEEE BPDUs (that is IEEE 802.2 LLC SAP) they can be matched using the same SSAP/DSAP values of “0×42” for the purpose of Layer 2 filtering.The group of Cisco switches connected using ISL trunks only is called PVST region.

802.1q Trunks. Across 802.1q trunks, Cisco switches run PVST+ (Per VLAN Spanning Tree Plus). Now this is where things are getting complicated. The goal of PVST+ is to interoperate with standard IEEE STP (MST) and allow transparent tunneling of PVST instance BPDUs across MST region (to potentially connect to other Cisco switches across the MST region). For further consideration, we call a group of Cisco switches connected using 802.1q trunks as PVST+ region. Note that PVST+ region may connect to a PVST region using an ISL trunk and connect to MST region using a 802.1q trunk. The STP instances in PVST and PVST+ regions maps directly to each other, so no special interoperability solution is required. However, on MST side only one STP instance exists, contrary to many STP instances of PVST+ region. The first question is: if we want to interoperate with MST, which PVST VLAN’s STP instance should be joined with MST? Cisco chooses VLAN 1 for this purpose. The joined together instances of Cisco VLAN 1 STP and MST are called “Common Spanning Tree” or CST (naturally, CST spans PVST, PVST+ and MST regions). As for the detailed PVST+ operations on 802.1q port, consider two following cases.

Lastly, for the purpose of layer 2 filtering, remember that you can match SSTP BPDUs using an ethertype value “0×010B”.This works with multilayer switches even though SSTP BPDUs are SNAP encapsulated, and the actual field is not “ethertype” but rather a SNAP Protocol ID.

mac access-list extended IEEE_STP&PVST&MIST
permit any any lsap 0x4242 0x0
mac access-list extended PVST+
permit any any 0x10B 0x0

VLAN ACL

1. Tips
ARP are not IP packet, so you must be enabled it using mac ACL.
STP/PVST, PVST+ are something need to be enable too.


2. IP ACL
The CAT 3550 and 3560 switches process IP Packets in a different way than the non-IP Packets. So it is Mandatory to use IP access-list.

We cannot use a MAC access-list to allow IP Packets.

3. Sample
So, we have two different requirements there...
Forward all "non-IP" frames sourced from those two specific MAC Addresses; That requires a MAC Access-List.
Permit only ICMP, denying everyting else. That requires an IP Access-List (the one we´re all used to).

Ok, so let´s create our MAC Access-List:

mac access-list extended Allow Those
permit 000b.dc24.ca47 any
permit 000b.dc25.cb51 any

That will handle the first requirement.
Now the second one IP Access-List allowing ICMP and denying everything else:
access-list 101 permit icmp any any

Ok! Now, we need to create the VACL (or VLAN Maps, which one you prefer to call it) applying those rules:
vlan access-map Filter-VL7 10
action forward
match mac address AllowThose
!
vlan access-map Filter-VL7 20
action forward
match ip address 101
!
vlan access-map Filter-VL7 30
action drop

Now it looks ok, right?! Time to apply it to VLAN7 ?! What do you think about?! Let´s try?!

vlan filter Filter-VL7 vlan-list 7

Now testing! See if you can ping! Not working?! Hmmm... interesting... but why?! Well... I told... The MAC Access-List would bring all the interesting issues to the table! And, in fact, it did! It´s allowing only those two MAC Address and nothing else! How about ARP?! Do we need it to make things work?! Of course we do! And that´s where we have most confusion! Just keep in mind, the end of an Access-List is always deny any any! So if there are no matching instances for ARP in the MAC Access-List, it´ll be dropped!
How to fix it?! Simple, allow it in the MAC Access-List:
permit any any 0x0806 0x0000 permit any any lsap 0xAAAA 0x0000
But wait a minute! What´s that 0x0806 and lsap 0xAAAA ?! That´s the Ethertypes we´re allowing in our MAC Access-List, first one (0x806) is ARP, and the second one (lsap 0xAAAA) is PVST+. You do not want your switch running unprotected from loops right?! So it´s better to allow it!
For the sake of simplicity, the full configuration would be this one:
mac access-list extended AllowThose
permit 000b.dc24.ca47 any
permit 000b.dc25.cb51 any
permit any any 0x0806 0x0000
permit any any lsap 0xAAAA 0x0000 (This is copy from Link. This matches all the snap packet. To be more specifical, use permit any any 0x010b 0x0000).
!
access-list 101 permit icmp any any
!
vlan access-map Filter-VL7 10
action forward
match mac address AllowThose
!
vlan access-map Filter-VL7 20
action forward
match ip address 101
!
vlan access-map Filter-VL7 30
action drop
!
vlan filter Filter-VL7 vlan-list 7



The most common Ethertypes are: (and probably the ones asked in the LAB)
0x0806 = ARP
0x0800 = IP
0x010b = PVST+
(actually is inside the snap packet, lsap 0xAAAA)
0x4242 = STP and PVST
0x86DD = IPv6

Again... we need to understand all the little pieces involved in a particular task, and remember about the basics, OSI Model, ARP, and so on! It´s not difficult, but it´s a little confusing at the first time! Just go ahead, drink some watter (I did it several times) come back again, read over, and try some scenarios yourself, don´t have equipment?! Try it on Notepad, just try some, compare with the example, and you´ll see how easy it can be! The best way to learn is trying it yourself! ;)
You can also find a nice explanation about that in the wonderful Arden Packeer´s Blog, just click here and it´ll direct you to the post.