network troubleshooting quick reference

verbose tcpdump

1
tcpdump -nnvvXSs 1514 -i any

tcpdump specific mac dhcp (if mac = AA:EE:DD:0c:cf:08)

1
tcpdump -nnvvXSs 1514 -i any '((port 67 or port 68) and (udp[38:4] = 0x3e0ccf08))'

nc connect to udp

1
nc -u host port

nc test for connction

1
nc -z $address $port

test tftp

1
2
3
4
5
6
tftp $ip
tftp> get /pxelinux.0
Transfer timed out.

tftp> get /pxelinux.0
tftp>

rhel/fedora/centos firewall command

1
2
3
4
5
6
7
firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="10.0.0.3/32" port protocol="tcp" port="5432" accept"
success
[root@replica ~]# iptables -L -n | grep 10.0.0.3
[root@replica ~]# firewall-cmd --reload
success
[root@replica ~]# iptables -L -n | grep 10.0.0.3
ACCEPT tcp -- 10.8.10.24 0.0.0.0/0 tcp dpt:5432 ctstate NEW