How do I find the IP addresses and interfaces on my Linux server?
Use ip address to inspect the addresses assigned inside the operating system. A dedicated server may have a public address directly on its interface; a VPS behind provider NAT may show a private address even when clients connect to a public address. The provider’s assigned public endpoint remains the reference for inbound access.
Before you start
- An authenticated shell on the server.
Instructions
1. List interfaces and addresses
Run these commands after connecting to the server. The interface name is installation-specific; do not assume it is eth0. Loopback addresses identify the local machine and are not public connection targets.
ip -brief address show
ip -brief link showThe brief view pairs each interface with its state and addresses. UP shows administrative state; physical carrier information can require the detailed link view.
2. Inspect the actual interface
Replace ens3 with a name returned above. Record the prefix length and whether the address is IPv4 or IPv6. Compare it with the network details supplied for this server before considering a configuration change.
ip address show dev ens3Displays only the selected interface. This command does not add, remove or renew an address.
Check the result
- The intended interface exists and has the expected address or documented private NAT address.
- Record public NAT mappings separately; an interface listing cannot establish a provider-side mapping.
Troubleshooting
- Cannot find device ens3
- Use the exact interface name from the brief listing. Names such as enp1s0, eth0 and ens18 are also possible.
- The assigned public address is absent
- Check whether the service uses NAT or routed additional addresses before changing networking. A blind address change can break remote access.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
