0% found this document useful (0 votes)
11 views15 pages

Network Management.

Network management
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views15 pages

Network Management.

Network management
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Network Management

Compiled by Amritanshu

June 12, 2025


Contents

Understanding IP Addresses 2

MAC Address 4

Socket Programming 5

Practical Networking Commands & Modes 6

Advanced nmcli Networking Commands & Concepts 9

Hostname, Name Resolution & IPv6 Configuration 12

Extra Tools and Resources 14

1
Understanding IP Addresses

IP Address Basics
• IP Address uniquely identifies a device on a network.

• IPv4: 32-bit, 4 octets (e.g., 192.168.0.1).

• Each octet: 0–255. IPv4 supports 232 addresses.

• IPv6: 128-bit, supports 2128 addresses.

IP Classes
• Class A: 0 - 126

• Class B: 128 - 191

• Class C: 192 - 223

• Class D: 224 - 239 (Multicasting)

• Class E: 240 - 254 (Research)

• 127.x.x.x: Loopback (e.g., 127.0.0.1)

Types of IP Addresses
• Public IP

– Static: Fixed, less secure.


– Dynamic: Changes per session.

• Private IP

– Assigned via DHCP (e.g., 192.168.1.x)

• Dedicated IP

– Purchased by organizations.

2
Computer Networks Network Management

Subnetting and Subnet Mask


• Subnetting divides large networks into smaller segments.

• Subnet Mask (e.g., 255.255.255.0): identifies network/host portions.

Visual Block: IP Address Breakdown


192.168.0.1 Network = 192.168.0, Host = 1

Amritanshu’s Notes Page 3


MAC Address

MAC Address Details


• MAC: Media Access Control address.

• 48-bit hardware address (e.g., A2:C1:39:42:51:61).

• Hardcoded into NIC, hex format.

• Example OUI: CC:46:D6 (Cisco)

Protocols Related to MAC


• ARP: Resolves IP to MAC.

• MAC Spoofing:

– Linux: macspoof
– Windows: Tictanium

Visual Block: ARP Mechanism


IP Address MAC Address
192.168.0.10 A2:C1:39:42:51:61

4
Socket Programming

What is a Socket?
• Socket = IP Address + Port Number.

• Enables communication between two devices.

• Example: 192.168.1.255:1234

• Used in client-server model.

Working of Socket
1. Server creates and listens on socket.

2. Client connects to the server.

3. Communication begins.

Types of Sockets
• Datagram (UDP) – Connectionless.

• Stream (TCP) – Connection-based.

Visual Block: Socket Representation

Device IP Address Port


Client 192.168.1.20 5000
Server 192.168.1.255 1234

5
Practical Networking Commands &
Modes

NIC Information Commands


• View all available NICs: ip link show

• Detailed info of a NIC: ip addr show <NIC NAME> (e.g., ip addr show
ens160)

• Details of all NICs: ip addr

• Status Keywords:

– UP: Interface is active.


– link/ether: MAC Address.
– inet: IPv4 address with subnet mask.

• View performance/statistics: ip -s link show ens160

Ping Routing Commands


• Check connectivity: ping 192.168.1.1

• Send specific number of packets: ping -c 4 192.168.1.6

• Ping IPv6 address: ping6 <IPv6 address>

• Note: If IPv6 is not active, it will show packet loss.

• Routing information: ip route

• See data path: traceroute google.com

• Legacy NIC config tool: ifconfig

• DHCP: Automatically assigns IP addresses.

6
Computer Networks Network Management

Networking Modes Overview


1. Host-Only Mode

• VM ↔ Host: Communicate

• VM ↔ VM: Communicate

• VM ↔ LAN/NET: No Communication

2. Internal Mode

• VM ↔ Host: No Communication

• VM ↔ VM: Communicate

• VM ↔ LAN/NET: No Communication

3. Bridged Mode

• VM ↔ Host: Communicate

• VM ↔ VM: Communicate

• VM ↔ LAN/NET: Communicate

4. NAT Mode

• VM → Host: Communicate

• Host → VM: Port forwarding needed

• VM ↔ VM: No Communication

• VM ↔ LAN/NET: Port forwarding needed

NIC Connection Details (nmcli)

• View NIC status: nmcli dev status or nmcli device status

• NIC configuration file location (RHEL 7/8):


/etc/sysconfig/network-scripts/

