Network

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

 

Utils

hostname

ping
traceroute

dig
nmap

netstat
netstat -i
netstat -tulpen

Show IP

hostname -i
ifconfig
cat /etc/sysconfig/network-scripts/ifcfg-enoX
nmcli connection show
mncli con add con-name testing ifname ens33 type ethernet ip4 10.0.0.15/24
nmtui

ifconfig -a          Solaris

Phys. network stat

ip -s link

Connection status

Ip a

Set IP parameters, RedHat/ CentOS

vi /etc/sysconfig/network-scripts/ifcfg-ethX

ONBOOT=yes
IPADDR=172.22.77.100
PREFIX=24
GATEWAY=172.22.77.1
DNS1=192.168.1.200
DNS2=172.133.0.200
DOMAIN=localdomain.com

nmtui

service network restart
/etc/init.d/network restart
systemctl restart NetworkManager

Set IP parameters, Gentoo

vi /etc/conf.d/net

ifdown ifcfg-eno2
ifup ifcfg-eno2

config_enp2s0="172.22.77.213/24"
routes_enp2s0="default via 172.22.77.1"
dns_servers_enp2s0="192.168.1.200 172.133.0.200"

/etc/init.d/net.enp2s0 stop
/etc/init.d/net.enp2s0 start

route add -net 212.71.205.0 netmask 255.255.255.0 gw 10.15.15.1

telnet 212.71.205.162 3290

Remove default route

vi /etc/sysconfig/network

NOZEROCONF=yes

removes route -n 169.254.0.0  0.0.0.0  255.255.0.0  U  0   0   0 eth1 

Set DNS

vi /etc/resolv.conf
# domain localdomain.com
search localdomain.com
nameserver 192.168.1.200
nameserver 172.133.0.200

Disable IP v6

vi /etc/sysctl.conf
Add: net.ipv6.conf.all.disable_ipv6 = 1
Run: sysctl -p
nmcli conn down ens33; nmcli conn up ens33

Packet capture

tcpdump -i eth0 -c 5 host 192.168.159.128

Newsletter

Enter your email to join our mailing list

Quick Contact