Check the IP Address in Linux
No matter what build of Linux or Unix you are running, there are methods for checking your internal IP address from using a simple graphical interface to delving deeper into network information.
Contents
Steps
Use the Ubuntu Interface
- Right click the network icon in your notifications area. In most builds the icon is two vertical arrows pointing up and down, located near the date and time.
- If your network icon is not displayed, you can add it back by right clicking the notification area, selecting "Add to Panel," and then "Network Manager".
- If your network icon still won't display, navigate to System > Administration > Network Tools and select your network device from the drop down menu (usually "Ethernet Interface eth0"). The 10 digit number that displays is your IP address.
- Click Connection Information. This should open a window with information on your network connections, including your IP Address.
Enter a Terminal Command in Most Linux Builds
- Open Terminal. You can find this in your list of applications or by searching for "terminal".
- Enter this command: ip addr show . This should return information on each ethernet device connected.
- Each device's IP address is listed after "inet".
- If you're not sure which device you're looking for, you most likely want "eth0", the first ethernet adapter recognized. To only view information for eth0, enter ip addr show eth0 .
Enter a Terminal Command in Unix, "Unixish", and some Linux Builds
- Open a terminal. You can find this in your list of applications or by searching for "terminal".
- Enter this command: /sbin/ifconfig . This should display a large block of network information.
- If you get an error message that mentions your lack of administrative privileges, enter sudo /sbin/ifconfig .
- If you are using Solaris or some other Unix builds, you may need to enter /sbin/ifconfig -a to display information for more than one device.
- If you get a message telling you that ifconfig is deprecated, switch to the instructions for Enter a Terminal Command in recent Linux builds above.
- Find the IP address for each device listed after "inet adr".
- If there is too much information for you to find your IP address, enter /sbin/ifconfig | less to limit the amount displayed, or /sbin/ifconfig | grep 'inet addr:' to only display the IP address.
- If you're not sure which device you're looking for, you most likely want "eth0", the first ethernet adapter recognized. To only view information for eth0, enter /sbin/ifconfig eth0 .
Another Terminal Command for Ubuntu/Unix/Linux
- Open a terminal.
- Enter this command: hostname -I (that's a capital I as in Idaho)
- If you have a single interface active, you will get back a single IP address, without any additional text.
- % hostname -I
- 192.168.1.20
- If you have a single interface active, you will get back a single IP address, without any additional text.
Tips
- If you're looking for your external IP address instead, simply visit a website such as http://www.whatismyip.org , or google "what is my ip?" for many similar websites.