Openbsd list open tcp or udp ports
Q. How do I find out openbsd open tcp or udp ports?
A. Use netstat command. It show network status in various network-related data structures. There are a number of output formats, depending on the options for the information presented. Another option is to use nmap from remote computer. However do not use nmap to scan remote host if you are not authorized person.
Task: Display tcp and UDP open port
Type netstat command as follows :
No need to login as root user.
$ netstat -nat
OR
$ netstat -at | grep LISTEN
Output:
$ netstat -at | grep LISTEN tcp 0 0 *.291 *.* LISTEN tcp 0 0 localhost.submissi *.* LISTEN tcp 0 0 localhost.smtp *.* LISTEN tcp 0 0 *.time *.* LISTEN tcp 0 0 *.daytime *.* LISTEN tcp 0 0 *.auth *.* LISTEN tcp6 0 0 *.ssh *.* LISTEN tcp6 0 0 localhost.submissi *.* LISTEN tcp6 0 0 localhost.smtp *.* LISTEN tcp6 0 0 *.time *.* LISTEN tcp6 0 0 *.daytime *.* LISTEN tcp6 0 0 *.auth *.* LISTEN
Only display tcp IPv4:
$ netstat -f inet -atOutput:
Active Internet connections (including servers) Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp 0 0 openbsd.23087 resolver1.opendn.domai TIME_WAIT tcp 0 0 openbsd.22 dsl-KK-dynamic-1.32789 ESTABLISHED tcp 0 448 openbsd.22 dsl-KK-dynamic-1.32786 ESTABLISHED tcp 0 0 *.22 *.* LISTEN tcp 0 0 localhost.submissi *.* LISTEN tcp 0 0 localhost.smtp *.* LISTEN tcp 0 0 *.time *.* LISTEN tcp 0 0 *.daytime *.* LISTEN tcp 0 0 *.auth *.* LISTEN Active Internet connections (including servers) Proto Recv-Q Send-Q Local Address Foreign Address (state) udp 0 0 localhost.biff *.* udp 0 0 *.syslog *.*
Show information about the network interface:
$ netstat -iOutput:
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Colls lo0 33192 6 0 6 0 0 lo0 33192 loopback localhost.nixcraf 6 0 6 0 0 lo0 33192 localhost.n localhost.nixcraf 6 0 6 0 0 lo0 33192 fe80::%lo0/ fe80::1%lo0 6 0 6 0 0 pcn0 1500 00:0c:29:7b:66:72 560 0 485 0 124 pcn0 1500 75.126.68.4 openbsd.nixcraft. 560 0 485 0 124 pcn0 1500 fe80::%pcn0 fe80::20c:29ff:fe 560 0 485 0 124 pflog0* 33192 0 0 0 0 0 pfsync0 1460 0 0 0 0 0 enc0* 1536 0 0 0 0 0
Show information about the specified interface pcn0
$ netstat -I pcn0
See how to use nmap to find out remote system open port. Read man page of netstat for more information.
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- OpenBSD Install Ports Collection
- How do I find out what ports are listening/open on my Linux/FreeBSD server?
- What ports need to be open for Samba to communicate with other windows/linux systems?
- FreeBSD List All Outdated Package
- OpenBSD Change Hostname
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
~ Last updated on: December 19, 2006


Recent Comments
Today ~ 7 Comments
Yesterday ~ 9 Comments
Yesterday ~ 3 Comments
Yesterday ~ 1 Comment
05/10/2008 06:08 pm (2 days ago) ~ 7 Comments