cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4884
Views
5
Helpful
40
Replies

Need help with setting up IP routing and DHCP on packet tracer

V104
Level 1
Level 1

I am a beginner and I'm working with this packet tracer file, trying to practice DHCP and ip routing. These are very confusing topics to me so if anyone could help me figure out how to set this up and explain how it works that would be great. I attached the pkt file that I'm using.

3 Accepted Solutions

Accepted Solutions

Hello,

 

@Flavio Miranda  has provided some good examples. Here is another way to think of it. Start one at a time and put yourself in a router and think about it. You only have 2 routers so I assume everything connecting off of G0/0/1 on R1 is the same network and the switches aren't L3 routing (I couldn't log into your pkt file devices, but the concept will be there)

 

SO you have 2 routers and need to route between them with static routes. Floating static routes are static routes with higher Administrative distances (configurable, since static routes have an AD of 1) than the routing protocol you're running. So when the routing protocol fails you have a backup. Lets say you're running RIP as @Flavio Miranda suggested. It has an AD of 120. If you configure a static route without changing the AD it will use the static route for its decisions since that's preferred (lower AD). However if you configure the static route with a higher AD, like 130, then it will only use the static route if RIP fails or is taken off. They can also be used as backup paths if the primary one fails.

 

So you probably just need static routing since you have 2 routers and no redundant links.

 

Look at it like this:

 

Stand in the middle of R1. From there I know how to get to my networks attached to my G0/0/0 and G0/0/1 interface, so I dont need static routes for those. I also know how to get to R2s G0/0/0 interface since its in the same network I am (if configured correctly they should be in the same network). The only network I dont know how to get to is R2s G0/0/1 network. So thinking about that I dont know how to get to it but R2 does...so why dont I send my traffic destined for that network to R2 and let him handle it Thus creating the command:

 

ip route <network you want to get to> <mask of network> <next hop IP or exit interface>  <-- breaking this down it start with ip route and then the network and mask I want to get to which is R2s g0/0/1 network, then you can specify (still from R1) how we want to get to R2. We know both our exit interface to get to R2 and the next hop, which is R2s G0/0/0 interface since we are directly connected to it. There are reasons to use either but for the purposes of this understand the basics first.

 

So for example if R2s G0/0/0 interface was 192.168.1.2 255.255.255.0 and G0/0/01 interface was 172.16.0.1 255.255.255.0 the command would be:

 

ip route 172.16.0.0 255.255.255.0 192.168.1.2 <- to get to the 172.16.0.0 255.255.255.0 network send to my next hop of R2s interface (which is also on my network)

 

Then you just do the opposite on R2 since once you put the command on R1 he knows how to get to R2s G0/0/1 interface, but R2 does NOT know how to get back without routing information to get to R1s network.

 

Looking at the other side standing at R2. R2 knows its networks of the G0/0/1 and G0/0/0 network. So the only route it needs routing information for is R1s G0/0/1. SO you just make a statement on R2 that says hey to get to R1s g0/0/1 network go out this interface or use this next hop (R1s G0/0/0) interface)

 

That was a lot but hope that helps

 

Also as @Flavio Miranda mentioned for the DHCP to traverse into another network the server is no on you will need the IP helper address on R1 G0/0/1 interface to be able to get that broadcast to the server.

 

-David

View solution in original post

So say you wanted a dhcp pool of a /24 network with the first 10 addresses excluded from being given out, it would look like this

 

ip dhcp pool test
ip dhcp excluded-address 192.168.1.1 192.168.1.10 <-- this is the first 10 noted. This is a range. It will use the first and last address and everything in between and not give it out. You can create multiple excluded address ranges. This is done in GLOBAL config before you create the DHCP pool for each network you need to excluded addresses for. Then you go into DHCP configuration mode.


network 192.168.1.0 /24 (some IOS versions may not take / notation and you will have to write out the mask)
domain-name cisco.com
dns-server 192.168.1.5
default-router 192.168.1.1 <- default gateway clients will use to reach other networks. usually the interface IP of the router the clients use where you put the IP helper address
lease infinite

 

Some of these commands are optional. At a minimum I would configure the commands in bold. Just playing with the settings will help you learns the features. YOU would need one for each network. So if you wanted a DHCP pool for each of your sub interfaces you need 3 DHCP pools to hand them out.

 

Here is some CISCO documentation as well:

 

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr_dhcp/configuration/15-sy/dhcp-15-sy-book/config-dhcp-server.html#GUID-9DFE5A79-4529-4DD9-BB7B-CB46C10E9ABE

 

 

 

-David

 

 

View solution in original post

Ok it looks like your pools 20 and 30 are incorrect. For all 3 of them you have the 10.19.8.0 network with varying subnet masks. Check your interfaces. The pools are basically overlapping each other. 

pool 10 is correct with the network and mask command and excluded addresses

