[lug] Ubuntu 18.04 Route Metric
Bear Giles
bgiles at coyotesong.com
Fri May 21 10:41:57 MDT 2021
Netplan - I don't know. One of the reasons I got the dual-NIC cards is so I
can experiment with advanced network configurations. They aren't quite
there yet since I need a newer kernel for the 2.5 Gbps NICs and only one 10
Gbps switch.
(Switches - augh. There's virtually no 2.5 Gbps switches and 10 Gbps are
pretty expensive. Plus you have to deal with the mix between SFP and RJ-45
connectors. I found one switch with a bunch of RJ-45 2.5 Gbps ports and two
SFP 10 Gbps ports - and it's managed so you can use a VLAN! - but it costs
$400. My 5-port 10 Gbps switch cost $150+ and I had to get the pay more for
the SFP connectors. But I can now proudly announce that one of the links is
over fiber optics cable.)
Routing - Could you have a cron job that simply changes the priority of the
routes?
On Fri, May 21, 2021 at 10:30 AM John Hernandez <jph at jph.net> wrote:
> In this case, I agree with Zan that the "right way" to fix this is to make
> the DHCP server on the private network stop providing a default route. If
> that DHCP server doesn't have the proper knobs to accomplish that, I would
> be inclined to turn that DHCP off altogether and deploy a better DHCP
> server on the private LAN.
>
> On Fri, May 21, 2021 at 10:24 AM D. Stimits <stimits at comcast.net> wrote:
>
>>
>>
>> On 05/20/2021 7:01 PM Bear Giles <bgiles at coyotesong.com> wrote:
>>
>>
>> I don't recall if netplan was supported in 18.04. It's taken a bit of
>> time to get the hang of it(*) but the basics aren't too bad - it sounds
>> like you want to set static values so it should be pretty straightforward.
>>
>> I want the metric to be custom at low priority (higher metric), or else
>> to not have a default route at all on the private network (this is
>> preferable). I just don't know how to do this while keeping DHCP.
>>
>> The private net router is mine, but it seems useless in setting metric.
>> I've changed "priority" in "nm-connection-editor", but this is ignored
>> (apparently I can set to use DHCP or many other things from
>> nm-connection-editor, but priority is summarily ignored). Can netplan be
>> used to allow all DHCP, except to intercept metric or default route on one
>> interface to either remove default route or force a low priority metric?
>> This might be the right way.
>>
>>
>> Part of one of my files is:
>>
>> # Let NetworkManager manage all devices on this system
>> network:
>> version: 2
>> renderer: NetworkManager
>> ethernets:
>> # onboard-NIC
>> enp0s31f6:
>> dhcp4: false
>> addresses:
>> - 192.168.1.3/24
>> - 10.0.10.3/24
>> - 10.0.20.3/24
>> - 10.0.90.3/24
>> # gateway4: 192.168.1.1
>> nameservers:
>> search:
>> - lan
>> addresses:
>> - 10.0.20.15
>> - 10.0.10.10
>> - 8.8.8.8
>> routes:
>> - to: 0.0.0.0/0
>> via: 192.168.1.1
>> metric: 100
>> # home GW to work VPN
>> - to: 172.27.0.0/16
>> via: 192.168.1.200
>> metric: 10
>>
>> It has additional stanzas for the 10 Gbps(!) NICs. A system with wifi
>> connectivity has
>>
>> # Let NetworkManager manage all devices on this system
>> network:
>> version: 2
>> renderer: NetworkManager
>>
>> wifis:
>> # all-wlans:
>>
>> wlp3s0:
>> match: {}
>> access-points:
>> homewifi:
>> password: 'password'
>> dhcp4: false
>> addresses:
>> - 192.168.1.9/24
>> - 10.0.10.9/24
>> gateway4: 192.168.1.1
>> nameservers:
>> search:
>> - lan
>> addresses:
>> - 10.0.10.15
>> - 10.0.10.10
>>
>>
>> FWIW I've tried to match on MAC address - it would be nice because I
>> could have one configuration file that I could deploy to all systems
>> instead of needing to customize them, but I haven't been able to get them
>> to work. Here's one attempt:
>>
>> wifis:
>> wlx9cefd5fcd82b:
>> match:
>> name: wlx9cefd5fcd82b
>> macaddress: "9c:ef:d5:fc:d8:2b"
>>
>> but I don't recall what had as the name . (That's the system's device
>> name based on the MAC address.) Hmm... maybe I should have tried 'all-wans'.
>>
>> Bear
>>
>> On Thu, May 20, 2021 at 9:54 AM Zan Lynx < zlynx at acm.org> wrote:
>>
>> On 5/20/21 8:34 AM, D. Stimits wrote:
>> > Does anyone here know how to force my Ubuntu 18.04 to completely
>> > leave out a default route for my private router? Or to permanently
>> > set that route to a low priority, or to permanently set my public
>> > interface to metric of 1?
>>
>> You must be using DHCP or this would not apply.
>>
>> Change your DHCP on your private network so that it does not apply any
>> default route. Then each DHCP client will only have routes to the
>> networks controlled by the private router.
>>
>> --
>> Knowledge is Power -- Power Corrupts
>> Study Hard -- Be Evil
>>
>> _______________________________________________
>> Web Page: http://lug.boulder.co.us
>> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>>
>> _______________________________________________
>> Web Page: http://lug.boulder.co.us
>> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>>
>> _______________________________________________
>> Web Page: http://lug.boulder.co.us
>> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>
> _______________________________________________
> Web Page: http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20210521/0afec4fa/attachment-0001.html>
More information about the LUG
mailing list