Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DHCP overwrites Cisco VPN resolv.conf on Linux

Tags:

linux

cisco

vpn

I'm using an Ubuntu 8.04 (x86_64) machine to connect to my employer's Cisco VPN. (The client didn't compile out of the box, but I found patches to update the client to compile on kernels released in the last two years.) This all works great, until my DHCP client decides to renew its lease and updates /etc/resolv.conf, replacing the VPN-specific name servers with my general network servers.

Is there a good way to prevent my DHCP client from updating /etc/resolv.conf while my VPN is active?

like image 684
Commodore Jaeger Avatar asked Jan 24 '23 03:01

Commodore Jaeger


1 Answers

If you are running without NetworkManager handling the connections, use the resolvconf package to act as an intermediary to programs tweaking /etc/resolv.conf: sudo apt-get install resolvconf

If you are using NetworkManager it will handle this for you, so get rid of the resolvconf package: sudo apt-get remove resolvconf

I found out about this when setting up vpnc on Ubuntu last week. A search for vpn resolv.conf on ubuntuforums.org has 250 results, many of which are very related!

like image 164
Sean Avatar answered Feb 08 '23 22:02

Sean