Sponsored Content
Operating Systems Linux Ubuntu Connecting to a remote server Post 302278625 by Altay_H on Tuesday 20th of January 2009 06:02:44 PM
Old 01-20-2009
Connecting to a remote server

Hi,

I have an interesting problem. I cannot connect to a personal server I set up. What's interesting is that I can connect to it from the LAN using its non-local IP address. However, I cannot seem to connect to it from anywhere else.

Here's how my server is set up:
My entire home has a single Ethernet cable that goes directly into our router. Every device in the house is connected to the router. My server is on a static (local) IP address. The router is configured to forward the necessary ports to my server. So, when I tested out my connection, I was able to connect to my server from another computer on the same local area network using my non-local IP address (the IP address assigned to my router by my ISP). However, when I try to connect to my IP address from a computer that is not on my LAN using my non-local IP address, I receive an error like this:
Code:
10061 - Connection refused
The server you are attempting to access has refused the connection with the gateway. This usually results from trying to connect to a service that is inactive on the server.

I can connect to my server from my LAN using the router's IP address, but I can't connect to it from outside of my LAN using the router's IP address. Does anyone know what I'm doing wrong? Could there be some sort of setting I missed that's necessary to make my router "public?"
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Connecting to remote servers

Please advise, The previous thread asked about the automated transfer of files between two servers. The question is - is there any way of encrypting the password within the script or is it a matter of setting the permissions settings on the script so that it can only be executed and possibly... (1 Reply)
Discussion started by: rdbooth
1 Replies

2. Shell Programming and Scripting

connecting to remote db from unix script

Hi everybody, My bash script is trying to connect to a remote database using the 'sqlplus' binary.For this i set(export) the variable TWO_TASK to the value of database name excluding the dot extension part. Can anyone explain me what's the significance of this TWO_TASK variable while... (8 Replies)
Discussion started by: DILEEP410
8 Replies

3. Shell Programming and Scripting

Connecting to remote unix server using java?

I need help writing java code that can connect to a remote unix server, and run a script on that server. I have scoured the internet, but I have been unable to find proper documentation on how this can be accomplished. Any help is appreciated thanks. (1 Reply)
Discussion started by: developncode
1 Replies

4. Red Hat

How to know which application is connecting to a remote host

From a host A an application is trying to connect to host B. From firewall side I can see packets dropped coming from host A to host B. I've access to host A: how can I know which "application" is trying to connect to host B? Thanks, Marco (3 Replies)
Discussion started by: marcopb
3 Replies

5. UNIX for Dummies Questions & Answers

SQL block in a Shell Script connecting to a local and remote DB

Hi All, In a Shell scriipt with a SQL block I want to issue a query against a local DB and a remote DB on a remote server. The shell script is running locally. This is how I connect to the local server. But I want the query to reference remote table in the join. Question can I specify a... (1 Reply)
Discussion started by: daveu7
1 Replies

6. Shell Programming and Scripting

Connecting to remote host

Checking crontab job entry in 3 different hosts Hi Gurus, I am trying to connect to remote host from current host to check crontab entries. I have started like this ssh -n -l db2psp 205.191.156.17 ". ~/.profile >/dev/null 2>/dev/null; cd log ;ls | wc -l" I got this error ? ssh:... (1 Reply)
Discussion started by: rocking77
1 Replies

7. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

8. Shell Programming and Scripting

Error when connecting to remote server to find files with timestamp today's day

I am connecting to remote server and try to check if files with timestamp as Today's day are on the directory. Below is my code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly; Today=`date +%Y%m%d`; if ;then echo "We... (1 Reply)
Discussion started by: digioleg54
1 Replies

9. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

10. Programming

Connecting remote SSH server which OSS lib to choose ?

Hey i want to be able to write simple SSH client to be able to connect to SSH server and invoke remote SSH command i found libssh and libssh2 and the old openSSh , what is the best and most supported library to choose from ? i need it to be cross platform . Thanks (0 Replies)
Discussion started by: umen
0 Replies
connect(3XNET)					   X/Open Networking Services Library Functions 				    connect(3XNET)

