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,639
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,639 --> 00:01:00,919
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,919 --> 00:01:06,599
10.0.0.10 must always be a network address that is accessible on the local network.

10
00:01:09,639 --> 00:01:16,040
You can also configure persistent static routes. On Red Hat, you easily do that using NMTUI.

11
00:01:16,040 --> 00:01:22,360
And on Ubuntu NetPlan, static routes are added as a property of the network card in the NetPlan

12
00:01:22,360 --> 00:01:30,760
YAML file. So you would use routes and then you would use two with the IP address of the network

13
00:01:30,760 --> 00:01:36,760
and via with the IP address of the local node that needs to be addressed for reaching this

14
00:01:36,760 --> 00:01:44,440
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,440 --> 00:01:51,639
all the routes. And there is a default via. That's the default route that I need to get out

16
00:01:51,639 --> 00:01:57,239
on the internet. And we also see the local network and the local network on the device

17
00:01:58,120 --> 00:02:05,320
ENS160. That's the direct attached network. That doesn't really count. I can use IP route

18
00:02:05,320 --> 00:02:17,880
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,880 --> 00:02:27,559
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,559 --> 00:02:35,720
added. Obviously, this serves to nothing if the network does not exist. So I can't test,

21
00:02:35,720 --> 00:02:43,399
but I can show you how to do it in NMTY where I'm using editor connection edit. And there we have

22
00:02:43,399 --> 00:02:51,479
routing where I need to select edit and I need to select add. So what am I going to add? Well,

23
00:02:51,639 --> 00:03:03,720
192.168.29. No, not 29. 31.0.24. And the next hop, that's the computer on the local network that

24
00:03:03,720 --> 00:03:11,800
will 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,800 --> 00:03:21,000
to activate just the usual way that we have seen before with NMTY. Hop, activate. And then we use

26
00:03:21,000 --> 00:03:27,800
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,800 --> 00:03:33,960
being added. And how about the old one? Well, remember, anything you do with the IP command

28
00:03:33,960 --> 00:03:40,360
is non-persistent. And that means that when your network interface is restarted, reinitialized,

29
00:03:40,360 --> 00:03:44,360
or whatever, you lose the configuration on it. And that's what just happened.

