Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

Use the following command to remove a static route:


Click here to view code image
matthew@seymour:~$ sudo ip route del 10.10.30.0/24


To add a default gateway, use the following:


Click here to view code image
matthew@seymour:~$ sudo ip route add default via 192.168.36.100


The next section explains how to configure your system to work with your
LAN.


ip route

Another command used to configure your network is the ip route
command. ip route is used to build the routing tables (in memory)
implemented for routing packets and to display the routing information. It is
used after ip (or ifconfig) has initialized the interface. ip route is
normally used to set up static routes to other networks via the gateway or to
other hosts.


To display the current routing configuration, use the ip route command
with no options. The display will look similar to this:


Click here to view code image
matthew@seymour:~$ ip route
default via 192.168.1.1 dev enp1s0 proto static metric 100
169.254.0.0/16 dev enp1s0 scope link metric 1000

192.168.1.0/24 dev enp1s0 proto kernel scope link src 192.168.1.148
metric 100


netstat

The netstat command is used to display the status of your network. It has
several parameters that can display as much or as little information as you
prefer. The services are listed by sockets (application-to-application
connections between two computers). You can use netstat to display the
information listed in Table 18.2.


Table 18.2 netstat Options


OptionOutput

-g Displays the multicast   groups  configured
Free download pdf