课程: Linux System Engineer: Networking and SSH

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Change the default gateway

Change the default gateway

- [Narrator] We'll change the default gateway using both the legacy route command and the newer IP command. To set the default gateway using the route command, first make sure the net-tools package is installed. We will also want to make sure the default gateway we specify is accessible in our network. Let's check our network first. Type in I-P, space, A-D-D-R, space, show and hit enter. We can see that my IP address is 192.168.0.19 with the /24 subnet mask. That means my network is 192.168.0. With this in mind, I will set my default gateway to 192.168.0.100. Type in clear, and then type in sudo route add default, gw, 192.168.0.100, and hit enter, and type in your password if you're prompted. If this default gateway isn't valid, you won't be able to access your VM remotely anymore, which is fine as we're using the virtual box console. Just be aware that if you're accessing a host remotely through the network, you'll need to use a valid default gateway, or you will not be able to…

内容