Re: Determine Source Network Adapter

From: Dale Talcott (aeh_at_quest.cc.purdue.edu)
Date: 06/24/04


Date: 24 Jun 04 08:53:01 EST

kentgeorge@hotmail.com (Kent) writes:

>Each interface has it's own IP address. They are on two separate
>networks. IE. en0 = 10.1.1.1, and en1 = 10.2.2.2. Once I've
>telnet'd into the server (assuming I've just lost my brain) how do I
>know which IP I used to telnet into the server?

>> > Does anyone know a way to tell what network adapter you connected to
>> > on an AIX server? (Running AIX 5.2)
>> >
>> > I'm dealing with a server that has multiple ethernet adapters, and I
>> > want to create a generic script to launch an application that requires
>> > knowing your source network address.

Look at the idlogin perl scripts that are part of the lsof package.
Check the archives of this group for locations for lsof. One source
is <ftp://lsof.itap.purdue.edu/>.

Your question was a little unclear. Do you care about the IP address
of the remote user, or the network interface the connection was made
through? In theory, given the right topology and routing tables, any IP
address could connect via any interface. That is, it is tricky to discover
exactly which interface a packet arrived through. It is easier to learn
which interface your reply packets will use. And simpler still is to
learn the IP address at the other end of the connection. The last is
what you can use lsof for.

-- 
Dale Talcott, IT Research Computing Services, Purdue University
aeh@purdue.edu         http://quest.cc.purdue.edu/~aeh/


Relevant Pages

  • Re: Problem configuring NAT to share Internet Connection
    ... One of my NICs in the server connect to a DSL ... modem and it connects to internet. ... > interface, that connects to the DSL modem, LAN interface, that connects to ... >> 7.- To connect server to Internet, I create a new network connection. ...
    (microsoft.public.win2000.ras_routing)
  • Re: Cannot get NAT to route in RRAS
    ... ADSL Link was set as the Public interface in NAT, ... The static route also adds in fine using the ADSL Link interface, ... separate DNS server handles client’s requests, ... > Internet connection. ...
    (microsoft.public.win2000.ras_routing)
  • Re: Design issue with constructor arguments
    ... had just the server and the messager processor and all was good. ... class which manages a single socket connection on a single port. ... the server also provides the client interface for allowing those ... columns....and the constructors parameters are dependent on which way ...
    (comp.object)
  • Re: What signal tells my app that my DHCP lease just renewed?
    ... A client application that has a long-established connection. ... The redirection server would maintain a TCP connection ... A server application that is bound to a specific interface. ... In the case of network reconfiguration (such as an interface being ...
    (comp.os.linux.networking)
  • Re: VPN Disconnects
    ... Microsoft Windows 2000 Advanced Server ... A demand-dial Point-to-Point Tunneling Protocol (PPTP) connection between ... does not match the remote server's Demand-Dial interface. ...
    (microsoft.public.isa.vpn)