• Newer location: /etc/NetworkManager/system-connections/

• Detailed NIC info: nmcli device show or nmcli dev show

• View all connections: nmcli con show or nmcli connection show

• Show active connections: nmcli con show -a or nmcli connection


show -a

Amritanshu’s Notes Page 7


Computer Networks Network Management

Additional Tips
• To add a new NIC to a VM: Go to VM Settings → Network → Add
Adapter

Amritanshu’s Notes Page 8


Advanced nmcli Networking
Commands & Concepts

Basic Connection Control


• Bring up a connection:

– nmcli con up ens161


– ifup amrit

• Bring down a connection: nmcli con down ens161

• Create a new connection:


nmcli con add type ethernet con-name met1 ifname ens161

• Check assigned IP: ip addr

• IP is assigned via DHCP.

Configuration File Location & Testing


• Check if connection config files exist:

– cd /etc/NetworkManager/system-connections
– ls

• Verify connection using ping: ping <new ip>

• Disable autoconnect at boot:


nmcli con mod amrit connection.autoconnect no

• Enable autoconnect at boot:


nmcli con mod amrit connection.autoconnect yes

9
Computer Networks Network Management

Permissions & Static IP Setup


• Set user permission on a connection:
nmcli con mod amrit connection.permission user:amrit

• Reload all connections: nmcli con reload

• Create connection with static IP:

– nmcli con add type ethernet con-name amrit ifname ens224


ipv4.address 192.168.145.134/24 ipv4.dns 8.8.8.8 gw4
192.168.145.1 ipv4.method manual
– Gateway = gw4, DNS = 8.8.8.8

• Check if connection was created:

– nmcli dev status


– cd /etc/NetworkManager/system-connections

• Bring connection up: nmcli con up amrit1

• Verify using ping: ping 192.168.205.136

Multiple IP Addresses on NIC


• Add another IP to NIC:
nmcli con mod amrit1 +ipv4.addresses 192.168.1.100/24 +ipv4.dns
8.8.4.4

• Reload configuration: nmcli con reload

• Restart NetworkManager: systemctl restart NetworkManager

• Verify multiple IPs: ip addr

• Ping new IP to verify: ping <new ip>

• Remove an additional IP:


nmcli con modify amrit1 -ipv4.addresses 192.168.205.150/24

• Restart services and reconnect:

– systemctl restart NetworkManager


– nmcli con reload
– nmcli con down amrit1
– nmcli con up amrit1

Amritanshu’s Notes Page 10


Computer Networks Network Management

Ports and Socket Information


• List of well-defined ports: cd /etc/services

• Socket statistics: ss

• View TCP ports only: ss -ta

Amritanshu’s Notes Page 11


Hostname, Name Resolution & IPv6
Configuration

Hostname Configuration
• Check current hostname: hostname

• View static hostname configuration: cat /etc/hostname

• Set static hostname: hostnamectl set-hostname server

• Verify hostname change: hostname

• Full hostname details: hostnamectl status

• Pre-RHEL 6 hostname file: /etc/sysconfig/network

Name Resolution Process


• Stub Resolver: Converts hostname to IP (forward) and IP to hostname
(reverse).

• Configuration File: cat /etc/nsswitch.conf

• Host Mapping File: cat /etc/hosts

• DNS Resolver Configuration: cat /etc/resolv.conf

12
Computer Networks Network Management

Static IPv6 Address Configuration


• Step 1: Create connection

– nmcli con add type ethernet con-name amritanshu ifname


ens264

• Step 2: Assign IPv6 address manually

– nmcli con mod amritanshu ipv6.address


’fddb:fe2a:ad1e::c0a8:8/64’ ipv6.method manual

• Step 3: Verify entry in config files

– cd /etc/NetworkManager/system-connections
– cat amritanshu.nmconnection

• Step 4: Apply and reload settings

– systemctl restart NetworkManager


– nmcli con reload
– ifconfig

Amritanshu’s Notes Page 13


Extra Tools and Resources

Networking Utilities Tools

• WHOIS/ARIN: Lookup IP ownership.

• CIDR: Efficient IP allocation.

• ARP Cache Table: Stores recent IP-MAC mappings.

• Ping, Traceroute, Netstat: CLI troubleshooting.

• Nmap: Port scanning auditing.

End of Notes – Compiled by Amritanshu

14

You might also like