IP Addresses and Interfaces

 

(how to add an IP address to an interface)

 

- this section also explains shutdown, Description, Bandwidth, and Clock

 

NOTE1:  Routers themselves do not have addresses (actually they do have a special loopback address).  Only their interfaces have addresses, which are used for routing !!!  Hosts and Switches do have IP addresses, while their interfaces do not!!!

 

NOTE2:  for the trainer example, the entire Network is a Class B  (or it can be called classless, with a /16 prefix).  This can be written as:

172.16  Class B

172.16.0.0  Class B

172.16     /16

172.16.0.0  /16

 

Each link is logically assigned as a Class C  “network” or a classless network with a /24 prefix with the address 176.16.n.0 (the network number “n” is shown in a red circle).   The router interfaces connected to that link use the same “n” for the third octet since they are members of that network, and then use either 1,2,3, etc for the 4th octet.   For example :

 

Look at the link between Router 2501A and 2501B – it is labeled as network 20  -  which means it is network 176.16.20.0 /24 (the red circle on the diagram says “20”)  -  and the two routers interfaces connected to network 20 are 176.16.20. 1  (Router 2501A, int S0) and 176.16.20.2  (Router 2501B, int S0).   Obviously the link itself has no IP address, but it is assigned “20”, and is actually seen as a network by the routing protocols.  The two interfaces can be assigned 20.1 and 20.2 which makes it easy to keep track of it all.

 

NOTE3:  make sure to type “copy run start” after entering IP address info for each router.  Otherwise if the routers go down or are rebooted, all IP info is lost.  This command does not work in config mode – you must be in Priveledged mode !!!

 

Each interface must have an IP adress assigned to it, in order to communicate with the outside world.  To assign an IP address, you must first get into the configuration interface mode by typing “config t”, then “int e0”  (for Ethernet)  or  “int s0”  (for serial lines).  Of course, if you have multiple interfaces, the “0” could be a “1, 2, 3, etc.”  The format of the command is :

 

            ip address address subnet-mask

 

Shutdown and No Shutdown

 

all interfaces are shut down by default.  Therefore, when you assign an IP address to an interface, make sure to activate the interface with the “no shutdown” command. 

 

Interface Descriptions

 

after assigning the IP adress and activating the interface, it is a good idea to assign a description to the interface (only administrators see the descriptions – not users)

 

For example:

 

int e0

ip address 1.1.1.1 255.255.0.0

no shut                                                 (activate the interface address)

description WAN Link to Miami           (optional, usually not used)

bandwidth 56                                       (optional, usually not used)

clock rate 56000                                  (optional, usually not used)

 

Description of  the two communication parameters added at the end – bandwidth (in kilo-bits) and clock rate (in bits):

 

Clock Rate (in bits per sec)  

this is only for DCE serial interfaces, which are the interfaces that supply the clocking to the DTE interface of the other router or device.  This is why the command only works with the serial interfaces of router 2501B in the Sybex lab.  Clock rate is usually for lab purposes only. 

 

Bandwidth (in kilobits per sec)  

can be set to influence the routing protocol, EIGRP and OSPF since they take bandwidth as a cost metric.  RIP does not, so this command would have no effect on RIP.  If you do not issue a bandwidth command, the default for Cisco serial interfaces is the full port speed of the T1 (1.544 Mbps)

 

Pinging to test 

after assigning IP addresses, you can ping any directly connected interface, but the ping will fail for interfaces on the other side of a directly connected router.   You must set up static routes to that network connected to the far side interface, or use dynamic routing such as RIP.

 

 

Example:  suppose the interfaces on the diagram have all been configured, but no routing has been configured.  From R1 you can now ping the interface directly connected (176.16.20.2 on R2), but not the far interface on R2 (172.16.40.1), since that network is not reachable yet.   In this example, each router can ping the directly connected interface.