pool 20 and 30 mask is correct but they are in the wrong network and with no addresses excluded.

pool 20 should be:

 

ip dhcp pool Pool-20

network 10.19.8.64 255.255.255.224

default-router 10.19.8.65

 

Dont forget that you need two more excluded address statements 1 for each of the other subnets. So in config mode you need something like:

 

ip dhcp excluded-address 10.19.8.65 10.19.8.70

^excludes first 5 addresses for this network. 

for pool 30 it should be:

p dhcp excluded-address 10.19.8.97 10.19.8.99

ip dhcp pool Pool-30

network 10.19.8.96 255.255.255.248

default-router 10.19.8.97

 

If you notice I reduced the amount of excluded addresses per pool it’s because each pool has a smaller number of usable addresses in the subnet 

 

pool10 - 62 usable hosts

pool20 - 30 usable hosts

pool30 - 6 usable hosts

View solution in original post

40 Replies 40

Hi

 You did a very good job for a begining. But you forgot a few things. Please, find attached the working file and I will list what was wrong.

- The subinterface was created right (most newbies dont do this part). But, you forgot the command:

ip helper-address 172.16.9.9


interface GigabitEthernet0/0/1.10
description VLAN 10
encapsulation dot1Q 10
ip address 10.19.8.1 255.255.255.192
ip helper-address 172.16.9.9
ipv6 address FE80::1 link-local
ipv6 address 2001:DB8:ACAD:A::1/64
!
interface GigabitEthernet0/0/1.20
description VLAN 20
encapsulation dot1Q 20
ip address 10.19.8.65 255.255.255.224
ip helper-address 172.16.9.9
ipv6 address FE80::1 link-local
ipv6 address 2001:DB8:ACAD:B::1/64
!
interface GigabitEthernet0/0/1.30
description VLAN 30
encapsulation dot1Q 30
ip address 10.19.8.97 255.255.255.248
ip helper-address 172.16.9.9
ipv6 address FE80::1 link-local
ipv6 address 2001:DB8:ACAD:C::1/64
!

 

As you can see, for each subinterface, I added this command.  This command is required because the PC sends DHCP request in broadcast mode and this packet stops on router. Router does not send broadcast to another network. This command "ip helper-address "  is responsible for take the broadcast request, turn it in a unicast and send to DHCP server.

 

- Router 1 had no connectivity with DHCP server. If you try to ping from R1 to DHCP server on your file, you´re going to see that it fail. So, how R1 can possibly send packets to DHCP server?

 This happen because the DHCP server ip address belongs to a network behind R2 and R2 does not advertise this network to the rest of the network. So, what I did to fix this I enable RIP protocol in both Routers. R2 also needs to know about network 10.19.8.0 which is behind R1.

By using RIP, I could fix this problem and now R1 can reach DHCP server.

 

So, long story short...when a PC sends a DHCP request this packet gets to the router, the router using the command ip helper address, send this request to DHCP server, DHCP reply back to R2 , R2 to R1 and R1 to PC. Then, PC gets an IP address.

 

Any more question, feel free to send.

 

 

 

How would I set up IP routing for ipv4 and ipv6 on this packet tracer? Been having a lot of trouble with that.

Use this command

Ipv4

router rip

 version 2

network X.x.x.x

 

 

Ipv6 

 ipv6 router rip process1

No i mean like setting up static routes and floating routes and stuff like that with the ip route command.

static route is pretty sime

ip route source mask destination 

"Destination" can be a Layer3 interface or next hop IP address.

 For floating route you can use also administrative distante

Ex

ip route 0.0.0.0 0.0.0.0 192.192.168.x.x  100

ip route 0.0.0.0 0.0.0.0 192.192.168.x.x  200

 

 

But, dynamic routing is also  simple and more efficient. 

 

I've tried doing it but I'm pretty confused as to what goes where. I know what the commands are to do it but I'm just confused as to how it works like which router to use to configure it and what IPs to use etc.

 You need to study the static route syntax, which is

ip route "source" "destination" "interface" or "next hop"

Source = The orgin of the traffic

Destination = To where the traffic gois

Interface or next hop = Through which interface traffic leaves or to whom I send the traffic.

 

You need to take some time, sit down and read a little bit about routing.

@Flavio Miranda I think that's more syntax for an ACL. I don't think static routing is Source/Destination. 

 

Using this syntax.

 

Router(config)#ip route [network/host] [mask] [next hop address/interface] [distance] [permanent]

 

Its more destination and exit interface or next hop.

 

Unless you can configure a static route statement with an ACL. But I am unaware of that.

 

-David

Hello,

 

@Flavio Miranda  has provided some good examples. Here is another way to think of it. Start one at a time and put yourself in a router and think about it. You only have 2 routers so I assume everything connecting off of G0/0/1 on R1 is the same network and the switches aren't L3 routing (I couldn't log into your pkt file devices, but the concept will be there)

 

