Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #204267 > unrolled thread
| Started by | Rainer Dorsch <ml@bokomoko.de> |
|---|---|
| First post | 2019-01-09 23:20 +0100 |
| Last post | 2019-01-10 21:40 +0100 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.debian.user
/etc/network/interfaces with multiple network interfaces Rainer Dorsch <ml@bokomoko.de> - 2019-01-09 23:20 +0100
Re: /etc/network/interfaces with multiple network interfaces Lee <ler762@gmail.com> - 2019-01-10 00:50 +0100
Re: /etc/network/interfaces with multiple network interfaces Reco <recoverym4n@enotuniq.net> - 2019-01-10 05:50 +0100
Re: /etc/network/interfaces with multiple network interfaces Rainer Dorsch <ml@bokomoko.de> - 2019-01-10 21:40 +0100
| From | Rainer Dorsch <ml@bokomoko.de> |
|---|---|
| Date | 2019-01-09 23:20 +0100 |
| Subject | /etc/network/interfaces with multiple network interfaces |
| Message-ID | <xeumC-7Tz-5@gated-at.bofh.it> |
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: <LOOPBACK,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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/
[toc] | [next] | [standalone]
| From | Lee <ler762@gmail.com> |
|---|---|
| Date | 2019-01-10 00:50 +0100 |
| Message-ID | <xevLJ-bD-13@gated-at.bofh.it> |
| In reply to | #204267 |
On 1/9/19, Rainer Dorsch <ml@bokomoko.de> 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: <LOOPBACK,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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/ > > >
[toc] | [prev] | [next] | [standalone]
| From | Reco <recoverym4n@enotuniq.net> |
|---|---|
| Date | 2019-01-10 05:50 +0100 |
| Message-ID | <xeAs1-351-1@gated-at.bofh.it> |
| In reply to | #204267 |
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
[toc] | [prev] | [next] | [standalone]
| From | Rainer Dorsch <ml@bokomoko.de> |
|---|---|
| Date | 2019-01-10 21:40 +0100 |
| Message-ID | <xePho-3Kg-15@gated-at.bofh.it> |
| In reply to | #204280 |
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/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web