tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: ipv6 gateway on different subnet
Kia ora Peter,
It appears that there are a number of things going on here. Firstly, as
kre has noted, your VPS isn't doing the normal IPv6 thing and NetBSD
makes normal IPv6 easy. Secondly the route commands available on BSD
and Linux have a lot of diversity and history. In order to understand
route command examples from the web you sometimes have to be really on
top of your game.
Anyway I got this to work in my home lab with the following
1) route add -inet6 default 2602:fed2:7116::1 -connected -ifp wm2
2) Turn off dhcpcd (this is critical).
You don't need to specify "-net" because "default" is always a network.
You don't need the /128 on the IPv6 address because an IPv6 gateway is
always /128. "-connected -ifp wm2" tells the kernel that the gateway is
connected to wm2 even though the IPv6 addresses make it look like it
isn't. You will use vioif0 of course.
In my case dhcpcd was deleting the route after a minute or so. This
could easily be your problem as well. If you need dhcpcd for IPv4 then
try adding "noipv6" to /etc/dhcpcd.conf.
On Sat, 2025-01-18 at 09:17 -0600, Peter Miller wrote:
> Thank you both for your input.
>
> > should be this
> >
> > route add -inet6 -interface 2602:fed2:7116:d82c::1
> > 2602:fed2:7116::1
>
> I have tried that and it fails.
>
> #route add -inet6 -interface 2602:fed2:7116:d82c::1 2602:fed2:7116::1
> route: writing to routing socket: Network is unreachable
> add host 2602:fed2:7116:d82c::1: gateway 2602:fed2:7116::1: Network
> is
> unreachable
This is what is fixed by specifying "-connected". The "-connected"
tells the kernel that the gateway address really is directly connected
even though it looks like it isn't.
> Reversing the addresses works.. the command does at least. The
> Internet
> does not.
That is because you are getting confused about the difference between
the destination and the gateway. You are not alone in this. It doesn't
help that in an English language sense the "destination" and the
"gateway" are both destinations where we are trying to send packets to.
In a network the destination is always beyond the gateway.
> I noticed 'alias' was missing from the end of the inet6 address, and
> was
> surprised it worked.
The route command is very old and supports a lot of old syntax via
DWIM.
Ngā mihi,
Lloyd
Home |
Main Index |
Thread Index |
Old Index