-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathManage_Networking
More file actions
156 lines (101 loc) · 3.7 KB
/
Copy pathManage_Networking
File metadata and controls
156 lines (101 loc) · 3.7 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
Managing Networking
Types of Address
- Physical Address
- Logical Address
#Logical Address Type:
IPV4 -- Internet Protocol Version4
IPV6 -- Internet Protocol Version6
#Length Bits
IPV4 -- 32 Bits
IPV6 -- 128 Bits
#Octet
IPV4 -- X.X.X.X
IPV6 -- X:X:X:X::X:X:X:X
-----------------------------------------------------------------------------
IPV4 Range (Class) :-
Class A -- 0-126 (Wide Range)
Class B -- 128-191
Class C -- 192-223
Class D -- 224-239 (Multi-Casting)
Class E -- 240-255 (Research & Development)
127.0.0.0 -- Loopback (Used for NIC)
---------------------------------------------------------------------------
Octet
We get Network and Host ID in Octet.These ID are represent by Binary Number.
Network ID Host ID
(1) (0)
Class A -- N H H H
Class B -- N N H H
Class C -- N N N H
Netmask-- A netmask is a 32-bit number that separates an IP address into a network address and a host address.
Class A -- N H H H
255.0.0.0 -/8(SubnetMask)
Class B -- N N H H
255.255.0.0 -/16(SubnetMask)
Class C -- N N N H
255.255.255.0 -/24(SubnetMask)
SubnetMask - A subnet mask is a 32-bit number used in IP addressing to separate an IP address into its network and host portions. It.
-----------------------------------------------------------------------------
Private vs Public IP
Private IP is Static IP.
Public IP is for global use.
-----------------------------------------------------------------------------
Domain Name Server (DNS)
Used to resolve a website/domain name to IP.
DNS= Resolve the Domain Name.
GATEWAY
A gateway is a network node that acts as an entry and exit point for data between two different networks that use different protocols.
INTERFACE
Definition of interface | PCMagAn interface is a point of interaction or a shared boundary where two separate systems, devices, or people can exchange information.
Example:
ens160
---------------------------------------------------------------------------
Networking Model
TCP/IP Model
- Application
- Transport
- Internet
- Physical
--------------------------------------------------------------------------
nmcli ------ Network Manage Command Line Interface
nmtui --- Network Manage Text User Interface
Use nmcli as it is mostly use in production enviroment.
Impt file:
etc/resolv.conf -- DNS info
#########################
Commands to show IP
ipconfig
ip a s
hostname -i
#########################
route -n
ip linkshow -- to show Interface
Impt Note-- You can make more than one connection, but you can activate one connection at a time.
##########################
Example:
Add connection to ethernet:
nmcli connection add con-name private type ethernet ifname ens160 ipv4.method auto
###########################
For manual connection you need basic information first.
ip -- 10.10.10.20
Subnet -- 255.0.0.0
Gateway -- 10.10.10.2
DNS -- 8.8.8.8
To proceed
nmcli connection add con-name public type ethernet ifname ens160 ipv4.method manual ipv4.addresses 10.10.10.20/8 ipv4.gateway 10.10.10.2 ipv4.dns 8.8.8.8
This would successfully add the manual connection with above mentioned inputs.
------------------------------------------------------------------------------------
Test on your own
IP : 172.16.11.219
Subnet: 255.255.0.0
Gateway:172.16.11.1
DNS: 4.4.4.4
-------------------------------------------------
COntains the current connection file and information.
/etc/NetworkManager/system-connections/
--------------------------------------------------
nmtui -- text based.
-------------------------------------------------
##How to change the host name
hostnamectl set-hostname classroom.example.com //this command will change the hostname to classroom.example.com
You can also use nmtui to change the hostname of a machine