Networking-Blog

My WordPress Blog

Cisco DHCP

Cisco Dhcp Configuration :

ip dhcp excluded-address 10.10.10.250 10.10.10.254
!
ip dhcp pool DATA
   import all
   network 10.10.10.0 255.255.255.0
   default-router 10.10.10.254
   domain-name comms.co.uk
   dns-server 10.10.10.50 10.10.10.51 10.10.10.52
   netbios-name-server 10.10.10.50 10.10.10.51 10.10.10.52
   lease 0 2
   update arp

Cisco SHDSL

Cisco SHDL Configuration :
Global Configuration Mode :

controller DSL 0
mode atm
line-term cpe
line-mode 2-wire line-zero
dsl-mode shdsl symmetric annex B
ignore-error-duration  15
line-rate auto
snr margin snext 10
!
interface ATM0
no ip address
atm vc-per-vp 128
pvc 0/38
encapsulation aal5mux ppp dialer
dialer pool-member 1
!
interface Dialer0
ip address negotiated
ip nat outside
encapsulation ppp
dialer pool 1
dialer-group 1
ppp authentication chap callin
ppp chap hostname test@comms.net
ppp chap password 0 test
ppp ipcp dns request
!
interface Vlan1
description Corporate VLAN
ip address 10.2.223.254 255.255.255.0
ip nat inside
!
ip nat inside source list 101 interface Dialer0 overload
!
access-list 101 permit ip 10.2.223.0 0.0.0.255 any
!
dialer-list 1 protocol ip permit
!

Show Commands :

show interface atm 0
!
show controller shdsl 0

SHDSL 0 controller UP
SLOT 3: Globespan xDSL controller chipset
Frame mode: Serial ATM
Configured Line rate: 1160Kbps
Line Re-activated 0 times after system bootup
LOSW Defect alarm: None
CRC per second alarm: None
Line termination: CPE
FPGA Revision: 9

Related Commands :

dsl linerate — Specifies a line rate for the DSL ATM interface.
dsl operating-mode (g.shdsl) — Specifies an operating mode of the DSL ATM interface.

Issue the dsl linerate command in ATM interface mode to specify a line rate for the DSL ATM interface.

dsl linerate {kbps | auto} kbps — Specifies a line rate in kilobits per second for the DSL ATM interface.
Allowable entries are 72, 136, 200, 264, 392, 520,776, 1032, 1160, 1544, 2056, and 2312.

auto — Configures the DSL ATM interface to automatically train for an optimal line rate by negotiating with the far-end DSL Access Multiplier (DSLAM) or WIC.

The DSL ATM interface automatically synchronizes its line rate with the far-end DSLAM or WIC.



Path MTU Discovery and Filtering ICMP

Path MTU

 

The smallest MTU of any link on the current path between two hosts.
This may change over time since the route between two hosts, especially on the Internet, may change over time. It is not necessarily symmetric and can even vary for different types of traffic from the same host.

Fragmentation

When a packet is too large to be sent across a link as a single unit, a router can fragment the packet.
This means that it splits it into multiple parts which contain enough information for the receiver to glue them together again. Note that this is not done on a hop-by-hop basis, but once fragmented a packet will not be put back together until it reaches its destination.

Fragmentation is undesirable for numerous reasons, including:

  • If any one fragment from a packet is dropped, the entire packet needs to be retransmitted. This is a very significant problem.
  • It imposes extra processing load on the routers that have to split the packets.
  • In some configuration, simpler firewalls will block all fragments because they don’t contain the header information for a higher layer protocol (eg. TCP) needed for filtering.

DF (Don’t Fragment) bit


This is a bit in the IP header that can be set to indicate that the packet should not be fragmented by routers, but instead an ICMP “can’t fragment” error is returned sent to the sender and the packet is dropped.

ICMP Can’t Fragment Error


This error (type 3 (destination unreachable), code 4 (fragmentation needed but don’t-fragment bit set)) is returned by a router when it receives a packet that is too large for it to forward and the DF bit is set.
The packet is dropped and the ICMP error is sent back to the origin host.

Normally, this tells the origin host that it needs to reduce the size of its packets if it wants to get through. Recent systems also include the MTU of the next hop in the ICMP message so the source knows how big its packets can be.
Note that this error is only sent if the DF bit is set; otherwise, packets are just fragmented and passed through.

MSS

The MSS is the maximum segment size.
It can be announced during the establishment of a TCP connection to indicate to the other end the largest amount of data in one packet that should be sent by the remote system.

Normally the packet generated will be 40 bytes larger than this; 20 bytes for the IP header and 20 for the TCP header. Most systems announce a MSS that is determined from the MTU on the interface that the traffic to the remote system passes out from the system through.

Path MTU Discovery (PMTU-D)

Now you know that Path MTUs vary.
You know that fragmentation is bad.

The solution?

Well, one solution is Path MTU Discovery.

A. The idea behind it is to send packets that are as large as possible while still avoiding fragmentation.

B. A host does this by starting by sending packets that have a maximum size of the lesser of the local MTU or the MSS announced by the remote system.

C. These packets are sent with the DF bit set.

D. If there is some MTU between the two hosts which is too small to pass the packet successfully, then an ICMP can’t fragment error will be sent back to the source. It will then know to lower the size; if the ICMP message includes the next hop MTU, it can pick the correct size for that link immediately, otherwise it has to guess.

Now, to the problem with ICMP filtering and PMTU-D

Many network administrators have decided to filter ICMP at a router or firewall.
There are valid (and many invalid) reasons for doing this, however it can cause problems. ICMP is an integral part of the Internet and can not be filtered without due consideration for the effects.


In this case, if the ICMP can’t fragment errors can not get back to the source host due to a filter, the host will never know that the packets it is sending are too large.

This means it will keep trying to send the same large packet, and it will keep being dropped–silently dropped from the view of any system on the other side of the filter.

While a small handful of systems that implement PMTU-D also implement a way to detect such situations, most don’t and even for those that do it has a negative impact on performance and the network.

Many packet filters will allow you to setup filters to only allow certain types of ICMP messages through.


e.g :

access-list  199 remark Permit Path MTU to function.
access-list 199 permit icmp any any packet-too-big

If you reconfigure them to let ICMP can’t fragment (type 3, code 4) messages through the firewall, the problem should disappear.

Cisco Maximum Transmission Unit (MTU)

(TCP, IP, MTU and MSS magic numbers)

1500 The biggest-sized IP packet that can normally traverse the Internet without getting fragmented. Typical MTU for non-PPPoE, non-VPN connections.
1492 The maximum MTU recommended for Internet PPPoE implementations.
1472 The maximum ping data payload before fragmentation errors are received on non-PPPoE, non-VPN connections.
1460 TCP Data size (MSS) when MTU is 1500 and not using PPPoE.
1464 The maximum ping data payload before fragmentation errors are received when using a PPPoE-connected machine.
1452 TCP Data size (MSS) when MTU is 1492 and using PPPoE.
576 Typically recommended as the MTU for dial-up type applications, leaving 536 bytes of TCP data.
48 The sum of IP, TCP and PPPoE headers.
28 The sum of IP and ICMP headers.

Reduce 1472 by 10 until you no longer get the “packet needs to be fragmented” error message.
Then increase by 1 until you are 1 less away from getting the “packet need to be fragmented” message again.

Add 28 more to this (since you specified ping packet size, not including IP/ICMP header of 28 bytes),
and this is your MaxMTU.

Note: If you can ping through with the number at 1472, you are done! Stop right there.

Add 28 and your MaxMTU is 1500.

For PPPoE, your MaxMTU should be no more than 1492 to allow space for the 8 byte PPPoE “wrapper,”
but again, experiment to find the optimal value.
For PPPoE, the stakes are high: if you get your MTU wrong, you may not just be sub-optimal, things like
UPLOADING or web pages may stall or not work at all!

Cisco Source Quench

 When does a Cisco router generate a source quench?

A Cisco router generates a source quench only if it does not have the buffer space needed to queue the packet. 
If the router can’t queue the routed packet onto the output interface’s queue, it generates a source quench and
registers an output drop against the output interface. If the router isn’t congested, it won’t generate a source quench.

show ip traffic   – Output for source quenches sent.
show interface  – See if there are any drops. If there are none, then you should not see any source quench.

Cisco GRE Tunnel Over Ipsec VPN

Cisco GRE Tunnel over IPSEC VPN Configuration:

 Router 1 Configuration:crypto isakmp policy 10
encryption aes 128
hash sha
autentication pre-share
group 2
!
crypto isakmp key cisco address 193.1.1.1 255.255.255.255 no-xauth
crypto ipsec transform-set ciscotransit esp-aes esp-sha-hmac
!
crypto ipsec profile VTI
set transform-set ciscotransit
exit
!
interface tunnel 0
ip address 10.10.12.1 255.255.255.0
tunnel source 192.1.1.1
tunnel destination 193.1.1.1
tunnel mode ipsec ipv4
tunnel protection ipsec VTI
!
interface G0/1
ip address 192.1.1.1 255.255.255.0
exit
!
interface G0/0
ip address 10.10.10.1 255.255.255.0
exit
!
ip route 10.10.11.0 255.255.255.0 tunnel 0
end
!

Router 2 Configuration on Remote end:

crypto isakmp policy 10
encryption aes 128
hash sha
autentication pre-share
group 2
!
crypto isakmp key cisco address 192.1.1.1 255.255.255.255 no-xauth
crypto ipsec transform-set ciscotransit esp-aes esp-sha-hmac
!
crypto ipsec profile VTI
set transform-set ciscotransit
!
interface tunnel 0
ip address 10.10.12.3 255.255.255.0
tunnel source 193.1.1.1
tunnel destination 192.1.1.1
tunnel mode ipsec ipv4
tunnel protection ipsec VTI
!
interface G0/1
ip address 193.1.1.1 255.255.255.0
!
interface G0/0
ip address 10.10.11.1 255.255.255.0
!
ip route 10.10.10.0 255.255.255.0 tunnel 0

Notes:

tunnel mode ipsec ipv4

 “Command to notify the router that this is an IPSec-based interface rather than GRE”.

 tunnel protection ipsec

 “Command to choose the type of encryption (transform-set) for the interface”.

Note:

What I did was create the tunnel interfaces on both ends

Enable EIGRP and enable the process on the tunnel ip addresses

Then I created a loopback interface and advertised that into EIGRP

Now I can track the route so if the main interface would drop the tunnel would still show up/up  but would drop its EIGRP adjacency which would drop the route.

Show Commands:

show ip interface brief
show crypto isakmp sa
sh0w crypto ipsec sa
show crypto session

Cisco HSRP

HSRP track ip route

config t
int g0/1
track 1 ip route 10.1.20.0/24 reachability

Track the route so if the main interface would drop the tunnel would still show up/up but would drop its EIGRP adjacency which would drop the route.

Cisco Show Commands

1. Display values about routing protocols and routing protocol timer information:

  router#show ip protocols

2. Display ip routing table:

  router#show ip route

3. Display routing protocols updates:

  router#debug ip rip
  router#debug ip igrp
  router#debug ip eigrp
  router#debug ip ospf

4. Verify OSPF Configuration:

  show ip protocol
  show ip route
  show ip ospf interface
  show ip ospf
  show ip ospf neighbour detail
  show ip ospf database
  clear ip route*
  clear ip route address
  debug ip ospf

5. Verify EIGRP Configuration:

  show ip protocol
  show ip route
  show ip eigrp neighbors (interface no) details
  show ip eigrp interfaces (interface no) (as-number) details
  show ip eigrp topology (as-number) (ipaddress) (mask)
  show ip eigrp topology (active) (pending) (zero-successors)
  show ip eigrp toplogy all-links
  show ip eigrp traffic (as-number)
  debug eigrp fsm
  debug eigrp packet

6. Hyper Terminal Settings

  Bits per second : 9600
  Data bits : 8
  Parity : None
  Stop bits : 1
  Flow control : Hardware

7. Show Port Properties:

  switch#show interface fastethernet0/1
  router#show interface fastethernet0/1

8. VLAN properties:

   switch#show vlan

9. Show Directory Flash:

  switch#directory flash:
  router#show flash

10. Display IOS Version Information:

  switch#show version

11. Managing Mac Address Table:

  switch#show mac-address-table
  switch#clear mac-address-table

12. Show running-config and startup-config

  switch#show running-config
  switch#show startup-config

  Copy Configurations:

  copy startup-config running-config
  copy running-config startup-config
  copy running-config tftp
  copy startup-config tftp
  copy flash tftp : Uploads IOS to tftp server.
  copy tftp flash : Downloads IOS from tftp to flash.
     
13. Port Information Support:

  switch#show port capabilities 2/1

14. Download and run Router Configuration from tftp server every time router start

  router(config)#boot host tftp

15. Prevent debug messages output interruption while typing commands:

  router(config-line)#logging synchronous

16. View CDP Information received from all routers:

  router#show cdp entry

17. Command used to view port-channel information on 2950 Cataslyst switch:

  switch#show etherchannel

18. Command Used to send Debug output to RAM:

  router(config)#logging buffered

  To View Logging :

  router#show log

19.  Command to display list of static and dynamic mappings between ip addresses and frame-relay DLCIs:

  router#show frame-relay map

20. Command would display the status of DLCI and traffic:

  router# show frame-relay pvc

21. Command used to check physical layer of interface BRI connection:

  router#show interface bri 0
  router#show isdn status

22. Command used in a 2950 catalyst switch to see a list of forwarding ports in                 
    spanning tree. (Including a list of all port in each vlan , whether they are             
    forwarding or blocking etc:

  router#show spanning-tree
 
23. Command to display current port status and VLAN assignment:

  router#show interface status

Cisco sysopt

Allow packets from an IPsec tunnel and their payloads to bypass interface ACLs on the security appliance.
IPsec tunnels that are terminated on the security appliance are likely to fail if one of these commands is not enabled.

sysopt connection permit-ipsec
sysopt connection permit-vpn

Additional Commands :

show sysopt
show running-config sysopt