我试图从我的ubuntu机器nope端口打开在centos 7上,但它不能ping通。 我的机器都在同一networking上。 我也禁用了centos 7的防火墙,但它不起作用。 我也允许端口在防火墙的centos 7。
输出CentOS 7机器 [root @ localhost〜]#firewall-cmd –list-ports 4000 / tcp 80 / tcp 4000 / udp 80 / udp
从ubuntu机器输出: sansforensics @ siftworkstation:〜$ nping -p 4000 192.168.100.12
开始Nping 0.6.40( http://nmap.org/nping )在2017-07-12 08:19 UTC SENT(0.0018s)启动TCP握手> 192.168.100.12:4000 RECV(0.0020s)可能的TCP RST从192.168.100.12:4000 – >拒绝连接SENT(1.0034s)启动TCP握手> 192.168.100.12:4000 RECV(1.0037s)从192.168.100.12:4000收到的可能的TCP RST – >拒绝连接SENT(2.0056s)启动TCP握手> 192.168.100.12:4000 RECV(2.0059s)从192.168.100.12:4000收到可能的TCP RST – >拒绝连接SENT(3.0073s)启动TCP握手> 192.168.100.12:4000 RECV(3.0077s)可能的TCP RST从192.168.100.12:4000收到 – >拒绝连接
netstat -tulpn的输出
主动Internet连接(仅限服务器)原始Recv-Q发送-Q本地地址外部地址状态PID /程序名称
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1 / systemd
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 12578 / dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 11332 / sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 11159 / cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 12375 / master
tcp6 0 0 ::: 111 ::: * LISTEN 1 / systemd
tcp6 0 0 ::: 22 ::: * LISTEN 11332 / sshd
tcp6 0 0 :: 1:631 ::: * LISTEN 11159 / cupsd
tcp6 0 0 :: 1:25 ::: * LISTEN 12375 / master
udp 0 0 0.0.0.0:5353 0.0.0.0:* 548 / avahi-daemon:r udp 0 0 0.0.0.0:55736 0.0.0.0:* 548 / avahi-daemon:r udp 0 0 0.0.0.0:6660 0.0。 0.0:* 22513 / dhclient
udp 0 0 192.168.122.1:53 0.0.0.0:* 12578 / dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 12578 / dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 22513 / dhclient
udp6 0 0 ::: 20241 ::: * 22513 / dhclient
输出firewall-cmd –list-all public(active)target:default icmp-block-inversion:no interfaces:ens33 sources:services:dhcpv6-client ssh ports:4000 / tcp 80 / tcp 4000 / udp 80 / udp protocols :伪装:没有转发端口:源端口:icmp-blocks:丰富的规则:
你没有在4000 / tcp上运行任何服务,因此tcp栈返回“连接被拒绝”,这是预期的和期望的行为。
你可以在4000 / tcp上启动某种监听守护进程。 我通常使用Ncat来做这样的事情: nc -k -l 4000