The following will work for any debian base linux distro. That includes Ubuntu, Kali, Raspberry Pi (Raspian Jessie), TAILS, and many more.
Edit Interface Settings
Edit the config:
|
Find the interface you wish to make static and add the following lines:
|
address
is the IP you want to assign this hostnetwork
is the network portion of this subnet. It’s usually the same as your static IP but ending in.0
netmask
is the netmask of your subnet. This is usually255.255.255.255
broadcast
is the broadcast IP of this subnet. It’s usually the same as your static IP but ending in.255
gateway
is the next hop for this system to go. This is usually a router’s IP and it must be in the same subnet as the host address.
Configure DNS
To resolve hostnames to IP addresses you must configure a DNS server. You can do this by editing the following:
|
Add your DNS servers to this file or use Google’s public DNS servers like this:
|
Restart networking
To make these change effective you must restart the networking service. That can be done by doing one of the following:
|
If that doesn’t work try:
|
If that doesn’t work try:
|
Check settings
Now check if the settings took by running the following command:
|
The output looks like this:
|
Comments