How to know local IP address in X-Terminal?


 
Thread Tools Search this Thread
Special Forums IP Networking How to know local IP address in X-Terminal?
# 1  
Old 12-17-2012
Network How to know local IP address in X-Terminal?

Im using a X-Terminal in my windows pc to connect to a Linux server.
Is there a way to know my local IP address in my x-terminal console?

Here are few commands which didnt help me:

Code:
ss_cc@MGTS5026-13sh1:~> finger
Login      Name                  Tty      Idle  Login Time   Where
loadhlr                          pts/11     12     Mon 10:53 
loadnew                          pts/17    10d  Dec  6 13:20 
loaduser   loaduser              pts/6      1d     Fri 11:03 
ss_cc                            pts/12      -     Mon 10:41 
ss_smsc                          pts/10     52     Sun 10:45 
st_smsc                          pts/13     22     Mon 10:42 


ss_cc@MGTS5026-13sh1:~> w
 11:13:44 up 88 days,  1:48,  6 users,  load average: 0.68, 0.94, 1.37
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
loaduser pts/6     Fri11   39:58m  1.03s  0.02s -bash
ss_smsc  pts/10    Sun10    5:14   1.04s  0.01s -bash
loadhlr  pts/11    10:53   20:15   0.51s  0.02s -bash
ss_cc    pts/12    10:41    0.00s  0.09s  0.01s w
st_smsc  pts/13    10:42   30:54   1.40s  0.01s -bash
loadnew  pts/17    06Dec12 10days  1.33s  0.01s -bash

ss_cc@MGTS5026-13sh1:~> who
loaduser pts/6        2012-12-14 11:03
ss_smsc  pts/10       2012-12-16 10:45
loadhlr  pts/11       2012-12-17 10:53
ss_cc    pts/12       2012-12-17 10:41
st_smsc  pts/13       2012-12-17 10:42
loadnew  pts/17       2012-12-06 13:20

# 2  
Old 12-17-2012
Did you try who -a or netstat -t?
# 3  
Old 12-17-2012
I tried your commands, that too doesnt help me..

Code:
ss_cc@MGTS5026-13sh1:~> who -a
                        2012-09-20 10:26               922 id=si    term=0 exit=0
           run-level 5  2012-09-20 10:26                   last=S
                        2012-09-20 10:26              2294 id=l5    term=0 exit=0
LOGIN      tty1         2012-09-20 10:26              3581 id=1
LOGIN      tty2         2012-09-20 10:26              3582 id=2
LOGIN      tty3         2012-09-20 10:26              3583 id=3
LOGIN      tty4         2012-09-20 10:26              3584 id=4
LOGIN      tty5         2012-09-20 10:26              3585 id=5
LOGIN      tty6         2012-09-20 10:26              3586 id=6
ss_capusr3 + pts/0        2012-12-13 16:28  old        17957
ss_capusr4 + pts/1        2012-12-17 09:53 01:58       27370
           pts/2        2012-12-05 09:38             30923 id=/2    term=0 exit=0


ss_cc@MGTS5026-13sh1:~> netstat -t
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 localhost:6014          localhost:57876         ESTABLISHED 
tcp        0      0 localhost:6020          localhost:53779         ESTABLISHED 
tcp        0      0 localhost:6019          localhost:56338         ESTABLISHED 
tcp        0      0 localhost:6019          localhost:56337         ESTABLISHED 
tcp        0      0 localhost:6014          localhost:57872         ESTABLISHED 
tcp        0      0 localhost:6010          localhost:46623         ESTABLISHED 
tcp        0      0 localhost:6020          localhost:53789         ESTABLISHED

# 4  
Old 12-17-2012
Then your connections are on localhost only, usually 127.0.0.1. Were it a remote session, netstatwould supply e.g.
Code:
# netstat -tn
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 192.168.178.200:445     192.168.178.150:2847    ESTABLISHED 
tcp        0      0 192.168.178.200:139     192.168.178.147:3368    ESTABLISHED 
tcp        0    256 192.168.178.200:22      91.57.50.9:30082        ESTABLISHED

