Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I use media tamples dv server... I connected it via SSH with putty.. I need my server's IP address and subnetmask. I know the IP address but I don't know the subnetmask.

How can I find out my server full IP details with ssh?

share|improve this question
I thought Media Tample had 24/7 support is that not included in the price? – Anthon May 11 '13 at 18:25
no they don't support dv server. things you do with plesk or ssh you are along.. – Erdem Ece May 11 '13 at 19:01
Just be aware that network admins can and do play games with a net number having different netmasks at different points on the net. I would expect to see this especially in a hosting environment. – msw May 12 '13 at 12:28
up vote 4 down vote accepted

Something like this?

ssh user@server /sbin/ifconfig -a
share|improve this answer
hi thanks. it says no such file or directory – Erdem Ece May 11 '13 at 18:56
No such file or directory locally? You do not have ssh? or when you login to the server? – Jared Burrows May 11 '13 at 19:43
@ErdemEce: Do you find it by locate ifconfig or using find etc? – Runium May 11 '13 at 20:01
thanks this helped me a alot – Erdem Ece May 12 '13 at 12:57

This outputs e.g. /24:

ip addr | 
  awk -v ipaddr= '\
    $1 == "inet" && $2 ~ "^" ipaddr "/" \
    {mask=$2; sub("^[^/]*","",mask); print mask}'

Make that your SSH command.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.