Repository navigation
Expand file tree
/
Copy pathNetworking
More file actions
124 lines (113 loc) · 7.62 KB
/
Copy pathNetworking
File metadata and controls
124 lines (113 loc) · 7.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Concept: Basic Network Terminology
Description: Concepts of networking, including LANs, WANs, routers, firewalls, NAT, MAC
and IP addresses, TCP/UDP, and network interface types.
Purpose: To provide foundational understanding of network components, addressing, protocols,
and how devices communicate in Linux environments.
Linux commands:
ifconfig : Displays network interfaces, their IP addresses, netmask, and MAC addresses.
Helps identify active connections and interface configurations.
ping <host> : Sends ICMP packets to test connectivity with another host.
route : Shows routing table, including default gateway for traffic leaving the LAN.
route -n : Displays routing table numerically, useful for troubleshooting without DNS resolution.
Additional Info:
-MAC addresses are 48-bit hardware identifiers for network cards.
-IPv4 addresses are 32-bit numeric addresses, IPv6 addresses are 128-bit hexadecimal.
-Netmask defines network vs host portion of an IP address; /24 corresponds to 255.255.255.0.
-TCP provides reliable communication with acknowledgments, UDP is connectionless and faster but unreliable.
-Linux network interface naming: Ethernet often eth0, WiFi wlan0.
-Each interface requires: IP address, subnet mask, default gateway, and DNS server
----------------------------------------------------------------------------------------------------------------------
Concept: Identifying Network Devices
Description: Demonstrates how to detect network devices and inspect their configurations from the Linux command line.
Purpose: To identify available network interfaces, examine IP/MAC addresses, and verify routing and DNS configuration.
Linux commands:
lspci : Lists PCI devices detected by the kernel; Ethernet controllers indicate network adapters.
ifconfig : Displays all interfaces. Use ifconfig <interface> to show details of a specific interface.
route : Shows default and static routes in the routing table.
route -n : Shows numeric routing table without resolving hostnames.
cat /etc/resolv.conf : Displays configured DNS servers and domain search paths.
# Generated by NetworkManager
search silversides.local
nameserver 192.186.1.1
ping silversides.local : Verifies connectivity using hostname; tests DNS resolution.
Additional Info:
-Loopback interface (lo) is used for testing local TCP/IP connectivity.
-IPv6 addresses may be present alongside IPv4 on an interface.
-Default gateway is needed for traffic leaving the local subnet.
-DNS resolves human-friendly names to IP addresses.
----------------------------------------------------------------------------------------------------------------------
Concept: Configuring Network Devices Using Gnome Desktop
Description: Walkthrough of configuring network interfaces in the Gnome GUI, including IPv4/IPv6,
netmask, gateway, and DNS settings.
Purpose: To show graphical configuration methods for Linux networks and demonstrate manual IP assignment.
Linux commands:
No shell commands used in GUI; settings changes affect underlying system configuration files
(/etc/sysconfig/network-scripts/ifcfg-*).
Additional Info:
-IPv4 netmask 255.255.255.0 indicates first three octets define the network.
-IPv6 addresses use 128 bits with hexadecimal representation and :: for zero compression.
-Turning the interface off and back on applies new settings.
-DNS servers resolve hostnames to IP addresses; required for Internet access.
----------------------------------------------------------------------------------------------------------------------
Concept: Configuring Network Parameters for a Host
Description: Shows how to configure hostname, interface state, and DNS from the Linux command line.
Purpose: To manage network connectivity and system identity through CLI commands.
Linux commands:
ifconfig <interface> : Displays or configures IP addresses for a specific interface.
hostname : Shows current hostname; hostname <newname> sets a new hostname.
cat /etc/resolv.conf : Displays DNS server configuration.
ping <hostname> : Tests name resolution and connectivity.
ifconfig <interface> down : Disables a network interface.
ifconfig <interface> up : Re-enables a network interface.
Additional Info:
-Bringing an interface down is useful for maintenance or configuration changes.
-DNS entries in /etc/resolv.conf must be correct for hostname resolution.
-Proper hostnames aid in network identification and administrative tasks.
----------------------------------------------------------------------------------------------------------------------
Concept: Configuring Networking from the Shell
Description: Demonstrates manual network configuration by editing files and using CLI commands, including static IP, routing, and hosts file.
Purpose: To configure and maintain network settings without GUI tools, ensuring full control over IP, routes, and DNS.
Linux commands:
ifconfig : Displays or assigns IP addresses to network interfaces.
ls /etc/sysconfig/network-scripts : Lists network configuration files.
cat /etc/sysconfig/network-scripts/ifcfg-<interface> : Displays interface configuration file.
vi /etc/sysconfig/network-scripts/ifcfg-<interface> : Edits interface configuration for IP, gateway, or DNS changes.
systemctl restart network : Applies configuration changes.
cat /etc/hosts : Maps hostnames to IP addresses locally.
route / route -n : Shows routing table; route add -net <network> netmask <mask> gw <gateway> dev <interface> adds routes.
ping <hostname> : Tests connectivity and DNS resolution.
Additional Info:
Hosts file entries take priority over DNS.
Routing table entries determine path for traffic outside LAN.
Changes in /etc/sysconfig/network-scripts/ifcfg-* persist across reboots.
----------------------------------------------------------------------------------------------------------------------
Concept: Configuring Network Time
Description: Demonstrates how to synchronize system time using NTP and configure a persistent NTP daemon.
Purpose: To ensure accurate time across all systems in an enterprise environment.
Linux commands:
cat /etc/services | grep ntp : Checks NTP port usage (UDP 123).
ntpdate <server> : Performs a one-time time synchronization.
cat /etc/ntp.conf : Shows NTP daemon configuration.
service ntpd start : Starts the NTP daemon.
service ntpd status : Checks status of the NTP daemon.
systemctl enable ntpd.service : Ensures daemon starts at boot.
ntpq : Interactive tool to query NTP daemon.
ntpq -pn : Displays numeric status of time sources, including offsets in milliseconds.Additional Info:
Leftmost * in ntpq output indicates current time source.
Offset column shows time difference between local and remote source.
ntp provides fault-tolerant, continuous synchronization in enterprise networks.
----------------------------------------------------------------------------------------------------------------------
Concept: Troubleshooting Common Network Issues
Description: Shows step-by-step troubleshooting of connectivity problems, including checking interfaces, DNS, and routing.
Purpose: To diagnose and fix network connectivity failures using command-line tools.
Linux commands:
ifconfig : Verifies interface IP address and netmask.
ping <host> : Tests connectivity and DNS resolution.
route -n : Displays numeric routing table; verifies default gateway.
route del default : Deletes incorrect default route.
route add default gw <gateway> dev <interface> : Adds correct default route.
ip route : Alternative to route for verifying routing.
Additional Info:
Default gateway must be in the same subnet as host interface.
Correct DNS configuration ensures hostname resolution.
Troubleshooting often involves isolating misconfigured routes, incorrect IP addresses, or offline interfaces.