2

I bought a VPS server yesterday. Server companies support is not avaible for now. I am going to set dns adress. So i know 1 ip number they gave to me, how can i learn how many ip's i have and what are they? Is there command for ubuntu for that? Or any other way?

0

3 Answers 3

3

ip addr as root is the way to go.

1
  • inet xx.xxx.39.203/24 brd xx.xxx.39.255 scope global eth0 i am getting this result, so it means what ?
    – Anonymous
    Feb 20, 2010 at 11:56
2

/sbin/ifconfig -a

Will result in something like

eth0      Link encap:Ethernet  HWaddr 00:1C:C0:78:D2:74  
          inet addr:aaa.bbb.ccc.dddd  Bcast:xxx.yyy.zzz.nnn  Mask:255.255.240.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:423575721 errors:0 dropped:0 overruns:0 frame:0
          TX packets:126628915 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3433267581 (3.1 GiB)  TX bytes:4221095056 (3.9 GiB)
          Interrupt:17 Base address:0x6000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:9838921 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9838921 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4205604044 (3.9 GiB)  TX bytes:4205604044 (3.9 GiB)

Any IP address not assigned to lo is a public IP address (confirm that by trying to ping it from another machine)

1

/sbin/ip addr as non-root ;-)

[kaman@host-10 ~]$ /sbin/ip a|grep -oP "inet (\d+\.){3}\d+"
inet 127.0.0.1
inet 192.168.0.10
inet 192.168.54.2
1
  • This may or may not work, depending on the actual permissions of /sbin and /sbin/ip. I wouldn't count on it.
    – joschi
    Apr 3, 2010 at 6:14

You must log in to answer this question.