I've got a laptop that I use for work and sometimes use it in the office and sometimes from home.

Whilst i'm in the office I want to connect to the office network which has 3 shared drives on it. I've set these up using fstab and when I do mount -a they mount fine and I can access them. However, when accessing the internet in the office I am only allowed access using an IP address which the server administrator has allowed. Apparently for Windows users he usually uses Internet Explorer to set a certificate on the users computer, however this isn't possible in linux, therefore that's the reason he has allowed a specific IP.

Therefore, what I want to do is when I log on to Ubuntu in the office, it automatically sets my IP to the set IP, therefore the internet will work and the drives will be mounted automatically.

Obviously when I am at home I won't be able to access the drives but that is fine.

So far I tried amending /etc/network/interfaces. Originally it was the following:

Code:
auto lo
iface lo inet loopback
So I changed it to the below which I found online:

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.47.567
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 192.168.1.1
(IP address above is made up for this purpose)

The /etc/resolv.conf currently looks like the following:

Code:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search businessname.local
Can someone please help me set a static IP of 192.168.47.567 for when I'm in the office?

Thanks