04 Networking

TCP/IP

Classful networks

Subnet mask

TCPIP

 

TCP  estabilish and maintain the internet conversation

IP is responsible for sending data from one devices to another device on the network

 

Address Classes

classful network

 

subnet mask

subnet mask

 

 

broadcast address

 

cidr

 

 

etc/ nsswitch

etc nsswitch

 

Ports 1- 1023 are well-known ports.

etc services

DHCP

DHCP

 

Configuring DHCP Client -RHEL

ifconfig -a  or ip link

/etc/sysconfig/network-scripts/ifcfg-DEVICE

/etc/sysconfig/network-scripts/ifcfg-eth0

/etc/sysconfig/network-scripts/ifcfg-enp5s2

BOOTPROTO = dhcp

 

Configuring DHCP Client – UBUNTU

/etc/network/interfaces

auto eth0

iface eth0 inet dhcp

 

Assigning a Static IP Address – RHEL

/etc/sysconfig/network-scripts/ifcfg-eth0

Assigning a Static IP Address - RHEL

 

Assigning a Static IP Address – UBUNTU

/etc/network/interfaces

auto eth0

iface eth0 inet static

Assigning a Static IP Address - UBUNTU

 

Manually Assigning an IP Address

ip address and IP [/NETWORK] DEV network_device

 

ip address add 10.11.12.13 dev eth0

ip address add 10.11.12.13/255.255.255.0  dev eth0

ip link set eth0 up

 

ifconfig NETWOR_DEVICE addr netmask SUBNET_MASK

 

ifconfig eth0 10.11.12.13

ifconfig eth0 10.11.12.13 netmask 255.255.255.0

ifconfig eth0 up

 

 

ifup /ifdown

ifup ifdown

 

GUI / TUI tools

nmtui, system-config-network, YaST

 

ping

ping HOST

ping -c COUNT HOST

 

traceroute / tracepath

tracerouter -n HOST

send 3 packets to each hop along the way, and you can see the response for each host

traceroute

tracepath

tracepath -n google.com

tracepath

 

netstat

netstat command

 

netstat

 

tcpdump

packet sniffing tcpdump

 

sudo tcpdump

telnet

telnet HOST_OR_IP  PORT_NUMBER

telnet