netstat常用命令
root@cephclient:/etc/keepalived# netstat -rn
Kernel IProuting table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.100.219.2 0.0.0.0 UG 0 0 0 eth2
10.100.219.0 0.0.0.0 255.255.255.128 U 0 0 0 eth2
10.100.219.128 0.0.0.0 255.255.255.128 U 0 0 0 eth2
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
root@cephclient:/etc/keepalived# netstat -pan
ActiveInternet connections (servers and established)
ProtoRecv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 1444/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 32058/sshd
tcp 0 0 10.100.219.113:22 10.100.219.21:47423 ESTABLISHED 31767/0
tcp 0 248 10.100.219.44:22 10.116.40.238:50729 ESTABLISHED 2169/3
tcp 0 0 10.100.219.21:47423 10.100.219.113:22 ESTABLISHED 31766/ssh
tcp6 0 0 :::22 :::* LISTEN 32058/sshd
udp 0 0 0.0.0.0:20974 0.0.0.0:* 1826/dhclient
udp 0 0 0.0.0.0:28022 0.0.0.0:* 1858/dhclient
udp 0 0 192.168.122.1:53 0.0.0.0:* 1444/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 1444/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 2228/dhclient
udp 0 0 0.0.0.0:68 0.0.0.0:* 1858/dhclient
udp 0 0 0.0.0.0:68 0.0.0.0:* 1826/dhclient
udp 0 0 0.0.0.0:46031 0.0.0.0:* 2228/dhclient
udp6 0 0 :::9021 :::* 2228/dhclient
udp6 0 0 :::10500 :::* 1858/dhclient
udp6 0 0 :::45350 :::* 1826/dhclient
raw 0 0 0.0.0.0:112 0.0.0.0:* 7 12857/keepalived
raw 0 0 0.0.0.0:112 0.0.0.0:* 7 12857/keepalived
raw 0 0 0.0.0.0:112 0.0.0.0:* 7 12857/keepalived
raw 0 0 0.0.0.0:112 0.0.0.0:* 7 12857/keepalived
ActiveUNIX domain sockets (servers and established)
ProtoRefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] SEQPACKET LISTENING 8531 581/systemd-udevd /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 1317 1/init @/com/ubuntu/upstart
unix 12 [ ] DGRAM 16516 1047/rsyslogd /dev/log
unix 2 [ ACC ] STREAM LISTENING 13444 938/dbus-daemon /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 12437 1309/libvirtd /var/run/libvirt/libvirt-sock
unix 2 [ ACC ] STREAM LISTENING 12439 1309/libvirtd /var/run/libvirt/libvirt-sock-ro
unix 2 [ ACC ] STREAM LISTENING 11454 1230/acpid /var/run/acpid.socket
unix 2 [ ] DGRAM 31877 2228/dhclient
unix 2 [ ] DGRAM 29790 1230/acpid
unix 3 [ ] STREAM CONNECTED 9374 1/init
unix 2 [ ] DGRAM 108700 31767/0
unix 2 [ ] DGRAM 15180 1826/dhclient
unix 3 [ ] DGRAM 18537 581/systemd-udevd
unix 3 [ ] STREAM CONNECTED 26711 1140/upstart-file-b
unix 3 [ ] STREAM CONNECTED 9384 1/init @/com/ubuntu/upstart
unix 2 [ ] DGRAM 17476 1025/systemd-logind
unix 2 [ ] DGRAM 15225 1858/dhclient
unix 3 [ ] STREAM CONNECTED 12398 938/dbus-daemon /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 1389 938/dbus-daemon /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 31221 1309/libvirtd
unix 2 [ ] DGRAM 13059308 2169/3
unix 3 [ ] STREAM CONNECTED 26736 938/dbus-daemon /var/run/dbus/system_bus_socket
unix 2 [ ] DGRAM 13019740 12854/keepalived
unix 3 [ ] STREAM CONNECTED 31185 1/init @/com/ubuntu/upstart
unix 3 [ ] DGRAM 18536 581/systemd-udevd
unix 3 [ ] STREAM CONNECTED 1387 938/dbus-daemon
unix 2 [ ] DGRAM 51728 19177/login
unix 3 [ ] STREAM CONNECTED 1388 938/dbus-daemon
unix 3 [ ] STREAM CONNECTED 13416 1/init @/com/ubuntu/upstart
unix 3 [ ] STREAM CONNECTED 17493 1025/systemd-logind
unix 2 [ ] DGRAM 1502 1444/dnsmasq
unix 3 [ ] STREAM CONNECTED 27696 573/upstart-udev-br
unix 3 [ ] STREAM CONNECTED 18612 1154/upstart-socket
root@cephclient:/etc/keepalived# netstat -nat
ActiveInternet connections (servers and established)
ProtoRecv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 10.100.219.113:22 10.100.219.21:47423 ESTABLISHED
tcp 0 232 10.100.219.44:22 10.116.40.238:50729 ESTABLISHED
tcp 0 0 10.100.219.21:47423 10.100.219.113:22 ESTABLISHED
tcp6 0 0 :::22 :::* LISTEN