Unix/Linux Go Back    


BSD BSD, sometimes called Berkeley Unix, is a Unix operating system developed by the Computer Systems Research Group of the UC Berkeley.

Ping remote sever, nc, telnet, whatever

BSD


Tags
bsd, in terminal, ping remote server and port

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 01-08-2016
1in10's Unix or Linux Image
1in10 1in10 is offline
Registered User
 
Join Date: Jun 2014
Last Activity: 10 August 2017, 2:46 PM EDT
Location: Brazil
Posts: 122
Thanks: 38
Thanked 4 Times in 4 Posts
Ping remote sever, nc, telnet, whatever

I put this thread to shell and bsd, because I want to resolve this matter on bsd.
May somebody can explain to me how to ping a remote server, in unix. BTW the following code examples were tried on a linux system as well, with the same output, nothing. But on my bsd are not installed nmap neither netcat.
Furthermore there are more than one high anonymous or just anonymous servers, this is just one.

I tried so far the following commands (on linux)


Code:
nc -v -w 1 133.242.225.54 -z 80

output


Code:
133.242.225.54: inverse host lookup failed: Unknown host
(UNKNOWN) [133.242.225.54] 80 (http) : Connection timed out

Another example with telnet (on linux)

Code:
telnet 133.242.225.54/80

output (quote) no typing error:

Code:
telnet: could not resolve 133.242.225.54/80/telnet: Name or service not known

without the port

Code:
telnet 133.242.225.54
Trying 133.242.225.54...
telnet: Unable to connect to remote host: Connection timed out

and as well ping as follows

Code:
ping -c1 -w3 133.242.225.54
PING 133.242.225.54 (133.242.225.54) 56(84) bytes of data.

output


Code:
--- 133.242.225.54 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2000ms

Does this mean the remote server is up? At least ping sent three packets, zero loss. But is it on air?
I am aware there are tries with the destination port and tries without it. If someone could give me a hint I really could go on. Thanks in advance.
Sponsored Links
    #2  
Old Unix and Linux 01-09-2016
Peasant's Unix or Linux Image
Peasant Peasant is offline Forum Advisor  
Registered User
 
Join Date: Mar 2011
Last Activity: 25 September 2017, 12:38 PM EDT
Posts: 1,070
Thanks: 31
Thanked 313 Times in 274 Posts
If you are looking to see if something is listening on port 80, you were close with telnet.

Code:
telnet <ip> <port> # not <ip>/<port>

Without the port, telnet will try the default telnet port (port 23).
On most modern unix system telnet is disabled due to security reasons (plain text over network, no encryption etc.), in turn you got (which means telnet is not active on the remote server) :

Code:
telnet: Unable to connect to remote host: Connection timed out

Ping will tell you that the server is alive and responding to ICMP requests.
ICMP is also quite often blocked on firewalls, due to ICMP flooding exploits and alike.

Hope that clears things out.
Regards
Peasant.
The Following User Says Thank You to Peasant For This Useful Post:
1in10 (01-09-2016)
Sponsored Links
    #3  
Old Unix and Linux 01-09-2016
1in10's Unix or Linux Image
1in10 1in10 is offline
Registered User
 
Join Date: Jun 2014
Last Activity: 10 August 2017, 2:46 PM EDT
Location: Brazil
Posts: 122
Thanks: 38
Thanked 4 Times in 4 Posts
Its getting clearer, but I (as a user) want to connect to a high anonymous or an anonymous remote server (lets say as a proxy). Which mostly use (any of them) port 80, port 8080 or 3021, so even with a firewall installed there, a simple ping should work. It's not about ssh on port 22 or vpn. Before connecting, I want to here a positive response, server on air. Thats my intention.
    #4  
Old Unix and Linux 01-09-2016
Peasant's Unix or Linux Image
Peasant Peasant is offline Forum Advisor  
Registered User
 
Join Date: Mar 2011
Last Activity: 25 September 2017, 12:38 PM EDT
Posts: 1,070
Thanks: 31
Thanked 313 Times in 274 Posts
Ping against server will work if firewall allows ICMP probes.

If a server service is listening on port N, a simple telnet IP port will tell you that.
Something like :

Code:
:~$ telnet www.unix.com 80
Trying 4.59.125.171...
Connected to www.unix.com.
Escape character is '^]'.

This tells me that 4.59.125.171 has a port 80 open are receiving requests.

For further (security Linux) analysis nmap is the best tool.
Port Scanning is Not a Crime but acting on its results can be, especially on government and financial sites.

Regards
Peasant.
Sponsored Links
    #5  
Old Unix and Linux 01-09-2016
RudiC RudiC is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 26 September 2017, 6:48 AM EDT
Location: Aachen, Germany
Posts: 11,377
Thanks: 299
Thanked 3,528 Times in 3,245 Posts
Quote:
Originally Posted by 1in10 View Post
.
.
.
Code:
ping -c1 -w3 133.242.225.54
PING 133.242.225.54 (133.242.225.54) 56(84) bytes of data.

output


Code:
--- 133.242.225.54 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2000ms

Does this mean the remote server is up? At least ping sent three packets, zero loss. But is it on air?
.
.
.
ping transmitted three packets but didn't receive any: 100% packet loss, not zero!
It doesn't seem to be "on air" unless those packets are intercepted by some firewall.
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ping and telnet - HP-UX newbie_01 UNIX for Advanced & Expert Users 4 08-11-2010 08:36 AM
no telnet, ping ok... krabu Infrastructure Monitoring 9 04-13-2009 09:39 AM
Run command on remote sever from script ranvijaidba Shell Programming and Scripting 1 11-13-2008 03:01 AM
Openserver 5.0.4 can't be ping or telnet into from a remote site kayode SCO 0 02-09-2004 07:03 AM
ping and telnet macdonto IP Networking 5 10-05-2001 09:24 AM



All times are GMT -4. The time now is 06:52 AM.