User Tools

Site Tools


network:get_network_details

Network - Get Network Details

To get the details of your own systems, begin by finding your network interfaces. You can find the interfaces on your machines and the addresses associated with them by typing:

ip -4 addr show scope global

returns

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 198.51.100.45/18 brd 45.55.191.255 scope global eth0
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 192.168.1.5/16 brd 10.132.255.255 scope global eth1
       valid_lft forever preferred_lft forever

The highlighted output above shows two interfaces (eth0 and eth1) and the addresses assigned to each.

To find out which of these interfaces is your public interface, type:

ip route show | grep default

Returns

default via 111.111.111.111 dev <color red>eth0</color>

The interface shown (eth0 in this example) will be the interface connected to your default gateway. This is almost certainly your public interface.

network/get_network_details.txt · Last modified: 2020/07/20 14:32 by 95.91.74.120

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki