forked from webmentordev/linux-bash-scripts-and-solutions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetup Local Static IP Address.txt
More file actions
37 lines (28 loc) · 973 Bytes
/
Setup Local Static IP Address.txt
File metadata and controls
37 lines (28 loc) · 973 Bytes
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
Check Your IP address with following commands
$ ip link
$ ip address
$ ip a
$ sudo nano /etc/network/interfaces
===============================================================
enp0s3 is Ethernet interface. Your's can be different.
Skip Loopback network interface.
===============================================================
Replace the following
auto enp0s3
iface enp0s3 inet dhcp ----> to -----> iface enp0s3 inet static
add address that you want
add netmask must be same as following
add gateway is your router login
add dns-nameservers same as following
===============================================================
auto enp0s3
iface enp0s3 inet static
address 192.168.2.2
netmask 255.255.255.0
gateway 192.168.2.2
dns-nameservers 8.8.4.4 8.8.8.8
=======Replace nameserver with what you have in upperfile=======
nano /etc/resolv.conf
nameserver 8.8.4.4 8.8.8.8
$ sudo systemctl restart NetworkManager.service
(If upper command doesn't work. Reboot system)