Setting up a temporary IP Address – Ubuntu
To set ip temporarily
using ifconfig and route commands
1. Run the
command below to set ip and netmask
$ sudo ifconfig eth0 10.20.1.10 netmask 255.255.255.0 up
where
eth0 is the name of the interface, 255.255.255.0 is the netmask and up
to activate the interface
2. run route command to set default
gateway
$ sudo route add default
gw 10.20.1.1
where 10.20.1.1 is your gateway ip
3. You
can check the configuration that you have setup using commands route -n to see the gateway and ifconfig to see the ip address
Done.