Re: /etc/network/interfaces with multiple network interfaces

2019-01-10 Thread Rainer Dorsch
Hi Reco,

works perfectly as you decribe for me.

Many thanks
Rainer

Am Donnerstag, 10. Januar 2019, 05:41:49 CET schrieb Reco:
>   Hi.
> 
> On Wed, Jan 09, 2019 at 11:09:58PM +0100, Rainer Dorsch wrote:
> > Hi,
> > 
> > I have a system with two network interfaces, connecting to two subnets.
> > 
> > For some reason the default route is going through eth0.3, I would want to
> > have it through eth0.7.
> 
> Both of your VLANs are configured by DHCP, and have the same metric (0
> by default).
> 
> > Is the default route determined by the order in /etc/network/interface of
> > the interfaces or is there another algorithm behind?
> 
> What really happens is one default route get replaced by another.
> Whichever happens to be getting the lease last - wins.
> 
> 
> If you need the default route on eno1.7 to appear and to be used -
> assign lower metric to it. Like this (32 and 64 are arbitrary):
> 
> # cam
> auto eno1.3
> allow-hotplug eno1.3
> iface eno1.3 inet dhcp
>   metric 64
> iface eno1.3 inet6 auto
>   accept_ra 0
> 
> # data
> auto eno1.7
> allow-hotplug eno1.7
> iface eno1.7 inet dhcp
>   metric 32
> iface eno1.7 inet6 auto
>   accept_ra 0
> 
> Reco


-- 
Rainer Dorsch
http://bokomoko.de/




Re: /etc/network/interfaces with multiple network interfaces

2019-01-09 Thread Reco
Hi.

On Wed, Jan 09, 2019 at 11:09:58PM +0100, Rainer Dorsch wrote:
> Hi,
> 
> I have a system with two network interfaces, connecting to two subnets. 
> 
> For some reason the default route is going through eth0.3, I would want to 
> have it through eth0.7.

Both of your VLANs are configured by DHCP, and have the same metric (0
by default).


> Is the default route determined by the order in /etc/network/interface of the 
> interfaces or is there another algorithm behind?

What really happens is one default route get replaced by another.
Whichever happens to be getting the lease last - wins.


If you need the default route on eno1.7 to appear and to be used -
assign lower metric to it. Like this (32 and 64 are arbitrary):

# cam
auto eno1.3
allow-hotplug eno1.3
iface eno1.3 inet dhcp
metric 64
iface eno1.3 inet6 auto
accept_ra 0

# data
auto eno1.7
allow-hotplug eno1.7
iface eno1.7 inet dhcp
metric 32
iface eno1.7 inet6 auto
accept_ra 0

Reco



Re: /etc/network/interfaces with multiple network interfaces

2019-01-09 Thread Lee
On 1/9/19, Rainer Dorsch  wrote:
> Hi,
>
> I have a system with two network interfaces, connecting to two subnets.
>
> For some reason the default route is going through eth0.3, I would want to
> have it through eth0.7.

further down you've got:
rd@master:~$ ip r
default via 192.168.3.1 dev eno1.3
192.168.3.0/24 dev eno1.3 proto kernel scope link src 192.168.3.2
192.168.7.0/24 dev eno1.7 proto kernel scope link src 192.168.7.2

Just a guess, but the default gateway is 192.168.3.1 & eno1.3 is
directly connected to that subnet so that's the best route.

Change your default gateway to 192.168.7.1 (or whatever the router is
on that subnet) & it should pick eno1.7 for the default route.

Regards,
Lee

