User Tools

Site Tools


linux:networking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:networking [2022/09/12 09:23] bstaffordlinux:networking [2026/03/21 01:04] (current) – [Show Network Data] bstafford
Line 1: Line 1:
 ====== Linux IP Command ====== ====== Linux IP Command ======
 [[https://www.cyberciti.biz/faq/linux-ip-command-examples-usage-syntax/|here]] [[https://www.cyberciti.biz/faq/linux-ip-command-examples-usage-syntax/|here]]
 +
 +===== Show Subnet Data =====
 +<code>sudo apt install sipcalc</code>
 +<code>sipcalc 192.168.1.0/24 -a</code>
 +===== Show Network Data =====
 +
 +Use [[https://www.tecmint.com/configure-network-connections-using-nmcli-tool-in-linux/|nmcli]] <code>nmcli device show</code>
 +or
 +<code>#!/bin/bash
 +
 +INTERFACE=ens34
 +
 +echo "         Interface: $INTERFACE"
 +ip -4 addr show $INTERFACE | grep inet | awk -F " " '{print "              IPv4: " $2}'
 +ip route | grep default | grep "metric 100" | awk -F " " '{print "           Gateway: " $3}'
 +resolvectl -i $INTERFACE status --no-pager | awk '/DNS Server/,0'
 +nmcli connection show Wired\ connection\ 1 | grep -i dhcp_server_identifier | awk -F " " '{print "       DHCP Server: " $4}'</code>
 +
 +Get DHCP Server
 +<code>nmcli connection show --active
 +nmcli connection show "<active-connection-name>" | grep -i dhcp_server_identifier</code>
 ====== Ubuntu 20.04 Static IP ====== ====== Ubuntu 20.04 Static IP ======
 set the following in ''/etc/netplan/50-static-ip'' set the following in ''/etc/netplan/50-static-ip''
linux/networking.1662974581.txt.gz · Last modified: (external edit)