DHCP Helper address

This week a project manager contacted me with an rather peculiar question. I work with this project manager now for almost two years. And I know he is technically very skilled.  So if he doesn’t know the answer then the answer is not always straight forward.

I currently work for a large telco in the Netherlands. One of the services offered is DHCP-relay. Technically this is a very basic and straight forward service. The customer wanted to know which address is used as source address in the packets destined to the DHCP server. This was needed to set some static routes.

Okay lets start labbing, within GNS3 I made the following lab setup;

DHCPHelper_Source

IP addresses used are;

  • DHCP-Server
    • e0/0   172.16.1.1
  • Router
    • e0/0   172.16.1.2
    • e1/0.1 192.168.1.1 (switch management vlan)
    • e1/0.100 192.168.100.1 (customer vlan)
  • Switch
    • vlan1 192.168.1.10
  • PC1
    • e0 will get ip from DHCP server.

Router config  interface facing the dhcp client.

interface Ethernet1/0.100
 encapsulation dot1Q 100
 ip address 192.168.100.1 255.255.255.0
 ip helper-address 172.16.1.1  
end

With the set up ready I am able to get an ip address. During the DHCP negotiation wireshark is gathering information on the link between the router and the dhcp-server.

DHCP request and reply

Opcode: 1 (REQUEST)
Client IP Address: 192.168.100.13
Your IP Address: 0.0.0.0
Server IP Address: 0.0.0.0
Gateway IP Address: 0.0.0.0
Client MAC Address: 00:50:79:66:68:00
Option 53: Message Type = Request
Option 54: DHCP Server = 172.16.1.1
Option 50: Requested IP Address = 192.168.100.13
Option 61: Client Identifier = Hardware Type=Ethernet MAC Address = 00:50:79:66:68:00
Option 12: Host Name = PC11

Some messages have been omitted for readability. In the process prior to assigning an IP address the DHCP server chooses an IP and checks uniqueness in the network using ping.

Opcode: 2 (REPLY)
Client IP Address: 192.168.100.13
Your IP Address: 192.168.100.13
Server IP Address: 0.0.0.0
Gateway IP Address: 192.168.100.1 
Client MAC Address: 00:50:79:66:68:00
Option 53: Message Type = Ack
Option 54: DHCP Server = 172.16.1.1
Option 51: Lease Time = 86400
Option 58: Renewal Time = 43200
Option 59: Rebinding Time = 75600
Option 1: Subnet Mask = 255.255.255.0
Option 3: Router = 192.168.100.1

 IP 192.168.100.13/24 GW 192.168.100.1

To be honest I set a static route on the DHCP-server

ip route 192.168.100.0 255.255.255.0 172.16.1.2

What does Wireshark tell me ?  This whole exercise is undertaken to ‘see’ what information passes from the router to the dhcp-server and vice-versa.

I expect a dhcp discover followed by a offer. Between discover and offer the dhcp-server should ping the ip address which it is going to serve to the dhcp-client. No ping reply means; ip address if not currently in use. No duplicate ip addresses are injected.

DHCPHelper_Wireshark

A little close-up reveals the answer;

DHCPHelper_Wireshark2

The DHCP unicast packet is sourced by 192.168.100.1 which is the router interface facing the dhcp-client. This interface contains the ip helper-address 172.16.1.1 statement.

NOTE: the network diagram is overly simplified. First because I do not wish to reveal any business proprietary information. Second it withdraws focus from the question at hand.

NOTE2: Thank you David Theuns for being your ‘vraagbaak’.

Advertisements
Posted in CCNP, GNS3 | Tagged , , , | 1 Comment

GNS3 caveat – port status

Creating a network lab in GNS3 is reliefs on budget. But there are some drawbacks. One of which is port status. I have noticed that using GNS3 in combination with iouyap results in some unexpected behavior.

Once a topology is made in GNS3. And one interface is set administrative operational, with no shut. The port immediately becomes operational i.e. up/up. Within GNS3 there is no such thing as admin up/operational down.

At this point I know that two protocols can help detect L2 communication with adjacent node. Those are UDLD and BDF.

Beware not to waste time in resolving/troubleshooting GNS3 problem. Instead of resolving network problems.

Posted in Commands, GNS3 | Tagged , , ,

Extended IP Access-list

As we all have learned in our pursuit to CCNA there are many different types of access-list. In reality most commonly used are ip access lists.

Major difference between ip standaard access-list an ip extended access-list is the ability to insert and remove entries within the ACL. When an entry has to be removed with in an standard ACL the entire ASL need to be removed and added again. The latter off course without the ACE which needs removal.

