centos7 view port command
View Centos port command. # netstat -lntp # View the listening (Listen) port # netstat -antp # View all established TCP connections Other commands for viewing server network information. 1. Check the Linux system hostname: Linux Learning, http:// linux.it.net.cn # hostname localhost.localdomain 2. Check the server IP address. # ifconfig|grep 'inet addr:'|grep -v '127.0.0.1'|cut -d: -f2|awk '{ print $1}' 192.168.17.238 192.168.1.9 3. View linux gateway. # route |grep default default 192.168.1.1 0.0.0.0 UG 0 0 0 em1 4. view linux open services. # chkconfig --list|grep enable # View services that are enabled sshd 0:off 1:off 2:enable 3:enable 4:enable 5:enable 6:off httpd 0:off 1:off 2:off 3:enable 4:off 5:off 6:off 5. Check the server DNS configuration. # cat /etc/resolv.conf nameserver 192.168.0.66 nameserver 202.106.0.20 6. Other network information. # iptables -L # View firewall rules # route -n # View the routing table # netstat -s # View network statistics