>
> Is the default route determined by the order in /etc/network/interface of
> the
> interfaces or is there another algorithm behind?
>
> rd@master:~$ cat /etc/network/interfaces
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
>
> source /etc/network/interfaces.d/*
>
> # The loopback network interface
> auto lo
> iface lo inet loopback
>
> auto eno1
> allow-hotplug eno1
> #iface eno1 inet dhcp
> iface eno1 inet6 auto
>   accept_ra 0
>
> # cam
> auto eno1.3
> allow-hotplug eno1.3
> iface eno1.3 inet dhcp
> iface eno1.3 inet6 auto
>   accept_ra 0
>
> # data
> auto eno1.7
> allow-hotplug eno1.7
> iface eno1.7 inet dhcp
> iface eno1.7 inet6 auto
>   accept_ra 0
> rd@master:~$ ip a show
> 1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group
> default qlen 1
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> inet 127.0.0.1/8 scope host lo
>valid_lft forever preferred_lft forever
> inet6 ::1/128 scope host
>valid_lft forever preferred_lft forever
> 2: eno1:  mtu 1500 qdisc pfifo_fast state
> UP
> group default qlen 1000
> link/ether 18:66:da:20:6f:2d brd ff:ff:ff:ff:ff:ff
> inet6 fe80::1a66:daff:fe20:6f2d/64 scope link
>valid_lft forever preferred_lft forever
> 3: eno1.3@eno1:  mtu 1500 qdisc noqueue
> state
> UP group default qlen 1000
> link/ether 18:66:da:20:6f:2d brd ff:ff:ff:ff:ff:ff
> inet 192.168.3.2/24 brd 192.168.3.255 scope global eno1.3
>valid_lft forever preferred_lft forever
> inet6 fe80::1a66:daff:fe20:6f2d/64 scope link
>valid_lft forever preferred_lft forever
> 4: eno1.7@eno1:  mtu 1500 qdisc noqueue
> state
> UP group default qlen 1000
> link/ether 18:66:da:20:6f:2d brd ff:ff:ff:ff:ff:ff
> inet 192.168.7.2/24 brd 192.168.7.255 scope global eno1.7
>valid_lft forever preferred_lft forever
> inet6 fe80::1a66:daff:fe20:6f2d/64 scope link
>valid_lft forever preferred_lft forever
> rd@master:~$ ip r
> default via 192.168.3.1 dev eno1.3
> 192.168.3.0/24 dev eno1.3 proto kernel scope link src 192.168.3.2
> 192.168.7.0/24 dev eno1.7 proto kernel scope link src 192.168.7.2
> rd@master:~$
>
>
> Thanks
> Rainer
> --
> Rainer Dorsch
> http://bokomoko.de/
>
>
>



/etc/network/interfaces with multiple network interfaces

2019-01-09 Thread Rainer Dorsch
Hi,

I have a system with two network interfaces, connecting to two subnets. 

For some reason the default route is going through eth0.3, I would want to 
have it through eth0.7.

Is the default route determined by the order in /etc/network/interface of the 
interfaces or is there another algorithm behind?

rd@master:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto eno1
allow-hotplug eno1
#iface eno1 inet dhcp
iface eno1 inet6 auto
  accept_ra 0

# cam
auto eno1.3
allow-hotplug eno1.3
iface eno1.3 inet dhcp
iface eno1.3 inet6 auto
  accept_ra 0

# data
auto eno1.7
allow-hotplug eno1.7
iface eno1.7 inet dhcp
iface eno1.7 inet6 auto
  accept_ra 0
rd@master:~$ ip a show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group 
default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eno1:  mtu 1500 qdisc pfifo_fast state UP 
group default qlen 1000
link/ether 18:66:da:20:6f:2d brd ff:ff:ff:ff:ff:ff
inet6 fe80::1a66:daff:fe20:6f2d/64 scope link 
   valid_lft forever preferred_lft forever
3: eno1.3@eno1:  mtu 1500 qdisc noqueue state 
UP group default qlen 1000
link/ether 18:66:da:20:6f:2d brd ff:ff:ff:ff:ff:ff
inet 192.168.3.2/24 brd 192.168.3.255 scope global eno1.3
   valid_lft forever preferred_lft forever
inet6 fe80::1a66:daff:fe20:6f2d/64 scope link 
   valid_lft forever preferred_lft forever
4: eno1.7@eno1:  mtu 1500 qdisc noqueue state 
UP group default qlen 1000
link/ether 18:66:da:20:6f:2d brd ff:ff:ff:ff:ff:ff
inet 192.168.7.2/24 brd 192.168.7.255 scope global eno1.7
   valid_lft forever preferred_lft forever
inet6 fe80::1a66:daff:fe20:6f2d/64 scope link 
   valid_lft forever preferred_lft forever
rd@master:~$ ip r
default via 192.168.3.1 dev eno1.3 
192.168.3.0/24 dev eno1.3 proto kernel scope link src 192.168.3.2 
192.168.7.0/24 dev eno1.7 proto kernel scope link src 192.168.7.2 
rd@master:~$ 


Thanks
Rainer
-- 
Rainer Dorsch
http://bokomoko.de/