Sponsored Content
Full Discussion: Test Connection to hosts
Top Forums UNIX for Dummies Questions & Answers Test Connection to hosts Post 302711573 by bakunin on Sunday 7th of October 2012 04:05:55 AM
Old 10-07-2012
I don't understand what exactly you are after. Knowing a list of open ports will help you not at all in getting what you said you want and you can't "copy" this in any way.

If you want to guarantee simple IP connectivity the new host just has to be in the same subnet than the old one. That is: HOSTB has to share the IP subnet with HOSTA. Then it is copying the routing information of HOSTA (issue "netstat -rn" to get this information) and you should be done.

Further complications would arise if there are firewalls within your network: You will have to adapt their rules, but this can only be done on the firewall systems themselves, neither on HOSTA nor HOSTB.

If you need a certain protocol to work you will have to make sure all the prerequisites are met. For instance, if you want "ssh" to work (probably without further authentification) you will have to make sure the "sshd" configuration is in place ("/etc/sshd_config") and the keys are exchanged (as per default "~/.ssh/authorized_keys", "~/.ssh/known_hosts"). Still, you won't need any list of open ports for this.

Of course you could use "nmap" consecutively on all your hosts to find out open ports, but it would be probably easier to use "netstat" locally on each of them , as you claim to have HOSTA having connectivity to all of them (whatever this means - pingable? exchanged ssh-keys? something else?). Still, what will that information help you? Definitely not in building HOSTB, because there is nothing you could configure in HOSTB based on this information.

I hope this helps.

bakunin

Last edited by bakunin; 10-07-2012 at 05:11 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Create a shell script to test the telnet connection status

Hi friends, I'm newbie to shell script. I wanted to create a shell script which able to write a result for all the telnet connection status. For example, from this machine I want to test the telnet connection (total 100+ servers) with this machine. Any idea how to write this shell script?... (16 Replies)
Discussion started by: yhcheong
16 Replies

2. Shell Programming and Scripting

Database Connection test in unix Script

i have a unix script that gives me the sysdate from the database EDNAMID.WORLD.What i want my script to do the following 1) Establish a database connection 2) if database connection is successfull then echo the message "Connected" 3) put the o/p of the Sql query in a spool file 4) then... (3 Replies)
Discussion started by: ali560045
3 Replies

3. Shell Programming and Scripting

Connection Test Script

I am writing a script to do some conditional logic based on the results of a connection test. I need to capture the output of netcat, the 3 expected conditions are as follows. I need to capture the output of this command. I could write this to a file, but I would like to do it clearer if possible.... (1 Reply)
Discussion started by: princeboot
1 Replies

4. Shell Programming and Scripting

Need help to make connection to various hosts

Guys If someone could help me? Basically I want to connect from my central server and run the script to remote servers (in our environment we do not need a username/password to connect); like below ssh <server_name_1> /ora/rman/scripts/bk2.sh 2>/dev/null >> /tmp/an.log ssh <server_name_2>... (3 Replies)
Discussion started by: anjum.suri
3 Replies

5. Shell Programming and Scripting

bash script to test network connection - please help

I want to test if my host can connect to any of the following 10 hosts (192.168.1.0 to 192.168.1.9) I didnt know which command i should use, so i chose ping. (i wonder if i should use tracepath or sth else) my code is the following: #!/bin/bash clear firstPart="192.168.1" maxNum="9" ... (2 Replies)
Discussion started by: shadow_boi
2 Replies

6. UNIX for Dummies Questions & Answers

Test new DSN connection to sql server

I installed an odbc driver and created a DSN to connect to a sql server database on AIX 6. I want to know how to test the DSN from the command line. What syntax or commands do I use? ---------- Post updated at 11:44 AM ---------- Previous update was at 08:26 AM ---------- OK I figured out how... (9 Replies)
Discussion started by: Jdbrown239
9 Replies

7. UNIX for Dummies Questions & Answers

Shell Script to test telnet connection using port

Hello, I need to test telnet connections using port number for few hosts. Could you please help me? Thanks !! (1 Reply)
Discussion started by: skhichi
1 Replies

8. HP-UX

How can I test ldap connection to DC?

Hi all, Recently, I configured LDAP loadbalancing. So I need to test it from HPUX servers. But I don't know how to to it. I know many ldap connection tools such as ldap browser etc. But it's HPUX 11.31, so please share your practices. Thanks (1 Reply)
Discussion started by: sembii
1 Replies

9. Shell Programming and Scripting

Ssh to validate multiple remote hosts connection validation.

Dear Folks, I am trying to read a config file contains ip and port numbers. i want to read each line of the config file and check ssh connection is happening or not. Kindly guide. Config file: abc@1.2.342 22 abc@1.2.343 22 abc@1.2.344 22 abc@1.2.345 22... (9 Replies)
Discussion started by: sadique.manzar
9 Replies

10. Solaris

How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh. Actions to perform within a single ssh session via shell script - copy a file - untar at destination (remote host) OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies
HOSTS(5)						      BSD File Formats Manual							  HOSTS(5)

NAME
hosts -- host name data base DESCRIPTION
The hosts file contains information regarding the known hosts on the network. For each host a single line should be present with the follow- ing information: Internet address Official host name Aliases Items are separated by any number of blanks and/or tab characters. A ``#'' indicates the beginning of a comment; characters up to the end of the line are not interpreted by routines which search the file. Network addresses may either be specified for IP version 4 or version 6. IP version 4 addresses are specified in the conventional dotted address notation. IP version 6 addresses are specified using the colon-separated notation described in RFC1924. Host names may contain any printable character other than a field delimiter, newline, or comment character. The hosts file is read by mDNSResponder(8) and used to supply results for calls to getaddrinfo(3), getnameinfo(3), etc. in addition to results obtained from multicast and unicast DNS. FILES
/etc/hosts SEE ALSO
gethostent(3), getipnodebyname(3), getaddrinfo(3), getnameinfo(3) RFC1924: A Compact Representation of IPv6 Addresses. HISTORY
The hosts file format appeared in 4.2BSD. 4.2 Berkeley Distribution December 11, 1993 4.2 Berkeley Distribution
All times are GMT -4. The time now is 07:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy