From: Alex <alex@zengers.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] VPN vs LAN address hostname resolution
Date: Wed, 22 May 2013 22:52:18 +0200 [thread overview]
Message-ID: <20130522205218.GA1643@zengers.de> (raw)
In-Reply-To: <519D1E02.1080001@gmail.com>
Hi,
On Wed, May 22, 2013 at 09:35:30PM +0200, Samuraiii wrote:
> Script was just checking (by sftp with public ssh keys for unprivileged
> account) if LAN (eth or wifi) address is up and if not it just assigned
> address to hostname from vpn range (it did not accounted if machine is
> up or down). And the just write new /etc/hosts.
>
I'm using something similar but more sophisticated. On my machines I have
two hosts files, one for vpn, one for lan. Everytime I activate vpn on my
machine, a symlink to the "vpn" hosts is created. Upon deactivation of my vpn
the symlink points to the "normal" hosts. It looks like this:
lrwxrwxrwx 1 root root 17 Feb 3 23:24 /etc/hosts -> /etc/hosts.normal
-rw-r--r-- 1 root root 1354 Feb 19 04:49 /etc/hosts.normal
-rw-r--r-- 1 root root 1420 Feb 3 16:09 /etc/hosts.vpn
I use OpenVPN for my vpn, which calls the scripts up.sh and down.sh during
de/activation. I simply put a appropriate "ln" command at the end of these scripts.
Sure not the best solution, but if you only have a few machines it is good
and simple enough.
--
regards
alex
next prev parent reply other threads:[~2013-05-22 20:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 16:36 [gentoo-user] VPN vs LAN address hostname resolution Samuraiii
2013-05-22 17:36 ` Michael Orlitzky
2013-05-22 17:52 ` Michael Mol
2013-05-22 18:30 ` Samuraiii
2013-05-22 18:40 ` Michael Mol
2013-05-22 18:52 ` Michael Orlitzky
2013-05-22 19:35 ` Samuraiii
2013-05-22 19:44 ` Michael Orlitzky
2013-05-22 20:52 ` Alex [this message]
2013-05-22 22:32 ` William Kenworthy
2013-05-22 20:43 ` covici
2013-05-22 20:40 ` covici
2013-05-31 16:04 ` [gentoo-user] " Samuraiii
2013-05-31 16:32 ` Samuraiii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130522205218.GA1643@zengers.de \
--to=alex@zengers.de \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox