Local IP address?

Gavin Costello gavcos at gmail.com
Thu Feb 2 08:32:57 UTC 2006


On 01-Feb-2006 10:46, Dave M G wrote:
> Ubuntu Users,
> 
> This seems to be one of those questions so simple that no one feels the 
> need to provide the information.
> 
> I want to know how to be able to find out what my *local* IP address is. 
> I have a router which automatically assigns an IP address to each 
> computer hooked into it. I know my computer is in the range of 
> 192.168.0.???. But the last number is something between 1 and 4, and I'm 
> not sure what.
> 
> I've looked around on the net and I can easily find out my address as 
> seen from out on the internet, some completely random, dynamically 
> number assigned at my Internet Provider. But that's not what I need to know.
> 
> I need to know exactly what my LAN IP address is so that I can assign 
> port forwarding to my computer.
> 
> So, how do I do that?
---end quoted text---

I use the following line to find my local IP address (whether wireless
or wired):

ip -4 addr |grep "inet" | grep "eth" | awk '{print $2}' | cut -d '/' -f 1

HTH,

Gavin.
-- 
Gavin Costello
gavcos at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20060202/b9d8e99b/attachment.sig>


More information about the ubuntu-users mailing list