Basic Cisco Intro: Ethernet



This is a very basic introduction to configuring ethernet ports on cisco devices, it is not intended to be totally comprehensive and is only a quick and dirty guide.

IOS Modes

Cisco routers run an operating system called IOS, generally all the commands etc I will use in this (and all other) guide(s) will be based on cisco IOS 12+.
When you connect to the router, which could be done through telnet (or ssh), on a terminal or out of band communications you will see a prompt.
Then… router>
In this mode, which is called user/unprivileged you can do some basic things like ping and traceroute, however none of the routers actual configuration can be changed at this point. to get into a mode where you can configure the router you must type the enable command where you will be prompted for another password, once you enter it correctly you will be in system/configuration mode.

Basic Ethernet

Let’s say you have two routers. routera and routerb. You have connected them with cat5 and both have 10meg ports which are connected correctly…
routera#configure terminal
routera#interface ethernet0
{first ethernet port, fast ethernet is called faster ethernet and 10meg ethernet ports are just called ethernet, to see what ports you have type show interface from *WHAT* mode}
routera (config-if)#ip address
routera (config-if)#no shutdown
Basically this gives the interface an address of with a subnet mask of and no shutdown brings in the interface up. Then hit CTRL Z to get back into the start of *MODE*
You would then do the same in routerb except chaning the ip to To test connectivity type ping from routera or ping from routerb.

Basic Routing (Using RIP)

The above example shows how to setup ethernet devices. How about if there was a second ethernet interface on each on those machines,
Box1 ( <—-> |( routea (| <—-> |( routerb (| <—–> Box2 (
Each router has two ips because it has two interfaces. Now routera could contact routerb, Box1 could contact routera and box2 could contact routerb, but Box1 could NOT contact Box2, because no routing is setup.

It should be pointed out that RIP is VERY basic, it is ineffiecent compared with other protocols however it is very easily setup and would suffice in a LAN environment, it would not be recommended to use it over WAN links (due to the frequent timed updates). In short to configure this you would type
routera#configure terminal
routera# route rip routera# network
routera# network
routera# network
Then hit ctrl Z and let the routers share routes. To see your dynamically learned routes type show ip route and a list will come up.

It should however be noted that in a very small environment static routes would be the preferred method of routing, however once more routers are added this becomes very inpractial and dynamic routing protocols like RIP, IGRP etc should be used. However you could add static routes for the preferred links and then run RIP to take over in the event of a link going down. If you intend using RIP for anything more than a handful of routers you should either 1) Look at different protocols or 2) Learn more about how rip works (which is beyond the scope of this tutorial).


In order to use your addresses, you need to understand subnetting. Subnetting allows you to create multiple logical networks that exist within a single Class A, B, or C network. If you don’t subnet, you will only be able to use one network from your Class A, B, or C network. Unless you have been assigned many major networks, you really need to subnet. Each data link on a network must be a unique subnet, with every node on that link being a member of the same subnet. For serial interfaces (standard HDLC), you will need one subnet for the circuit, or “wire” (both ends of the serial connection will be in the same subnet). If you are planning on implementing Frame Relay, SMDS, X.25 etc, read the Router Products Configuration and Reference Guides for assistance in configuring.

Let’s use these two addresses for some examples: and If the subnet mask is, the first 24 bits are masked, so the router compares the first 3 octets of the two addresses. Since the masked bits are not the same, the router knows that these addresses belong to different subnets.
If the subnet mask is, the first 16 bits are masked, so the router compares the first 2 octets of the two addresses. Since the masked bits are the same, the router knows that these addresses belong to the same subnet.
Nodes and routers use the mask to identify the data link on which an address resides. For instance, imagine that San Francisco proper is a class B network, and think of the streets as subnets. Each street must have a unique name. How would the postal service deliver a letter or find the correct destination if there were two Lombard Streets? Each house number can be thought of as a unique identifier for that street. The house numbers themselves can be duplicated on other streets: 33 Market Street is not the same as 33 Van Ness Avenue.
San Francisco.Lombard.33
171.68. 3. 3
San Francisco.Market.33
171.68. 2. 3
Sometimes you need to perform a logical “AND” operation to find out what subnet your node is in. Performing an “AND” operation means that anytime you “AND” a 0 value to another 0 or a 1 value, the result is 0. Only a 1 ANDed with another 1 value will result in a 1 value. Here’s how it works:
0 AND 0 IS 0
0 AND 1 IS 0
1 AND 1 IS 1
Let’s compare our sample addresses ( and against the subnet mask We need to compare the binary representation of the third octet of the mask with the binary representation of the third octets of the addresses. In order to do this, we’ll perform a logical “AND” operation on the corresponding bits in each octet.
The masked bits are those that are “turned on,” or 1 in the mask. Since the masked bits in both addresses are the same, the router knows that these addresses belong to the same subnet.


Example 1: Class B
Let’s use a class B address to illustrate how subnetting works. Let’s say you were assigned the class B address 172.16 from the NIC. First determine how many subnets you need, and how many nodes per subnet you need to define. A typical (and easy to use) class B subnet mask would be 8 bits. Since the 3rd octet is the first “free” octet for Class B, you will start there. So, an 8 bit subnet mask would be This means you have 254* subnets available and 254 addresses for nodes per subnet.
*Why are there only 254 subnets available instead of 256 (0-255)? You should not use subnet 0 or a subnet of all 1s. With an all 1s subnet mask, this is also your broadcast address. You can configure this, but it is neither proper nor recommended to make your subnet the same as your broadcast address. Subnet 0 is also not recommended. Cisco will allow the use of subnet 0 with the IP subnet zero command.

Example 2: Class B
Now let’s take this example: you have just assigned an interface the address with a mask of What subnet is it in? First represent the bits in binary (for class B, you start with the 3rd octet since octets 1 and 2 are fixed).
00001010 00110010 (address representation – 10.50)
11111111 00000000 (subnet mask representation – 255.0)
00001010 00000000 (results of logical “AND” – subnet 10) 10

This address is in subnet 10 ( Valid addresses for subnet 10 would be through Address is the broadcast address for this subnet. According to the standard, any host id consisting of all 1s is reserved for broadcast.

Keeping the same subnet mask, you can choose different addresses to be in different subnets. For instance, address is in subnet 16 and therefore has another unique subnet address, with valid addresses in the range of through Chart:

Subnetting Chart
Class B Effective Effective
# bits Mask Subnets Hosts
——- ————— ——— ———
2 2 16382
3 6 8190
4 14 4094
5 30 2046
6 62 1022
7 126 510
8 254 254
9 510 126
10 1022 62
11 2046 30
12 4094 14
13 8190 6
14 16382 2

Class C Effective Effective
# bits Mask Subnets Hosts
——- ————— ——— ———
2 2 62
3 6 30
4 14 14
5 30 6
6 62 2
*Subnet all zeroes and all ones excluded.
*Host all zeroes and all ones excluded.