Solved

Obtain session's IP address

Posted on 1997-08-18
8
315 Views
Last Modified: 2010-04-21

Platform: NCR Unix 3555

When I access our Unix system through a dial-in line,
my session will be assigned an IP address, is
there a command I can issue to find out the IP address
I'm currently assigned to??
0
Comment
Question by:mindless
  • 5
  • 3
8 Comments
 

Accepted Solution

by:
imho earned 10 total points
Comment Utility
Use the command netstat -rn to display the routing table...
you'll see something like

Routing Table:
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------
224.0.0.0            127.0.0.1             UH       0      0  lo0
127.0.0.1            127.0.0.1             UH       0   3088  lo0
168.234.82.0         168.234.82.13         U        2    105  le0
default              168.234.82.1          UG       0    671  

One interface should be ipdpt0 or tun0 or something like that, that is the modem (ppp) interface, the IP address you have been
assigned is the one belonging to that interface (under the
gateway header).


0
 

Author Comment

by:mindless
Comment Utility

Here's what I got when running "netstat -rn" from my dial-in
session:

Routing tables
Destination          Gateway              Flags    Refcnt Use        Interface
142.205.224          142.205.224.8        U        0      89730541   en4
142.205.180          142.205.180.8        U        0      8921107    en3
142.205.116          142.205.116.8        U        0      0          en2
142.205.98.0         142.205.98.9         U        0      11923103   en0
142.205.98.0         142.205.98.10        U        0      0          en5
142.205.12           142.205.12.8         U        0      29665263   en1
default              142.205.98.1         UG       0      2650630    en0
127.0.0.1            127.0.0.1            UH       0      10         lo0      

When I said "dial-in", it was actually a dial-in and connect to
the company's LAN first, then telnet to the Unix box.  Would that
make a different?? Is that why I didn't see any lines from above
indicating "modem"??  Any way to determine which one is
my IP address??

0
 

Expert Comment

by:imho
Comment Utility
which IP address you want to know? Are you dialing in from a Unix box or from a Windows machine? Are you connecting to a Unix Box or to a Win system?
0
 

Expert Comment

by:imho
Comment Utility
which IP address you want to know? Are you dialing in from a Unix box or from a Windows machine? Are you connecting to a Unix Box or to a Win system?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:mindless
Comment Utility
I'm dialing in from a Win95 machine to the company's
network, once connected to the LAN, I then
issue "telnet 123.456.78.90" to logon to that Unix
server.  Since I'm trying to use xterm via a dial-in line, I'll
need to obtain the dynamic IP address assigned
to this particular session in order to set the
DISPLAY value.  
0
 

Expert Comment

by:imho
Comment Utility
Then you should issue the netstat command at the Win95 box. I think it should tell you something similar to what the Unix box does.  I'll try it later, but for now just open a ms-dos command window and try the command. Good luck.

Regards,

imho
0
 

Author Comment

by:mindless
Comment Utility

I tried to run the command from Win95 MS-DOS prompt after
got connected but nothing got returned,
0
 

Expert Comment

by:imho
Comment Utility
Try the following:
  telnet to the unix box as usual, then:

$ last | head

you should be currently logged in and it should show where you're comming from. If a name appears and not an ip address, you can use:

$ nslookup host.domain.name

 to find out the IP address.

Regards,

imho

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now