1 00:00:00,000 --> 00:00:02,000 Here’s my local PC, 2 00:00:02,000 --> 00:00:06,000 if I type IP config I can see my PCs IP address 3 00:00:06,000 --> 00:00:09,000 and I can see the default gateway. 4 00:00:09,000 --> 00:00:13,000 My PC will send traffic to the default gateway 5 00:00:13,000 --> 00:00:20,000 for any IP addresses not in the 192.168.56.0 subnet. 6 00:00:20,000 --> 00:00:24,000 So as an example, if I ping google.com 7 00:00:24,000 --> 00:00:30,000 that traffic is going via my default gateway 8 00:00:30,000 --> 00:00:35,000 in the same way, I could telnet to a router 9 00:00:35,000 --> 00:00:39,000 here’s a Cisco router that I’ve got in my lab. 10 00:00:39,000 --> 00:00:42,000 And if I type the command show IP route 11 00:00:42,000 --> 00:00:45,000 I can see the routing table of the router. 12 00:00:45,000 --> 00:00:48,000 The router has directly connected networks. 13 00:00:48,000 --> 00:00:51,000 So C is directly connected networks. 14 00:00:51,000 --> 00:01:02,000 As an example 192.168.56.0/24 is directly connected on this interface F0/0. 15 00:01:02,000 --> 00:01:12,000 So if I ping 192.168.56.1 that traffic is going to be sent out F0/0 16 00:01:12,000 --> 00:01:17,000 because that network is directly connected to this interface. 17 00:01:17,000 --> 00:01:25,000 Packets will traffic to 192.168.58.0 will be forwarded out of interface 0/1 18 00:01:25,000 --> 00:01:32,000 notice this route S and * this is a candidate default route 19 00:01:32,000 --> 00:01:38,000 in other words, this static route is the default route that the routers gonna use. 20 00:01:38,000 --> 00:01:41,000 If I look at the running configuration on this router 21 00:01:41,000 --> 00:01:46,000 and then include only lines that have IP router in them, 22 00:01:46,000 --> 00:01:50,000 I can see this command was added to the router. 23 00:01:50,000 --> 00:02:00,000 So I typed IP router 0.0.0.0 0.0.0.0 and then 192.168.56.1. 24 00:02:00,000 --> 00:02:04,000 This portion is saying that we are adding a default route 25 00:02:04,000 --> 00:02:06,000 to the IP routing table of the router 26 00:02:06,000 --> 00:02:11,000 with the gateway of last resort being 192.168.56.1. 27 00:02:11,000 --> 00:02:18,000 So basically this router will forward traffic to 192.168.56.1 28 00:02:18,000 --> 00:02:21,000 for any networks not in its routing table. 29 00:02:21,000 --> 00:02:23,000 So once again show IP route 30 00:02:23,000 --> 00:02:34,000 shows me I have the 3 networks 192.168.58, 192.68.56, 192.168.97 in the routing table 31 00:02:34,000 --> 00:02:39,000 but I don’t have as an example a route for google.com. 32 00:02:39,000 --> 00:02:47,000 Google’s IP address is 216.58.213.100 that’s not in the routing table 33 00:02:47,000 --> 00:02:54,000 but I was able to ping that address because of this entry in the routing table. 34 00:02:54,000 --> 00:03:02,000 In other words, the local router forwarded traffic to 192.168.56.1 35 00:03:02,000 --> 00:03:06,000 to firstly get to the DNS server 8.8.8.8 36 00:03:06,000 --> 00:03:14,000 and secondly, to ping Google.com we can see that by using the traceroute command. 37 00:03:14,000 --> 00:03:18,000 So let's trace route to Google.com, 38 00:03:18,000 --> 00:03:26,000 notice the first hop is 192.168.56.1 the local gateway of last resort 39 00:03:26,000 --> 00:03:33,000 traffic is then sent out into the internet to get to google.com. 40 00:03:33,000 --> 00:03:36,000 So my traffic is being forwarded from router to router 41 00:03:36,000 --> 00:03:40,000 until it gets to 216.58.213.100. 42 00:03:40,000 --> 00:03:48,000 These stars or * indicates that the router is not replying back 43 00:03:48,000 --> 00:03:51,000 to the ICMP messages sent to it. 44 00:03:51,000 --> 00:03:54,000 So ICMP maybe dropped as an example 45 00:03:54,000 --> 00:03:59,000 but the point to take note of is based on the IP routing table 46 00:03:59,000 --> 00:04:07,000 on this router, the gateway of last resort or the default gateway is 192.168.56.1. 47 00:04:07,000 --> 00:04:10,000 This static route has been added to the routing table 48 00:04:10,000 --> 00:04:15,000 and I could remove that by typing no IP route, 49 00:04:15,000 --> 00:04:23,000 selecting the route so now when I type show IP route 50 00:04:23,000 --> 00:04:29,000 notice the static route that was there previously has now been removed. 51 00:04:29,000 --> 00:04:31,000 So now if I try and ping google.com 52 00:04:31,000 --> 00:04:37,000 the DNS resolution is failing and we won't be able to ping google.com 53 00:04:37,000 --> 00:04:43,000 because we can't resolve the DNS name to IP address of Google.com. 54 00:04:43,000 --> 00:04:47,000 In this case, it's re-using the cache entry 55 00:04:47,000 --> 00:04:51,000 and is sending traffic to 216.58.213.100 56 00:04:51,000 --> 00:04:55,000 but notice the pings fail, we had a 0 success rate. 57 00:04:55,000 --> 00:05:01,000 If I add this static route back again 58 00:05:01,000 --> 00:05:05,000 and type show IP route static route is back 59 00:05:05,000 --> 00:05:09,000 and now when we ping Google.com the ping succeeds. 60 00:05:09,000 --> 00:05:13,000 So static routes are still used quite heavily 61 00:05:13,000 --> 00:05:17,000 especially on routers at remote site or small sites. 62 00:05:17,000 --> 00:05:19,000 Here’s my router at home. 63 00:05:19,000 --> 00:05:23,000 This is the 192.168.56.1 router 64 00:05:23,000 --> 00:05:26,000 that my Cisco router had as its default gateway 65 00:05:26,000 --> 00:05:32,000 and this router will also have a default gateway connecting it to the Internet. 66 00:05:32,000 --> 00:05:36,000 So I'll log in if I look at the broadband connection 67 00:05:36,000 --> 00:05:39,000 notice my local router has this IP address 68 00:05:39,000 --> 00:05:45,000 and the default gateway is set to this IP address, primary DNS, and secondary DNS 69 00:05:45,000 --> 00:05:49,000 are set to these values, so my home broadband router 70 00:05:49,000 --> 00:05:53,000 or DSL router has its own default gateway. 71 00:05:53,000 --> 00:06:01,000 This Cisco router is forwarding traffic to the BTDSL router using this static route 72 00:06:01,000 --> 00:06:06,000 and the BT router is forwarding traffic to this default gateway. 73 00:06:06,000 --> 00:06:11,000 Every router makes its own decision on where to forward traffic to 74 00:06:11,000 --> 00:06:16,000 hence following the hop by hop paradigm.