NAME
connect - connect a socket SYNOPSIS
cc [ flag ... ] file ... -lxnet [ library ... ] #include <sys/socket.h> int connect(int socket, const struct sockaddr *address, socklen_t address_len); DESCRIPTION
The connect() function requests a connection to be made on a socket. The function takes the following arguments: socket Specifies the file descriptor associated with the socket. address Points to a sockaddr structure containing the peer address. The length and format of the address depend on the address family of the socket. address_len Specifies the length of the sockaddr structure pointed to by the address argument. If the socket has not already been bound to a local address, connect() will bind it to an address which, unless the socket's address fam- ily is AF_UNIX, is an unused local address. If the initiating socket is not connection-mode, then connect() sets the socket's peer address, but no connection is made. For SOCK_DGRAM sockets, the peer address identifies where all datagrams are sent on subsequent send(3XNET) calls, and limits the remote sender for subse- quent recv(3XNET) calls. If address is a null address for the protocol, the socket's peer address will be reset. If the initiating socket is connection-mode, then connect() attempts to establish a connection to the address specified by the address argument. If the connection cannot be established immediately and O_NONBLOCK is not set for the file descriptor for the socket, connect() will block for up to an unspecified timeout interval until the connection is established. If the timeout interval expires before the connection is established, connect() will fail and the connection attempt will be aborted. If connect() is interrupted by a signal that is caught while blocked waiting to establish a connection, connect() will fail and set errno to EINTR, but the connection request will not be aborted, and the connection will be established asynchronously. If the connection cannot be established immediately and O_NONBLOCK is set for the file descriptor for the socket, connect() will fail and set errno to EINPROGRESS, but the connection request will not be aborted, and the connection will be established asynchronously. Subsequent calls to connect() for the same socket, before the connection is established, will fail and set errno to EALREADY. When the connection has been established asynchronously, select(3C) and poll(2) will indicate that the file descriptor for the socket is ready for writing. The socket in use may require the process to have appropriate privileges to use the connect() function. USAGE
If connect() fails, the state of the socket is unspecified. Portable applications should close the file descriptor and create a new socket before attempting to reconnect. RETURN VALUES
Upon successful completion, connect() returns 0. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The connect() function will fail if: EADDRNOTAVAIL The specified address is not available from the local machine. EAFNOSUPPORT The specified address is not a valid address for the address family of the specified socket. EALREADY A connection request is already in progress for the specified socket. EBADF The socket argument is not a valid file descriptor. ECONNREFUSED The target address was not listening for connections or refused the connection request. EFAULT The address parameter can not be accessed. EINPROGRESS O_NONBLOCK is set for the file descriptor for the socket and the connection cannot be immediately established; the connection will be established asynchronously. EINTR The attempt to establish a connection was interrupted by delivery of a signal that was caught; the connection will be established asynchronously. EISCONN The specified socket is connection-mode and is already connected. ENETUNREACH No route to the network is present. ENOTSOCK The socket argument does not refer to a socket. EPROTOTYPE The specified address has a different type than the socket bound to the specified peer address. ETIMEDOUT The attempt to connect timed out before a connection was made. If the address family of the socket is AF_UNIX, then connect() will fail if: EIO An I/O error occurred while reading from or writing to the file system. ELOOP Too many symbolic links were encountered in translating the pathname in address. ENAMETOOLONG A component of a pathname exceeded NAME_MAX characters, or an entire pathname exceeded PATH_MAX characters. ENOENT A component of the pathname does not name an existing file or the pathname is an empty string. ENOTDIR A component of the path prefix of the pathname in address is not a directory. The connect() function may fail if: EACCES Search permission is denied for a component of the path prefix; or write access to the named socket is denied. EADDRINUSE Attempt to establish a connection that uses addresses that are already in use. ECONNRESET Remote host reset the connection request. EHOSTUNREACH The destination host cannot be reached (probably because the host is down or a remote router cannot reach it). EINVAL The address_len argument is not a valid length for the address family; or invalid address family in sockaddr struc- ture. ENAMETOOLONG Pathname resolution of a symbolic link produced an intermediate result whose length exceeds PATH_MAX. ENETDOWN The local interface used to reach the destination is down. ENOBUFS No buffer space is available. ENOSR There were insufficient STREAMS resources available to complete the operation. EOPNOTSUPP The socket is listening and can not be connected. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
close(2), poll(2), accept(3XNET), bind(3XNET), getsockname(3XNET), select(3C), send(3XNET), shutdown(3XNET), socket(3XNET), attributes(5), standards(5) SunOS 5.10 10 Jun 2002 connect(3XNET)
All times are GMT -4. The time now is 10:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy