1 00:00:00,000 --> 00:00:12,120 Okay, so let's summarize what we have just discussed. All network nodes are configured 2 00:00:12,120 --> 00:00:16,280 with the default gateway. Without default gateway, your node doesn't know how to get 3 00:00:16,280 --> 00:00:22,840 out. The default gateway specifies which node to use to address external nodes. And you 4 00:00:22,840 --> 00:00:28,920 can use IP route show to show the default gateway. Static routes can be needed in some 5 00:00:28,920 --> 00:00:35,320 cases to define a route to a network that is not behind the default gateway. This is 6 00:00:35,320 --> 00:00:41,080 something that you will find in complex networks where multiple networks are connected by multiple 7 00:00:41,080 --> 00:00:51,680 routers. You could do that in a runtime using a command like IP route at 192.2.0.0.74 via 8 00:00:51,680 --> 00:01:00,959 10.0.0.10. So that will add the custom route to the 192.2.0.0.0 network via 10.0.0.10 where 9 00:01:00,959 --> 00:01:06,559 10.0.0.10 must always be a network address that is accessible on the local network. 10 00:01:09,599 --> 00:01:16,000 You can also configure persistent static routes. On Red Hat, you easily do that using NMTUI. 11 00:01:16,080 --> 00:01:22,320 And on Ubuntu NetPlan, static routes are added as a property of the network card in the NetPlan 12 00:01:22,320 --> 00:01:30,800 YAML file. So you would use routes and then you would use two with the IP address of the network 13 00:01:30,800 --> 00:01:36,800 and via with the IP address of the local node that needs to be addressed for reaching this 14 00:01:36,800 --> 00:01:44,480 specific network. Let me show you. So IP route show is what I want to do first. Here we can see 15 00:01:44,480 --> 00:01:51,680 all the routes and there is a default via. That's the default route that I need to get out 16 00:01:51,680 --> 00:01:57,279 on the internet. And we also see the local network and the local network on the device 17 00:01:58,160 --> 00:02:05,360 ENS11060. That's the direct attached network. That doesn't really count. I can use IP route 18 00:02:05,360 --> 00:02:17,919 add 192.168.30.0.24 to add an imaginary network. And let's do that without the typo. And then I 19 00:02:17,919 --> 00:02:27,600 need via 192.168.29.3 for instance. And IP route show is going to show that the route has now been 20 00:02:27,600 --> 00:02:36,320 added. Obviously, this serves to nothing if the network does not exist. So I can't test, but I can 21 00:02:36,320 --> 00:02:44,000 show you how to do it in NMTY where I'm using editor connection edit. And there we have routing 22 00:02:45,919 --> 00:02:54,240 where I need to select edit and I need to select add. So what am I going to add? Well, 192.168.29 23 00:02:54,960 --> 00:03:04,080 no, not 29, 31.0.24. And the next hop, that's the computer on the local network that will 24 00:03:04,080 --> 00:03:11,839 take me there. That could be four. And that is good enough. So I'm clicking OK, and I'm going 25 00:03:11,839 --> 00:03:20,960 to activate just the usual way that we have seen before with NMTY hop activate. And then we use 26 00:03:20,960 --> 00:03:27,759 back. We get out of here, and I'm using IP route show. And what do we see? We see the new route 27 00:03:27,759 --> 00:03:34,000 being added. And how about the old one? Well, remember, anything you do with the IP command 28 00:03:34,000 --> 00:03:40,320 is non-persistent. And that means that when your network interface is restarted, reinitialized, 29 00:03:40,320 --> 00:03:44,320 or whatever, you lose the configuration on it. And that's what just happened.