Configure static IP
# /etc/network/interfaces auto eth0 iface eth0 inet static address 10.10.0.12 netmask 255.255.255.0 # network 192.168.0.0 # broadcast 192.168.1.255 gateway 10.10.0.1 #dns-nameserver 8.8.8.8 dns-nameservers 10.10.1.253 10.10.1.254 dns-search example.com dns-domain example.com up route add -net 10.20.0.0 netmask 255.255.0.0 gw 10.10.1.1
Configure by DHCP IP
auto eth0 iface eth0 inet dhcp
Configure manual
auto eno1 iface eno1 inet manual bond-master bond0 # Example /etc/network/interfaces auto lo iface lo inet loopback # device: eth0 auto eth0 iface eth0 inet static address 178.63.46.216 broadcast 178.63.46.255 netmask 255.255.255.192 gateway 178.63.46.213 # default route to access subnet up route add -net 178.63.46.192 netmask 255.255.255.192 gw 178.63.46.213 eth0 post-up /sbin/route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1 auto eth0:1 allow-hotplug eth0:1 iface eth0:1 inet static address 192.168.1.44/24 #new http://panticz.de/nmap-ip-and-portscan
Network namespaces
https://matthewarcus.wordpress.com/2018/02/04/veth-devices-network-namespaces-and-open-vswitch/
Bond
cat /sys/class/net/storage/bonding/miimon # get hardware mac address of interfaces hwinfo --network | egrep "Permanent HW Address|SysFS ID" | egrep -A1 "eth" | paste - - | sort | column -t # get bond interfaces lldpctl | egrep "Interface|SysName|PortID" | awk -F ' *: *' '{print $2}' | awk -F ',' '{print $1}' | paste - - - | egrep "^e" | awk '{print "'"$NODE"'",$1,$2,$4}' | column -t | sort -u -k 1,2 # get hardware interface id cat /proc/net/bonding/* | egrep "Interface|HW" | cut -d":" -f"2-" | paste - - | column -t | sort
ethtool -s eth0 msglvl 0
tcpdump
https://danielmiessler.com/study/tcpdump/
tcpdump -i eth1 -pn port 67 and port 68
ipcalc
sudo apt install -y ipcalc ipcalc 192.168.200.20/24
Links
# Bandwidth calculator
http://web.forret.com/tools/bandwidth.asp?speed=1000&unit=bps
# Subnet Calculator
http://www.davidc.net/sites/default/subnets/subnets.html