check connectivity if access other ip address centos 7 code example

Example: check connectivity if access other ip address centos 7

#1- telnet
$ sudo telnet IP Port

Trying 11.111.111.11...
Connected to 11.111.111.11.
Escape character is '^]'.

#2- nmap
$ sudo nmap -p Port IP

Starting Nmap 7.01 ( https://nmap.org ) at 2021-02-06 08:34 EET
Nmap scan report for 11.111.111.11
Host is up (0.0020s latency).
PORT     STATE SERVICE

Nmap done: 1 IP address (1 host up) scanned in 1.3 seconds