主机是否出网判断命令

协议:ICMP、TCP、UDP、http、DNS

ICMP

ping ip/domain
tracert ip/domain
ping www.baidu.com	# ICMP
tracert baidu.com	# ICMP

TCP/UDP

telnet ip port
nc -zv ip port
nc -zuv ip port
telnet 192.168.1.108 22		# TCP
nc -zv 192.168.1.108 80		# TCP
nc -zuv 192.168.1.108 80	# UDP

HTTP/HTTPS

curl ip or domain
curl http://www.baidu.com	# HTTP
curl https://www.baidu.com	# HTTPS
Linux: wget curl
Windows: certutil powershell bitsadmin regsrv....

DNS

linux:
dig @8.8.8.8 www.baidu.com		#DNS

windows:
nslookup www.baidu.com 8.8.8.8 	        #DNS

参考:http://aiyuanzhen.com/index.php/archives/232/

原文地址:https://www.cnblogs.com/forforever/p/14501613.html