Re: Using different hostnames on different interfaces (with dhclient)



On Mon, 2012-01-23 at 21:55 +0200, Stefan Puiu wrote:
> Hi,
> 
> I've asked this on the Ubuntu forums without any success
> (http://ubuntuforums.org/showthread.php?t=1913550), so I'm trying my
> luck here.
> 
> I'm using Ubuntu 11.04 at work and I have 2 NICs, each connected to a
> separate subnet. Only one of the subnets is accessible when I VPN to
> work, so I thought it would be cool to be able to use different
> hostnames for each interface. I tried the following in
> /etc/dhcp/dhclient.conf:
> 
> interface "eth4" {
>    send host-name "host2";
> }
> 
> interface "eth5" {
>    send host-name "host1";
> }

At the moment NM allows the dhclient hostname to be specified in two
ways:

1) via the NM connection configuration
2) via an interface-specific dhclient config file
like /etc/dhcp/dhclient-<iface>.conf

So we could add support for the combined dhclient I suppose, making sure
to only use stuff for the right interface.  It's just not implemented at
this time.  If you split the config out into separate per-interface
config files in the same location, it should work.

Dan

> However, I still get host1.<domain> assigned randomly to either IP
> address (I'm checking what IP the FQDN resolves to in DNS). However, I
> still get host1 assigned alternatively to eth4 or eth5. In
> /var/run/nm-dhclient-eth4.conf, it seems NetworkManager decided on his
> own account to "make some changes":
> 
> interface "eth4" {
> }
> interface "eth5" {
> }
> send host-name "host1"; # added by NetworkManager
> 
> And then in nm-dhclient-eth5.conf:
> 
> interface "eth4" {
> send host-name "host2";
> }
> interface "eth5" {
> send host-name "host1";
> }
> 
> What would be the proper way to achieve this?
> 
> Thanks,
> Stefan.
> _______________________________________________
> networkmanager-list mailing list
> networkmanager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]