Info
Content

Temporary IP address in Linux


IP Address:
Via 'ifconfig' (now deprecated on most modern distributions)

ifconfig <interface> <ip address> netmask <netmask> up
Example:
ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

Via 'ip'

ip addr add <ip address>/<prefix> dev <interface>
Example:
ip addr add 192.168.1.1/24 dev eth0

Gateway:

route add default gw <gateway ip address>
Example:
route add default gw 192.168.1.254

Nameservers:
Edit the /etc/resolv.conf via your favourite text editor

nano /etc/resolv.conf

Ensure it is set up as follows (or similar)

nameserver 77.247.176.114
nameserver 77.247.176.115
nameserver 85.159.238.17
No Comments
Back to top