Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Either run (for information on all ethernet devices)
Code:
ifconfig
or (for information on specific ethernet device, in this case eth0)
Code:
ifconfig eth0
and you'll see your IP and other information, if you have a direct connection to the internet (i.e. not trough Local Area Network). If you are inside a LAN, you'll only see your LAN IP address, in which case it's probably easier to just visit a site like whatismyip.com which will happily tell you your external IP.
It's sort of new utility with some new possibilities.
In general, it could work as a replacement for a majority of different Unix network commands.
It allows to operate with IP addresses and aliases, routes, etc.
Understands short abbreviations of commands, such as
Code:
ip addr show = ip ad sh
ip route = ip ro
etc.
Some examples.
Code:
ip addr add 10.0.0.10/16 dev eth0
ip link set eth0 up
ip route add 20.0.0.0/8 via 10.0.0.1
ip link show
ip addr show
---
Using aliases:
ip ad ad 10.0.0.1/24 dev eth0
ip ad ad 20.10.1.1/16 dev eth0
ip li set eth0 up
It's easier to type such short commands.
I think it's quite good replacement for old Unix network commands.
Of course, the OP probably wants his external address.
Getting that from the command line is a little tricky. I've seen it demonstrated, but can't remember how. One could of course look at the main Router Page in a browser, but for most non-technical people, looking at one of the 40 gazillion web pages that display it is probably the easiest.
It's sort of new utility with some new possibilities.
In general, it could work as a replacement for a majority of different Unix network commands.
<snip>
'ip tool' has been around for quite some time. It's just that a lot of new people don't use it.
Code:
excerpt from 'man ip'
ip - show / manipulate routing, devices, policy routing and tunnels
SYNOPSIS
ip [ OPTIONS ] OBJECT { COMMAND | help }
OBJECT := { link | addr | route | rule | neigh | tunnel | maddr |
mroute | monitor }
OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] | -f[amily] { inet
| inet6 | ipx | dnet | link } | -o[neline] }
ip link set DEVICE { up | down | arp { on | off } |
promisc { on | off } |
allmulti { on | off } |
dynamic { on | off } |
multicast { on | off } |
txqueuelen PACKETS |
name NEWNAME |
address LLADDR | broadcast LLADDR |
mtu MTU } ...
HISTORY
ip was written by Alexey N. Kuznetsov and added in Linux 2.2.
The use of the 'ip tool' can be very powerful to the user. One needs to read the 'man 'ip' to get a better understanding.
Not all network connections lead to the internet, and even if a connection does, the IP address used to connect to the server you reference may or may not be masked by a firewall. For example, a wireless router will generally have a WAN address while giving out LAN addresses to the connected machines.
ta0kira
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.