To view the configuration and addresses of your computer's network interfaces in Debian/Ubuntu, you can use the following commands:
1. Using ip
Command (Recommended)
ip addr show
Explanation:
- This command displays all active and inactive network interfaces along with their IP addresses, MAC addresses, and other details.
- Look for lines starting with
inet
(for IPv4) orinet6
(for IPv6).
Example Output:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:1a:2b:3c:4d:5e brd ff:ff:ff:ff:ff:ff inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0 inet6 fe80::1a2b:3c4d:5e6f/64 scope link
inet 192.168.1.100/24
– IP address and subnet mask.link/ether
– MAC address.
2. Using ifconfig
Command (Legacy)
ifconfig
Explanation:
- Displays similar information but is considered deprecated in favor of the
ip
command. - You might need to install it:
sudo apt install net-tools
3. Using hostname -I
(Quick IP Address Only)
hostname -I
Explanation:
- Displays the IP addresses assigned to the machine, excluding additional details.
4. Using nmcli
(NetworkManager)
nmcli device show
Explanation:
- Displays detailed information about interfaces managed by NetworkManager.
5. Viewing Network Interfaces in /proc
cat /proc/net/dev
Explanation:
- Shows raw network interface statistics.
- Get link
- X
- Other Apps
- Get link
- X
- Other Apps
Comments
Post a Comment