Re: Interface sequencing

2014-11-05 Thread Stuart Henderson
On 2014-11-04, trondd tro...@gmail.com wrote:
 Doesn't the default route go to the egress interface?

No, it's the other way round.



Re: Interface sequencing

2014-11-05 Thread Stuart Henderson
On 2014-11-04, Jason Adams adams...@gmail.com wrote:
 On 11/04/2014 11:52 AM, Ted Unangst wrote:
 On Tue, Nov 04, 2014 at 11:21, Jason Adams wrote:

 So can anyone point me to the settings where the sequence of bringing up
 interfaces is controlled at
 boot time?  Or am I just going to have to set default gateway after it is
 booted by something in
 rc.local?
 /etc/netstart executes hostname.* which will be in alphabetical, then
 numerical, order. echo /etc/hostname.* will show you the order if you
 want to check it.

 Yes, well that's the problem.  I need them brought up in non-alphabetical 
 order.

That will probably only work temporarily (if at all), I think the lease will
expire and get refreshed.

 But Jan Vlach sent me a message (not via list) that I might be able to add
 a ignore routers  option to the hostname.if file that I do not
 want as a gateway.

That needs to go in a dhclient config file, you'll need different config
files for each interface and run dhclient from a hostname.if line like
!dhclient -c /etc/dhclient-nogw em0.

This is a bit of an unusual setup though. Normally on a host which has both
internal and internet interfaces you would hardcode the address of the
internal one.



Re: Interface sequencing

2014-11-05 Thread Stefan Olsson
 That needs to go in a dhclient config file, you'll need different config
 files for each interface and run dhclient from a hostname.if line like
 !dhclient -c /etc/dhclient-nogw em0.

is it not enough to just append the following to /etc/dhclient.conf?:

interface em0 {
ignore routers;
}



Re: Interface sequencing

2014-11-05 Thread Stuart Henderson
On 2014/11/05 10:48, Stefan Olsson wrote:
  That needs to go in a dhclient config file, you'll need different config
  files for each interface and run dhclient from a hostname.if line like
  !dhclient -c /etc/dhclient-nogw em0.
 
 is it not enough to just append the following to /etc/dhclient.conf?:
 
 interface em0 {
 ignore routers;
 }

Oh, I wasn't aware of that possibility. Yes that should work :)



Re: Interface sequencing

2014-11-05 Thread Jason Adams
On 11/05/2014 07:48 AM, Stefan Olsson wrote:
 That needs to go in a dhclient config file, you'll need different config
 files for each interface and run dhclient from a hostname.if line like
 !dhclient -c /etc/dhclient-nogw em0.
 is it not enough to just append the following to /etc/dhclient.conf?:

 interface em0 {
 ignore routers;
 }


Without the encapsulating {} braces, it does NOT work.
No documentation on hostname.if suggested using braces, so it never occurred to 
me.

I'll try with your syntax, but to date nothing has been reliable other than
switching cat 5 cable.



Re: Interface sequencing

2014-11-05 Thread Jason Adams
On 11/05/2014 12:30 AM, Stuart Henderson wrote:
 This is a bit of an unusual setup though. Normally on a host which has both
 internal and internet interfaces you would hardcode the address of the
 internal one.
Agreed, its sort of odd.

Its an instrumentation polling machine, which runs periodic ssh connections to 
remote
stations and grabs a boatload of data, reduces it and stores the juicy bits on 
a local
database.  The internal net is all dhcp in almost every installation where this 
runs.

The easiest expedient would be to swap wires, but explaining that to the 
customer
is kind of embarrassing and its one of those things that you sit down to write 
the
documentation, and realize its just too dumb to write down.  ;-)



Re: Interface sequencing

2014-11-05 Thread obsd
Stefan Olsson schreef op 5-11-2014 om 16:48:
 That needs to go in a dhclient config file, you'll need different config
 files for each interface and run dhclient from a hostname.if line like
 !dhclient -c /etc/dhclient-nogw em0.
 is it not enough to just append the following to /etc/dhclient.conf?:

 interface em0 {
 ignore routers;
 }
You will get dns pushed though, and I doubt if you want to use the
internal or the external ones...



Re: Interface sequencing

