🌐 This is an automatic translation of a topic from Underc0de, the largest Spanish-speaking hacking and IT community. Read the original (Spanish) and reply →
HATI ·
What is Cisco Packet Tracer?<br /><br />"It is a network simulation program that allows students to experiment with network behavior. As an integral part of the Cisco Networking Academy, Packet Tracer provides simulation, visualization, assessment and collaboration capabilities and facilitates the teaching and learning of basic networking concepts."<br /><br />Wikipedia:<br /><br />On Cisco's Networking Academy page (www.netacad.com) you will find documentation, courses, certifications...<br /><br />What is routing?<br /><br />It is the function of finding the best path among all the possible ones in a packet network, that is, finding the most optimal routes to direct those packets.<br />Consequently, it should be noted what we mean by "best route"; that is, the one that passes through the fewest nodes, maintains good frequency and offers the lowest cost.<br /><br /><br />DEVICE CONFIGURATION<br /><br />To demonstrate how to perform basic routing with its corresponding configuration, we will set up the following scenario:<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />As we can see, each computer is connected to a 24-port FastEthernet switch, and this in turn is connected to a Cisco 2621XM router. <br /><br />Each router has two FastEthernet interfaces, and the router in the center of the image also has an additional FastEthernet 1/0 network interface. <br /> <br />If you have never used Cisco Packet Tracer you will notice that it is very intuitive and easy to use; so far, all we have had to do is drag the elements onto the screen.<br /><br /><br />Now we will configure the IP addresses of each computer. To do so, click the computer icon, go to the "Desktop" tab and open "IP Configuration", where the IP configuration menu will appear. Perform this step for all computers.<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br /><br />The next step is configuring the routers and their corresponding IP addresses. To do so, click the icon of the first router (left) and go to the CLI tab, which is an emulation of the Cisco router Command Line Interface, and run the following commands:<br /><br /> First interface:<br /><br /> enable /Enter privileged mode<br /> (#) configure terminal /Enter global configuration mode<br /> (config) interface fastethernet 0/0 /Select interface to configure<br /> (config-if) ip address 192.168.1.1 255.255.255.0 /Add IP and mask<br /> (config-if) no shutdown /Do not shut down<br /> (config-if) exit /Exit<br /><br /> Second interface: <br /> (#) configure terminal <br /> (config) interface fastethernet 0/1 <br /> (config-if) ip address 10.10.1.1 255.255.255.252 <br /> (config-if) no shutdown <br /> (config-if) exit <br /> <br /><br />Now we will configure the central router, which has three interfaces. We will follow the same configuration procedure:<br /><br /> First interface:<br /> enable <br /> (#) configure terminal <br /> (config) interface fastethernet 0/0 <br /> (config-if) ip address 192.168.2.1 255.255.255.0 <br /> (config-if) no shutdown <br /> (config-if) exit <br /><br /> Second interface: <br /> (#) configure terminal <br /> (config) interface fastethernet 0/1 <br /> (config-if) ip address 10.10.1.2 255.255.255.252 <br /> (config-if) no shutdown <br /> (config-if) exit <br /><br /> Third interface: <br /> (#) configure terminal <br /> (config) interface fastethernet 1/0 <br /> (config-if) ip address 10.10.2.2 255.255.255.252 <br /> (config-if) no shutdown <br /> (config-if) exit <br /><br /><br />Only the router on the right remains to be configured, in the same way as the previous ones:<br /><br /> First interface:<br /> enable <br /> (#) configure terminal <br /> (config) interface fastethernet 0/0 <br /> (config-if) ip address 192.168.3.1 255.255.255.0 <br /> (config-if) no shutdown <br /> (config-if) exit<br /><br /> Second interface: <br /> (#) configure terminal <br /> (config) interface fastethernet 0/1 <br /> (config-if) ip address 10.10.2.1 255.255.255.252 <br /> (config-if) no shutdown <br /> (config-if) exit<br /><br /><br />All routers and computers are now configured. Next we proceed to route all the networks in our scenario, which currently looks like this:<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />ROUTING<br /><br />The first router we will configure is the one on the left. Click on it and go to the CLI tab to run the following commands:<br /><br /> enable <br /> (#) configure terminal <br /> (config) ip route 192.168.0.0 255.255.0.0 10.10.1.2 <br /><br />With the ip route command we direct the "hops".<br /><br />The next router we will configure is the one on the right, in the same way as before:<br /><br /> enable <br /> (#) configure terminal <br /> (config)ip route 192.168.0.0 255.255.0.0 10.10.2.1 <br /><br />The only remaining router to configure is the central one; in this case we need to enter the static routes 192.168.1.0/24 and 192.168.3.0/24. We will do it as follows:<br /><br /> enable <br /> (#) configure terminal <br /> (config) ip route 192.168.1.0 255.255.255.0 10.10.1.1<br /> (config) ip route 192.168.3.0 255.255.255.0 10.10.2.2<br /><br />With this, routing is complete. <br />To verify it, ping from one PC to another that is not on the same network. To ping, click a PC, go to Desktop, and open Command Prompt.<br /><br />From 192.168.1.2 > ping 192.168.2.1<br />From 192.168.1.2 > ping 192.168.3.1<br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br />After setting up routing, you should save the configuration so that it is not lost when the router reboots. This is done from the CLI on each router:<br /><br /> enable <br /> (#) copy running-config startup-config<br /><br />The network is now ready to work, with its respective configuration and routing. There are other useful commands to know:<br /><br />To view the configuration of each router:<br /> enable <br /> (#) show running-config<br /><br />To change the router's configuration password:<br /> enable <br /> (#) configure terminal <br /> (config) enable password 12345 <br /><br />To change the name of a Cisco device:<br /> enable <br /> (#) configure terminal <br /> (config) hostname nombre<br /><br /><br />
Devilboy ·
That is called Static Routing (Enrutamiento estatico)<br /><br />And what you do: ip route 0.0.0.0 0.0.0.0 x.x.x.x is called configuring a gateway of last resort, so it is NOT recommended at all to configure your routers that way.<br /><br />The only place where this type of routing is allowed is the router that is directly connected to the ISP and nothing else.<br /><br />You will never see routers connected to each other using that type of routing.<br /><br />Another thing:<br />"To change the password of a device:<br /> enable <br /> (#) configure terminal <br /> (config) enable password 12345 <br />"<br /><br />That information is very vague; to change the password of what????<br /><br />Console password, vty password, global configuration password???? Which kind??<br /><br />A bit more info is needed
Cl0udswX ·
Greetings @hati,<br /><br />First of all, thanks for taking the time to prepare the post for the community, thanks for your interest in sharing.<br /><br />Still, in simulators, as in real life, this network could work but it is not an optimal way to configure it; here are a few suggestions to enrich the post:<br /><br />1.- There are two ways to do routing, "dynamic routing" and "static routing". For small networks it is convenient to use static routing, since it is not necessary to consume hardware resources when we only need to know a few networks, so the routing method could be said to be correct. <br /><br />2.- As @Devilboy says, it is not correct to configure a quadzero route if we do not have an exit to the Internet through some ISP. Why? If any host connected to SW0 tries to reach a network that does not exist, the packets will be routed to the next hop, consuming resources unnecessarily since they will be discarded at some node. So the best option is to configure a summarized next-hop route on Router 0:<br /><br />Código: text
ip route 192.168.0.0 255.255.0.0 10.10.1.2
<br /><br />This way it will only route to networks we know in advance exist.<br /><br />On Router 1 I would create a route for each network segment it needs to reach:<br /><br />Código: text
<br /><br />And another summarized route for Router 2:<br /><br />Código: text
ip route 192.168.0.0 255.255.0.0 10.10.2.1
<br /><br />With this you make sure there is no routing for unavailable networks, so you get optimal use of network resources.<br /><br />3.- Finally, it should be clarified that when addressing point-to-point links the subnet mask must be:<br /><br />255.255.255.252<br /><br />or equivalently "/30"<br /><br />So when assigning addresses you would have:<br /><br />Router0<br />Código: text
ip address 10.10.1.1 255.255.255.252
<br /><br />Router1<br />Código: text
ip address 10.10.1.2 255.255.255.252<br />ip address 10.10.2.1 255.255.255.252
<br /><br />Router2<br />Código: text
ip address 10.10.2.2 255.255.255.252
<br /><br />The reason? To avoid wasting IPv4 addresses, since if you take a /24 block for a point-to-point link you would be wasting 252 addresses on each segment.<br /><br />Otherwise, congratulations, very good contribution, greetings and keep it up brother, cheers!!<br /><br />Greetings.
HATI ·
Thanks @Devilboy and @CloudswX for the information, I have modified the post trying to improve it with your advice. The quadzero routes make sense, and the mask was a clear waste.