0

I am trying to nping the port from my ubuntu machine which is open on centos 7 but it does not ping. Both my Machines are on same network. I also disable the firewall of centos 7 but it does not work. i also allow ports in firewall of centos 7.

output of Centos 7 Machine [root@localhost ~]# firewall-cmd --list-ports 4000/tcp 80/tcp 4000/udp 80/udp

output from ubuntu machine: sansforensics@siftworkstation:~$ nping -p 4000 192.168.100.12

Starting Nping 0.6.40 ( http://nmap.org/nping ) at 2017-07-12 08:19 UTC SENT (0.0018s) Starting TCP Handshake > 192.168.100.12:4000 RECV (0.0020s) Possible TCP RST received from 192.168.100.12:4000 --> Connection refused SENT (1.0034s) Starting TCP Handshake > 192.168.100.12:4000 RECV (1.0037s) Possible TCP RST received from 192.168.100.12:4000 --> Connection refused SENT (2.0056s) Starting TCP Handshake > 192.168.100.12:4000 RECV (2.0059s) Possible TCP RST received from 192.168.100.12:4000 --> Connection refused SENT (3.0073s) Starting TCP Handshake > 192.168.100.12:4000 RECV (3.0077s) Possible TCP RST received from 192.168.100.12:4000 --> Connection refused

output of netstat -tulpn

Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
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

output of 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: masquerade: no forward-ports: sourceports: icmp-blocks: rich rules:

  • Please provide output of netstat -tulpn and firewall-cmd --list-all for the CentOS machine. – Andreas Rogge Jul 12 '17 at 8:25
  • @Andreas Rogge output of firewall-cmd --list-all is 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: masquerade: no forward-ports: sourceports: icmp-blocks: rich rules: – zahid Jul 12 '17 at 8:57
0

You're not running any service on 4000/tcp, thus the tcp stack returns "Connection refused" which is expected and desired behaviour in that situation.

You can start some kind of listening daemon on 4000/tcp. I usually use Ncat for things like that: nc -k -l 4000

  • Thanks for your reply. In centos 7 netcat by default uses the tcp6 connection. So nc -kl4 4000. So,ubuntu manchine can connect to the centos machine. – zahid Jul 12 '17 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.