The latest CLI Magic column is up at Linux.com, and the new feature is the
route command. If you’ve ever needed to troubleshoot a network routing issue, this is the kind of thing you’ll need to know.
Unfortunately the author refers the reader to the man page for the route command rather than offering explanations. He says the new network tools in use are
ss. They are on my system, but strangely enough, I’ve never heard of them before. Looks like I may need to track down some more recent training materials and/or check out some man pages.
I posted the route command I use at work in a post last Monday, but here it is again for quick reference (gateway address concealed for privacy reasons):
route add -net 0.0.0.0 gw xxx.xxx.xxx.33
This essentially creates a default route through a gateway to anywhere but my local LAN. The -net switch says the following address is a network (vs. a host), and the gateway is listed by IP address. If I run the route command without any switches or arguments, this is what it looks like:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xxx.xxx.xxx.32 * 255.255.255.224 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default xxx.xxx.com 0.0.0.0 UG 0 0 0 eth0
The column explains the rest of the fields; note the Gateway here, though, has been converted to a domain name rather than an IP address. This is because I’m on a public network with DNS vs. a private network in the 10.x.x.x or 192.168.x.x range. Unless you’re running your own internal DNS for some reason, you should see an IP address in this field.