Networking

Networking

list all current ethernet adapters

ifconfig

to bring a specific network interface up or down

ifconfig <network interface> down
ifconfig <network interface> up
ip link
# or
ip l
ip addr
#or 
ip a

output current wifi name

sudo apt install -y wireless tools
iwgetid
iwgetid -r # just the name

list all wifis

iwlist wlan0 scan
sudo apt install -y network-manager
nmcli -f in-use,ssid,bssid,signal,bars  dev wifi

list wifis

nmcli d wifi

connect to a specific wifi

nmcli d wifi connect XX:XX:XX:XX:XX:XX

https://askubuntu.com/questions/833905/how-can-i-connect-to-a-specific-bssid

Find services using a port

sudo lsof -i:3389

Realtime wifi strength monitoring

apt install wavemon
wavemon

Other networking commands

sudo nmcli network off
sudo nmcli network on
sudo netplan try
sudo netplan apply

get ip info

from here

ifconfig
host myip.opendns.com resolver1.opendns.com
dig @resolver4.opendns.com myip.opendns.com +short

get mac

arp -a <ip address>

https://www.lifewire.com/find-a-mac-address-using-an-ip-address-818132

Wifi Scanning

nmcli d wifi

Networking

nm-connection-editor

Measuring Speed Between Computers

sudo apt install -y iperf

computer 1:

iperf -s

Computer 2:

iperf -c <other-computer-ip-or-hostname>

https://superuser.com/questions/1275043/measure-bandwidth-between-two-computer-in-a-lan

IPTables

List current policies

iptables -L -v

Set accept rule:

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

delete rules

iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD

delete all rules

iptables -F

External Resources