IP Utility

From lathama
Jump to: navigation, search

The command for managing networking called ip as of 2018 packaged as iproute2 is interesting and here are some examples. In these examples enp0s25 is an example interface.

Show addresses
ip a
Show interfaces
ip l
Show neighbors aka ARP table
ip n
Turn an interface up
ip link set enp0s25 up
Turn an interface down
ip link set enp0s25 down
Add a temporary IP address to an interface
ip a add dev enp0s25
Delete an IP address on an interface
p addr del dev enp0s25
Add secondary or alias interface
ip addr add dev enp0s25 label enp0s25:2
Discover how a packet would be routed
ip route get
Setup a bridge
ip link add name super_bridge type bridge
ip link set super_bridge up
Add interface to bridge
ip link set enp0s25 master super_bridge
List bridges
bridge l
Delete interface from bridge
ip link set enp0s25 nomaster
Delete a bridge
ip link delete super_bridge type bridge
Add default route
ip route add default via
Show open or listening ports
ss -ltu

Shared network via Debian and NetworkManager

  1. Selecting the wired network on a system using wireless for Internet connection you can set the shared attribute in the IPv4 tab.
  2. On the client system you can manually set an IP, route, and resolvers to use the Internet.
Client Example
ip r add dev enp0s25
ip r add default via
echo "nameserver" >> /etc/resolv.conf


Sponsorship and Advertising space here. Please contact me if interested.