A extended ACL has slightly more steps but has some major benefits. Let say you have the following ACL;

access-list 130 permit ip host 1.1.1.1 host 99.99.99.99
access-list 130 permit ip host 3.3.3.3 any
access-list 130 deny ip any any

And the entry “permit ip host 3.3.3.3 any” must be replace with “permit ip host 3.3.3.3 host 99.99.99.99”

The following steps need to be taken are;

  • Obtain information about the ‘rule number’
  • Insert new ACE
  • Remove wrong ACE
  • Resequence rule numbers

Obtain rule number information

R4#sh access-lists 130
Extended IP access list 130
 10 permit ip host 1.1.1.1 host 99.99.99.99
 20 permit ip host 3.3.3.3 any
 30 deny ip any any

Insert new ACE

Rule 11 until 19 are free to use. Same goes for 21 until 29. Let use number 15.

R4#conf
*Feb 19 13:13:35.871: %SYS-5-CONFIG_I: Configured from console by console
R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#ip access-list extended 130 
R4(config-ext-nacl)#15 permit ip host 3.3.3.3 host 99.99.99.99
R4(config-ext-nacl)#end
R4#
*Feb 19 13:14:24.206: %SYS-5-CONFIG_I: Configured from console by console
R4#sh access-lists 130 
Extended IP access list 130
 10 permit ip host 1.1.1.1 host 99.99.99.99
 15 permit ip host 3.3.3.3 host 99.99.99.99
 20 permit ip host 3.3.3.3 any
 30 deny ip any any

Remove wrong ACE

ACE that needs removal has rule number 20. Removal is as easy as “no 20” within the access-list.

R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#ip access-list extended 130 
R4(config-ext-nacl)#no 20
R4(config-ext-nacl)#exit
R4(config)#end 
*Feb 19 13:18:32.452: %SYS-5-CONFIG_I: Configured from console by console
R4#sh ip access-lists 130 
Extended IP access list 130
 10 permit ip host 1.1.1.1 host 99.99.99.99
 15 permit ip host 3.3.3.3 host 99.99.99.99
 30 deny ip any any
R4#

The rule numbers are somewhat borked. This needs a little repair.

Resequence rule numbers

Repair command is;

ip access-list resequence

R4#
*Feb 19 13:22:42.838: %SYS-5-CONFIG_I: Configured from console by console
R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#ip access-list resequence 130 10 10
R4(config)#end
R4#sh 
*Feb 19 13:23:12.473: %SYS-5-CONFIG_I: Configured from console by console

R4#sh access-list 130 
Extended IP access list 130
 10 permit ip host 1.1.1.1 host 99.99.99.99
 20 permit ip host 3.3.3.3 host 99.99.99.99
 30 deny ip any any
R4#

Naturally the most important benefit is that the access-list is applied all the time. In regard of the standard ip access-list; a slight modification results in removing the ACL and re-instating the ACL again. You will never know which traffic passes the interface while working on the access-list.

The same applies for named access-list.

NOTE:

Cisco NEXUS devices have a slight different syntax to resequence
NEXUS-R3(config)# resequence ip access-list some_vlan 10 10
Posted in CCNP, Commands | Tagged , , , ,

EIGRP neighbors

Cisco EIGRP protocol allows different methods to form neighborship relations. Default method is form neighborship automatically via multicast (multicast address of 224.0.0.10 is used)

After an adjacency is formed ‘hellos’ are  sent using IP protocol 88 (eigrp). This means that;

  1. an interface need to be IP enabled
  2. both interfaces to a link need to have an ip address within the same subnet.

Alternative method of creating an neighborship relation is setting the neighborship ‘hard-coded’. This is done withing the eigrp routing context. Setting a neighborship ‘over’ an interface implicitly disables the ability to form adjacencies using multicast. Inbound EIGRP multicast packets are discarded and outbound are not send out that particular interface.

This alternative method can be used when you want to prevent a rogue router in your network inject all sorts of garbage subnets.

Off course a better way to set a md5 key on eigrp update exchanges.

Posted in Commands

Cisco Express Forwarding

An topic that entertained my imagination is Cisco’s IP CEF. So I had to take a dive into whichever forwarding methods there are for Cisco routers.

Currently there are three methods of packet forwarding;

  • Processor based forwarding
  • Fast forwarding (reactive)
  • Cisco Express Forwarding (proactive)

Processor based forwarding is as the name describes processor intensive. When for each packet the CPU has to harvest information from various tables (sources)  this would delay packet forwarding significantly. Or you would need to upgrade a router chassis with a more powerful routing engine. Routers have various tasks at hand; forwarding packets, running routing protocols, maintaining an arp table and handling other processes e.g. ntp, snmp, syslog. Just to name a few.

