command line, linux, networking

Linux routing information

$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.100.1.1      0.0.0.0         UG        0 0          0 ens5
10.100.1.0      0.0.0.0         255.255.255.0   U         0 0          0 ens5
172.17.0.0      0.0.0.0         255.255.0.0     U         0 0          0 docker0
172.19.0.0      0.0.0.0         255.255.0.0     U         0 0          0 br-f9452ce42ca5

$ ip route show
default via 10.100.1.1 dev ens5
10.100.1.0/24 dev ens5 proto kernel scope link src 10.100.1.28
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
172.19.0.0/16 dev br-f9452ce42ca5 proto kernel scope link src 172.19.0.1

# cat /etc/networks
default         0.0.0.0
loopback        127.0.0.0
link-local      169.254.0.0

// list all network interfaces ($ ifconfig -a is the equivalent command on FreeBSD)
$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 02:f9:e3:40:4c:8c brd ff:ff:ff:ff:ff:ff
    altname enp0s5
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
    link/ether 02:42:55:cb:02:03 brd ff:ff:ff:ff:ff:ff
105: br-f9452ce42ca5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default
    link/ether 02:42:ec:1e:0e:45 brd ff:ff:ff:ff:ff:ff
107: vethf63b054@if106: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f9452ce42ca5 state UP mode DEFAULT group default
    link/ether fa:e3:7a:a1:60:85 brd ff:ff:ff:ff:ff:ff link-netnsid 3
109: veth9cc2462@if108: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-f9452ce42ca5 state UP mode DEFAULT group default
    link/ether 72:4f:26:95:af:64 brd ff:ff:ff:ff:ff:ff link-netnsid 2

$ cat /etc/network/interfaces
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

# Cloud images dynamically generate config fragments for newly
# attached interfaces. See /etc/udev/rules.d/75-cloud-ifupdown.rules
# and /etc/network/cloud-ifupdown-helper. Dynamically generated
# configuration fragments are stored in /run:
source-directory /run/network/interfaces.d

$ ethtool docker0
Settings for docker0:
        Supported ports: [  ]
        Supported link modes:   Not reported
        Supported pause frame use: No
        Supports auto-negotiation: No
        Supported FEC modes: Not reported
        Advertised link modes:  Not reported
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Auto-negotiation: off
        Port: Other
        PHYAD: 0
        Transceiver: internal
        Link detected: no

ip route flush initialize routing table

ip route del remove entries from routing table