2014-11-05 Thread Alexander Hall
On November 5, 2014 7:23:20 PM CET, Jason Adams adams...@gmail.com wrote:
On 11/05/2014 07:48 AM, Stefan Olsson wrote:
 That needs to go in a dhclient config file, you'll need different
config
 files for each interface and run dhclient from a hostname.if line
like
 !dhclient -c /etc/dhclient-nogw em0.
 is it not enough to just append the following to /etc/dhclient.conf?:

 interface em0 {
 ignore routers;
 }


Without the encapsulating {} braces, it does NOT work.
No documentation on hostname.if suggested using braces, so it never
occurred to me.

Well, this isn't hostname.if...

/Alexander


I'll try with your syntax, but to date nothing has been reliable other
than
switching cat 5 cable.



Re: Interface sequencing

2014-11-05 Thread rjc
On Wed, Nov 05, 2014 at 01:23:20PM EST, Jason Adams wrote:
 On 11/05/2014 07:48 AM, Stefan Olsson wrote:
  is it not enough to just append the following to /etc/dhclient.conf?:
  ^

  interface em0 {
  ignore routers;
  }
 
 Without the encapsulating {} braces, it does NOT work.
 No documentation on hostname.if suggested using braces, so it never
 occurred to me.

As above - you are looking in the wrong place.

man 5 dhclient.conf

OTHER DECLARATIONS
[...]
interface name { declaration; ...; }
A client with more than one network interface may require
different behaviour depending on which interface is being
configured. [...]

Regards,

rjc



Interface sequencing

2014-11-04 Thread Jason Adams
Newbie here...

Machine not intended to be a router, just to have two interfaced, one to local 
lan, second to a
cable modem.
Both interfaces connected to networks which supply dhcp address.  Both work.

Upon boot, both interfaces come up fine, but the default gateway gets set to my 
lan network.
I want the default gateway  to be via the cable modem, I don't want the traffic 
this machine
will be generating to be going over my lan.

It ignores /etc/mygate because both are dhcp.

If I disconnect the lan wire, and run netstart again, the default gateway is 
set correctly to the
cable modem,
then reconnect the lan, and run netstart yet again the default gateway remains 
pointed to the cable
modem as
I want.

So can anyone point me to the settings where the sequence of bringing up 
interfaces is controlled at
boot time?  Or am I just going to have to set default gateway after it is 
booted by something in
rc.local?



Re: Interface sequencing

2014-11-04 Thread Ted Unangst
On Tue, Nov 04, 2014 at 11:21, Jason Adams wrote:

 So can anyone point me to the settings where the sequence of bringing up
 interfaces is controlled at
 boot time?  Or am I just going to have to set default gateway after it is
 booted by something in
 rc.local?

/etc/netstart executes hostname.* which will be in alphabetical, then
numerical, order. echo /etc/hostname.* will show you the order if you
want to check it.



Re: Interface sequencing

2014-11-04 Thread trondd
On Tue, Nov 4, 2014 at 2:52 PM, Ted Unangst t...@tedunangst.com wrote:

 On Tue, Nov 04, 2014 at 11:21, Jason Adams wrote:

  So can anyone point me to the settings where the sequence of bringing up
  interfaces is controlled at
  boot time?  Or am I just going to have to set default gateway after it is
  booted by something in
  rc.local?

 /etc/netstart executes hostname.* which will be in alphabetical, then
 numerical, order. echo /etc/hostname.* will show you the order if you
 want to check it.


Can you explicitly add the external interface to group egress and
explicitly exclude the other one?

Doesn't the default route go to the egress interface?

Tim.



Re: Interface sequencing

2014-11-04 Thread Jason Adams
On 11/04/2014 11:52 AM, Ted Unangst wrote:
 On Tue, Nov 04, 2014 at 11:21, Jason Adams wrote:

 So can anyone point me to the settings where the sequence of bringing up
 interfaces is controlled at
 boot time?  Or am I just going to have to set default gateway after it is
 booted by something in
 rc.local?
 /etc/netstart executes hostname.* which will be in alphabetical, then
 numerical, order. echo /etc/hostname.* will show you the order if you
 want to check it.

Yes, well that's the problem.  I need them brought up in non-alphabetical order.

But Jan Vlach sent me a message (not via list) that I might be able to add
a ignore routers  option to the hostname.if file that I do not
want as a gateway.

I will play with this...