版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/fhm6100411074/article/details/89307969
netstat -nlptu | grep 8080
一、 0.0.0.0:8080 代表8080端口,对内网和外网都是开放的
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 123941/java
二、查看网卡的代码:
public static void main(String[] args) throws SocketException {
Enumeration<NetworkInterface> obj = NetworkInterface.getNetworkInterfaces();
while (obj.hasMoreElements()) {
NetworkInterface networkInterface = (NetworkInterface) obj.nextElement();
System.out.println(networkInterface.getName() + "/" + networkInterface.getDisplayName());
}
}