1 00:00:06,879 --> 00:00:13,387 So the first thing that you need to know is how to apply non persistent network 2 00:00:13,387 --> 00:00:19,894 configuration on servers. IP address configuration is normally set statically using tools like NMCLI or NMTUI 3 00:00:19,894 --> 00:00:26,402 on Red Hat on workstations, IP address configuration is typically handed out by a DHCP server 4 00:00:26,402 --> 00:00:32,909 for troubleshooting purposes. The IP command is used to set runtime network configuration. 5 00:00:33,530 --> 00:00:37,480 The important task is that you know how to get your IP configuration and 6 00:00:37,480 --> 00:00:41,430 sometimes for analyzing. It's useful if you can do it manually as well. 7 00:00:42,329 --> 00:00:45,250 So how does that work? Well, you need to use the right tools. 8 00:00:46,469 --> 00:00:51,380 Runtime networking is not persistent, but it is useful for analyzing what is going on. 9 00:00:52,119 --> 00:00:57,114 In the past, ifconfig was used. Nowadays ifconfig is obsolete, you should not 10 00:00:57,114 --> 00:01:02,109 use it because it uses outdated methods for addressing and displaying networking. 11 00:01:02,770 --> 00:01:05,849 And for that reason it doesn't display accurate information. 12 00:01:07,049 --> 00:01:12,034 The nettools package which contains ifconfig is not even installed on many modern 13 00:01:12,034 --> 00:01:17,019 distributions anymore. But sometimes you will still find it because of dependency requirements. 14 00:01:17,560 --> 00:01:23,049 The main utility to check and manage networking is the IP utility. 15 00:01:24,189 --> 00:01:27,944 Now let me run a demo in which we can see some 16 00:01:27,944 --> 00:01:31,699 of the most common tasks with this utility for your convenience. 17 00:01:32,420 --> 00:01:34,019 The demo is also on the slide. 18 00:01:35,480 --> 00:01:42,275 So I am going to start using sudo ipa, which is short for IP address show and that 19 00:01:42,275 --> 00:01:49,069 is showing that my network interface is called ens160 and I have an INET address on 192.168.29.14.1. 20 00:01:49,489 --> 00:01:54,245 So I am going to use sudo ip addr add 21 00:01:54,245 --> 00:01:59,000 to add an IP address to my network device. 22 00:02:00,079 --> 00:02:06,549 Dev is specifying which network device and that will be ENS160 and setting it to 10.0.0.1024. 23 00:02:13,939 --> 00:02:16,099 Next I'm going to do what? 24 00:02:17,000 --> 00:02:21,840 Well, I'm going to show you sudo IP a that 25 00:02:21,840 --> 00:02:26,680 is showing that we now have this secondary IP address. 26 00:02:27,500 --> 00:02:32,986 I can use sudo IP link set ens160 down. That 27 00:02:32,986 --> 00:02:38,473 will bring my network interface down. IPA is showing that 28 00:02:38,473 --> 00:02:43,960 the status of the interface is now set to down. 29 00:02:45,080 --> 00:02:50,419 That is temporarily disabling it. If you don't like that too much, don't forget to switch it up again. 30 00:02:51,680 --> 00:02:54,500 How about sudo IP route show? 31 00:02:54,800 --> 00:02:58,805 Well, that is showing the routing table and in this routing 32 00:02:58,805 --> 00:03:02,810 table I can see my default route being set to 192.168.29.2. 33 00:03:04,830 --> 00:03:09,694 I'm not going to use IP route at default via 34 00:03:09,694 --> 00:03:14,560 10.0.0.1 because I don't like to change my default router. 35 00:03:15,439 --> 00:03:18,240 If I change it, I can't get out to the Internet anymore.