At some point Cisco and other vendors decide to walk another path. Here is the Cisco solution.

Fast Forwarding uses a specially created table fastswitching-cache. When a packet arrives at a router for which the destination is not in the cache. The router invokes the IP Input process (cpu intentive). IP input gathers information about how to forward the packet to its destination. This information is stored in the fastswitching-cache. And the packet is forwarded accordingly. At this point there is no advantage for this single packet. But for the next packet going to the same destination there is a advantage.

The CPU is used only once in determining the destination information. However there is a downside; if the outgoing interface would change, for example by a network failure, then this information is NOT passed through to the fastswitching-cache. The entry in the fastswitching-cache is only cleared after a time-out is reached.

Cisco Express Forwarding is an entire different beast. The table used is called  forwarding information base or FIB for short. When a packet arrives it is handled bij the IP input process. Same process as processor switching and fast switching. But when all relevant information is gathered is it stored into the FIB. At this point no major difference to Fast Forwarding. CEF also , proactively, stores information from network protocols into the FIB as well. This enables shorter forwarding delay times. And while  CEF uses specific information (FIB) in a specific process (CEF) the processing can be done in specialized hardware; Application Specific Integrated Circuit or ASIC for short. For starters this relieves that main CPU from packet forwarding tasks. And secondly this also eliminates any forwarding delay.

In the next post I will dive into how to read the output of show ip cef.

Sources:

https://en.wikipedia.org/wiki/Forwarding_information_base

https://en.wikipedia.org/wiki/Cisco_Express_Forwarding

http://www.cisco.com/c/en/us/td/docs/ios/12_2/switch/configuration/guide/fswtch_c/xcfcef.html

https://learningnetwork.cisco.com/thread/12668

Posted in CCNP, Commands | Tagged ,

Virtual Lab setup

Today I want to talk about the lab setup I have made. But first a slight warning; I will not discuss any use of illegal software nor will I tell you how to get IOS/IOU files.

For quite some years I used Windows as an operating system. In 2009 I made a radical change; I installed Ubuntu as a main operating system. Gradually Ubuntu was installed on the PC’s in my house-hold. As Ubuntu has a less demanding hardware requirement list the usage span of the hardware was also stretched. Spending less money on computer hardware is big and very welcome bonus. Ubuntu can be found on https://www.ubuntu.com/

Virtual LAB software

For network simulation/lab software I use GNS3. GNS3 also helped my decision to run Ubuntu. As GNS3 is much more stable on a linux environment. GNS3 can be found on https://www.gns3.com/ Create a free account and search for the installation manual.

The standard Ubuntu telnet client doesn’t support tabbed views. That is why Konsole was added to the installation. The GNS3 preferences need some adjustment, add the following; konsole –new-tab -p tabtitle=”%d” -e “telnet %h %p”. To the console application command for telnet setting.

Hardware

My laptop with an Intel I5, carries 16Gb of RAM. And my desktop also an Intel I5 is fully loaded with 32Gb of RAM. Lots of RAM make simulations run smooth as silk. The laptop runs with an SSD drive. Remember that each virtual router has its own memory footprint e.g. more virtual router equals to more memory usage. Cisco csr1000v gobbles up a staggering 3Gb memory per virtual router and if I remember correctly Juniper olive still eats a modest 2Gb of memory. IOS and IOU virtual routers have much smaller memory footprint.

Overview

  • Software:
    • Ubuntu
    • GNS3
    • Konsole
    • Network OS image files of your liking. (Cisco IOS/Cisco IOU/Juniper Olive …)
  • Hardware:
    • Intel I5
    • Memory slots completely filled up and maxed out.

Summary

You dont have to be brave to make a setup with GNS3. Although  little persistence is needed and some help from your friend McGoogle.

 

UPDATE: 2017-feb-26 Today I wrote a little article about a short-coming I found in GNS3. GNS3 caveat – port status I am sure some more will follow. GNS3 is a fantastic tool for emulating a netwerk. But it is still an emulation. Nothing beats the real thing; a stack of hardware.

 

 

 

 

Posted in GNS3 | Tagged , , ,

CCNP Books have arrived

The 300-115 (switch)  book was already in my possession.  This week the last two books arrived; 300-101 (route)  and 300-135 (tshoot).
For some time I was cramming labs from whichever tutorial I could lay my hands on. Now the study will be more structured using the official cert guides.

 

Posted in CCNP | Tagged , , ,