ifconfig works, but only if you are directly connected. If you are behind a router or some other NAT setup, you will get your Private IP from ifconfig.
You can also run traces and things, but the easiest way I've found that seems to be consistent (for those with/without NAT) is the zoneedit.com or whatismyip.com pages.
Also, for those who are unaware of "eth0" or their connection devices, and have simply "made linux work" they will have no idea 1:
What ifconfig is;
where to type it in at;
how to read it