which is two LAN smb sessions and one remote ssh session.
# 5  
Old 12-17-2012
So you mean it is not possible to get the local ip address?
But I am able to get the local ip address when I login using Putty, whats going wrong when I use xterminal (Netsarang's Xclient)

Code:
ss_cc@MGTS5026-13sh1:~> who
ss_capusr3 pts/0        2012-12-13 16:28
ss_capusr4 pts/1        2012-12-17 09:53
ss_cc    pts/14       2012-12-17 13:24 (192.168.134.213)
ss_cc    pts/12       2012-12-17 10:41

ss_cc@MGTS5026-13sh1:~> finger
Login      Name                  Tty      Idle  Login Time   Where
ss_capusr3                       pts/0      3d     Thu 16:28 
ss_capusr4                       pts/1    3:31     Mon 09:53 
ss_cc                            pts/12   1:31     Mon 10:41 
ss_cc                            pts/14      -     Mon 13:24 192.168.134.213

# 6  
Old 12-17-2012
We are talking localhost, not local IP. Localhost is 127.0.0.1. You can find your local IP with sth like ifconfig or ip addr, depending on the OS you use.
# 7  
Old 12-17-2012
I can see my local IP in my windows using ipconfig.
Question is: Why my server isnt displaying the local ip address ('who' command) when i use remote sessions in xterminal, but when i use putty it is displaying it ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Can't get local IP address in getaddrinfo

Hi all, I am working with SIP protocol and am using SIPp to generate SIP traffic. But the call is not going through since I get the error; 2015-02-24 14:09:39:330 1424804979.330517: Can't get local IP address in getaddrinfo, local_host='NODE-01', local_ip=''. My ifconfig output is; ... (2 Replies)
Discussion started by: Junaid Subhani
2 Replies

2. Debian

How to change local IP address?

I have a new Ethernet device that has a default IP address on a different subnet and need to change it. I have a Debian 6.0 host connected to the device with a crossover cable and have changed the host /etc/hosts and /etc/networks files to the same subnet as the new device and rebooted. Ping... (2 Replies)
Discussion started by: snorkack59
2 Replies

3. BSD

Link Local IPv6 Address

Hi, Am using FreeBSD7.4/i386 During IPv6 configuration, I added the following in rc.conf as Restarted IPv6 network using /etc/rc.d/network_ipv6 restart.. My problem is I need to set link local IPv6 address auto-configured.. Is my proceeding right?? I feel something missing to make... (0 Replies)
Discussion started by: Priya Amaresh
0 Replies

4. Shell Programming and Scripting

Get Local IP address using Sed, Awk

Hi All, how to get solaris box local ip addresss in variable, using sed or awk utlities. Thanks, Mani Muthu (7 Replies)
Discussion started by: k_manimuthu
7 Replies

5. Programming

Redirecting Terminal to Local Application!

i wanted to execute some terminal commands on local linux, parse their output and display it to the user, i checked netcat source code but i couldnt understance it since im new to c (and linux at the same time). so i was wondering if there is away to run an instance of terminal hidden, read and... (15 Replies)
Discussion started by: JonhyM
15 Replies

6. Shell Programming and Scripting

Local system IP address in UNIX

We have requirement to get the local system IP address of whoever logined the DataBase(sqlplus) or any process in application server. Actually I connected to application server thru putty and then conencted to Database using sqlplus command. we have tried below commands : who -u|grep... (4 Replies)
Discussion started by: siri_886
4 Replies

7. UNIX for Dummies Questions & Answers

How can I know IP address of terminal?

Hi all, I am new in Unix world. I usually need to trace who connect to which terminal by IP address. So, could you please show me HOW TO RECOGNIZE which IP address connected to terminal? I use netstat by no luck. Thank you, (9 Replies)
Discussion started by: trinhnguyen
9 Replies

8. HP-UX

Get the terminal IP-ADDRESS

HI !!! I'm working under Windows-XP and Reflexion-X against a Unix HP-UX host. From a shellscript I need to open a new terminal window, I need the IP-ADDRESS for that. It is asked the user. It want to be able to obtain it automatically. WHO CAN I GET IT? THANKS. (2 Replies)
Discussion started by: josep55
2 Replies

9. Shell Programming and Scripting

Easy way to get local IP address

I needed to get a machine's local IP address when not root (so no ifconfig). Eventually, I arrived at this convoluted solution that grabs the unique local IP info from netstat... netstat -n -t | awk '{print $4}' | grep -o "*\.*\.*\.*" |\ grep -v "127.0.0.1" | sort -u ...however I... (5 Replies)
Discussion started by: simonb
5 Replies

10. UNIX for Dummies Questions & Answers

How do I get the IP address of my local unix box???

Hiya all, How do I get the IP address of my local unix box??? IPconfig - don't exist nslookup - only for other boxes.... I have my Fedora Server now on the office network. Can ping others, can get onto internet via web proxy.... Also: How do I create a Drive Share, so our windows... (9 Replies)
Discussion started by: marty 600
9 Replies
Login or Register to Ask a Question