SO you have 2 routers and need to route between them with static routes. Floating static routes are static routes with higher Administrative distances (configurable, since static routes have an AD of 1) than the routing protocol you're running. So when the routing protocol fails you have a backup. Lets say you're running RIP as @Flavio Miranda suggested. It has an AD of 120. If you configure a static route without changing the AD it will use the static route for its decisions since that's preferred (lower AD). However if you configure the static route with a higher AD, like 130, then it will only use the static route if RIP fails or is taken off. They can also be used as backup paths if the primary one fails.

 

So you probably just need static routing since you have 2 routers and no redundant links.

 

Look at it like this:

 

Stand in the middle of R1. From there I know how to get to my networks attached to my G0/0/0 and G0/0/1 interface, so I dont need static routes for those. I also know how to get to R2s G0/0/0 interface since its in the same network I am (if configured correctly they should be in the same network). The only network I dont know how to get to is R2s G0/0/1 network. So thinking about that I dont know how to get to it but R2 does...so why dont I send my traffic destined for that network to R2 and let him handle it Thus creating the command:

 

ip route <network you want to get to> <mask of network> <next hop IP or exit interface>  <-- breaking this down it start with ip route and then the network and mask I want to get to which is R2s g0/0/1 network, then you can specify (still from R1) how we want to get to R2. We know both our exit interface to get to R2 and the next hop, which is R2s G0/0/0 interface since we are directly connected to it. There are reasons to use either but for the purposes of this understand the basics first.

 

So for example if R2s G0/0/0 interface was 192.168.1.2 255.255.255.0 and G0/0/01 interface was 172.16.0.1 255.255.255.0 the command would be:

 

ip route 172.16.0.0 255.255.255.0 192.168.1.2 <- to get to the 172.16.0.0 255.255.255.0 network send to my next hop of R2s interface (which is also on my network)

 

Then you just do the opposite on R2 since once you put the command on R1 he knows how to get to R2s G0/0/1 interface, but R2 does NOT know how to get back without routing information to get to R1s network.

 

Looking at the other side standing at R2. R2 knows its networks of the G0/0/1 and G0/0/0 network. So the only route it needs routing information for is R1s G0/0/1. SO you just make a statement on R2 that says hey to get to R1s g0/0/1 network go out this interface or use this next hop (R1s G0/0/0) interface)

 

That was a lot but hope that helps

 

Also as @Flavio Miranda mentioned for the DHCP to traverse into another network the server is no on you will need the IP helper address on R1 G0/0/1 interface to be able to get that broadcast to the server.

 

-David

That is the best explanation I've seen of this so far, that helped me understand it a lot. My only problem is though, in this network R1's g0/1 interface has no IP address assigned to it. So how do I manage to make a route to it? I would just give it an IP but it's a practice tracer for my final so I feel like the way it's configured is probably how it's supposed to be, just don't get why there is no IP there though.

Glad the explanation helped. 2 things:

 

1.) I couldn't get into the pkt file device as they were PW protected. You say G0/0/1 has no IP address. I looked at the earlier answers here and sub interfaces were provided. Is that how its set up on the router and the physical interface doesn't have an IP?

 

If that's the case you need a few static routes. Just repeat the process.

 

So on router 2, you would have a static route to each network. So if the above is how its set up and you have 3 sub interfaces on R1s g0/0/1 interface then it would be like this:

 

ip route <sub interface network#1> <network mask> <exit interface or next hop IP>

ip route <sub interface network#2> <network mask> <exit interface or next hop IP>

ip route <sub interface network#3> <network mask> <exit interface or next hop IP>

 

2.) If that's not the case (And I highly don't recommend this) then you can create a default static route on R2 to send everything unknown to R1 and let him handle it.

 

ip route 0.0.0.0 0.0.0.0 <next hop or exit interface>

 

The all 0s say send everything you cant find or don't know about this way...this way being the exit interface or next hop IP you specify, which in this case would be towards R1.

 

-David

 

 

Yes that is how it's configured, there are 3 subinterfaces. The only thing though is that they are all on the same network, the 10.19.8.0 network. So since they are all on the same network I would just do 1 route command instead of 3 right? And would I still put the exit interface as R1s g0/0/0? Also if you want to look at it, the password for console is ciscoconpass and password for en is ciscoenpass

OK. I can look but then yes if they are within the range of the 10.19.8.0 network then 1 route statement on R2 with a mask encompassing all those networks should work. That's because since R1 knows about all those sub interface networks then R2 can just bundle it up and say send anything for the 10.19.8.0 network to R1 and let him handle it.

 

When I added an ip route command as I explained (1 per router pointing to each others networks) I could ping.

 

-David

I did it and pings between the routers aren't working still so I think I did something wrong