How to Change IP Address on Linux (Terminal Commands)

preview_player
Показать описание
Tutorial shows you, how to change IP address on Linux using terminal commands (set a static IP in Linux), Set IP address, Default Gateway and DNS server manually and get an IP address from DHCP server

Find IP address Linux:
The “ifconfig” command is used for displaying current network configuration information.

Find default gateway Linux:
The “route” command is used for displaying default Gateway.

Find DNS server IP Linux:

Setting your IP manually

To assign an IP address on a Linux, you need to use following commands, example:

Command to change IP address:
“sudo ifconfig eth0 192.168.1.112/24”

Command to add default gateway:
“sudo route add default gw 192.168.1.1”

Command to add DNS server IP:

Note for DNS command: If you are not login as a root you may get Error :
So, first type “sudo su” command and then type DNS command.

In order to get an IP from a DHCP server, example:

First type "sudo dhclient -r eth0" to release your IP address.

Then type "sudo dhclient eth0" to renew it.

Subscribe To My Channel and Get More Great Tips:

Share this Video:

Other videos:

How to Change IP Address on Android Tablet - step by step tutorial

How to change ip address on windows 8 computer

How to change ip address on windows 7 computer

How to Change IP Address Easily Using Batch File Script
Рекомендации по теме
Комментарии
Автор

Good video, how about changing it temporarily?

robertanton
Автор

thanks it solve my kali linux to connect to internet

zatus
Автор

when I pinging give me error temporary failure in name resolution

ferdowsjamal
Автор

When i type ifconfig it gives me command not found

lisalovelycat
Автор

when i type in ifconfig my ip address has the form 10.x.x.x how do i change it to 192.xxx.xxx.xxx

sebastianmoustakas
Автор

Damn, I did everything you said and it didn't work! :(

uwuster
Автор

SIR, can i set my public ip inplace of my eth0: inet address?

getgoingwithdeepak