Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Nexthop has invalid gateway
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Apr 16, 2021 3:50 am    Post subject: [SOLVED] Nexthop has invalid gateway Reply with quote

hi,

I'm installing Gentoo on a VPS, and I have a network problem I don't understand
My fixed IPv4 : AAA.BBB.219.143
Gateway : AAA.BBB.216.1

Here what I get when I use dhcp (but I'd like to not use dhcp and make fixed config as suggested on some forums of the VPS) :
Code:
$ ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet AAA.BBB.219.143  netmask 255.255.255.255  broadcast AAA.BBB.219.143
        inet6 fe80::84b7:a6c1:9f41:498a  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:77:ac:2a  txqueuelen 1000  (Ethernet)
        RX packets 2474  bytes 191990 (187.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1658  bytes 201270 (196.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Code:
ip route
Destination     Passerelle      Genmask         Indic Metric Ref    Use Iface
0.0.0.0         AAA.BBB.216.1   0.0.0.0         UG    2      0        0 eth0
AAA.BBB.216.1   0.0.0.0         255.255.255.255 UH    2      0        0 eth0


but with /etc/conf.d/net :
Code:
config_eth0="AAA.BBB.219.143/32 brd AAA.BBB.219.143"
routes_eth0="default via AAA.BBB.216.1"

when I restart net.eth0, I get this error :
Code:
 * Bringing up interface eth0
 *   AAA.BBB.219.143/32 ...                                                                  [ ok ]
 *   Adding routes
 *     default via AAA.BBB.216.1 ...
Error: Nexthop has invalid gateway.                                                          [ !! ]

But, if I manualy set routes like :
Code:
ip route add AAA.BBB.216.1 dev eth0
ip route add default via AAA.BBB.216.1

All is ok and works fine.

What do I need to put in my /etc/conf.d/net please ?


Last edited by Frautoincnam on Sat Apr 17, 2021 6:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
user
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 201

PostPosted: Fri Apr 16, 2021 6:09 am    Post subject: Reply with quote

A gateway address can only be on a directly connected network.
AAA.BBB.216.1/32 is not part of AAA.BBB.219.143/32 and for the local host not known yet which interface to use.

Try to incorporate your manual steps
Code:
routes_eth0="AAA.BBB.216.1/32 dev eth0
default via AAA.BBB.216.1"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Fri Apr 16, 2021 9:38 am    Post subject: Reply with quote

Frautoincnam,

Normally the gateway is in the same subnet as your IP but
Code:
Destination     Passerelle      Genmask         Indic Metric Ref    Use Iface
0.0.0.0         AAA.BBB.216.1   0.0.0.0         UG    2      0        0 eth0
AAA.BBB.216.1   0.0.0.0         255.255.255.255 UH    2      0        0 eth0
says that your 'subnet' only has a single IP so your gateway is outside your subnet.
That's your problem.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4133
Location: Bavaria

PostPosted: Fri Apr 16, 2021 9:39 am    Post subject: Re: Nexthop has invalid gateway Reply with quote

Frautoincnam wrote:
My fixed IPv4 : AAA.BBB.219.143
Gateway : AAA.BBB.216.1


If these addresses are correct you must do:

1. Read this chapter: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Networking#Understanding_network_terminology

2. to understand why you need a netmask of 255.255.252.0 (=128+64+32+16+8+4 = 6 bits)

216 = 128+64+0+16+8+0 + 0+0
219 = 128+64+0+16+8+0 + 2+1

Frautoincnam wrote:
What do I need to put in my /etc/conf.d/net please ?


Solution should be:

Frautoincnam wrote:
but with /etc/conf.d/net :

=>
Code:
config_eth0="AAA.BBB.219.143 netmask 255.255.252.0 brd AAA.BBB.219.255"
routes_eth0="default via AAA.BBB.216.1"




P.S.: This is the same:

Code:
config_eth0="AAA.BBB.219.143/22 brd AAA.BBB.219.255"
routes_eth0="default via AAA.BBB.216.1"
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Fri Apr 16, 2021 11:43 am    Post subject: Reply with quote

Frautoincnam,

An OVH VPS by any chance?

You need some of this or your netmask is incorrect.
Your VPS provider will tell you more.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Apr 16, 2021 2:36 pm    Post subject: Reply with quote

@all: First, thanks a lot for your help.

user wrote:
A gateway address can only be on a directly connected network.
Code:
routes_eth0="AAA.BBB.216.1/32 dev eth0
default via AAA.BBB.216.1"

doesn't work :
Code:
Error: either "to" is duplicate, or "default" is a garbage.                                  [ !! ]

*******************************************

NeddySeagoon wrote:
your 'subnet' only has a single IP so your gateway is outside your subnet.

I understood that

Quote:
That's your problem.

But no choice.

Quote:
An OVH VPS by any chance?

Yes !

Quote:
You need some of this or your netmask is incorrect.

I'll have a look

Quote:
Your VPS provider will tell you more.

OVH ? tell something ? Hmmmm :D
*******************************************

pietinger wrote:
1. Read this chapter: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Networking#Understanding_network_terminology

I promise I'll read it again !
Quote:
2. to understand why you need a netmask of 255.255.252.0 (=128+64+32+16+8+4 = 6 bits)

My problem was here.
I tried AAA.BBB.219.143/22 but with "brb AAA.BBB.219.143", as I could see in the "ifconfig" from dhcp configuration.
Quote:
Code:
config_eth0="AAA.BBB.219.143/22 brd AAA.BBB.219.255"
routes_eth0="default via AAA.BBB.216.1"

Works !
But I dont have the same result with ifconfig (as with dhcp) :
Code:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet AAA.BBB.219.143  netmask 255.255.252.0  broadcast AAA.BBB.219.255
        ether fa:16:3e:77:ac:2a  txqueuelen 1000  (Ethernet)
        RX packets 1595576  bytes 124229157 (118.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1562326  bytes 4038241973 (3.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

and no IPV6.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Fri Apr 16, 2021 2:55 pm    Post subject: Reply with quote

Frautoincnam,

When I was with OVH they were absolutely hopeless and that's being kind.
However, the user contributed documentation was OK.

You really only have a single IP so setting your netmask to anything other than 255.255.255.255 is not the right way to fix it.
You need a static route to your gateway, then the default rout will work as expected.

IPv6 is an entirely separate nest of vipers.
It can but does not normally use dhcp. Configuration is fairly automatic.
Do you hawe an IPv6 address that starts with a 2?
If not, you don't have a public IP address.
Do you have a /64 or just a single IPv6 address?

The
Code:
inet6 fe80::84b7:a6c1:9f41:498a
you showed is only a local IP.
I don't remember if its site local or link local but its not rotatable anyway.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Apr 16, 2021 3:06 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Frautoincnam,

When I was with OVH they were absolutely hopeless and that's being kind.
However, the user contributed documentation was OK.

I saw a lot of posts on their forums where VPS users say that OVH does not answer them on this subject, that the configuration of the VPS is not their responsibility.

Quote:
You really only have a single IP so setting your netmask to anything other than 255.255.255.255 is not the right way to fix it.
You need a static route to your gateway, then the default rout will work as expected.

Si @pietinger is not a solution for me ?

Quote:
IPv6 is an entirely separate nest of vipers.
It can but does not normally use dhcp. Configuration is fairly automatic.

Ok. I don't really know anything about IPV6.

Quote:
Do you hawe an IPv6 address that starts with a 2?

Yes ! 2001:41d0:XXX:YYY::ZZZZ
Quote:
Do you have a /64 or just a single IPv6 address?

I don't really know.
But they give me a gateway IPV6 : 2001:41d0:XXX:YYY::1

Quote:
The
Code:
inet6 fe80::84b7:a6c1:9f41:498a
you showed is only a local IP.
I don't remember if its site local or link local but its not rotatable anyway.

Ok.
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Apr 16, 2021 3:09 pm    Post subject: Reply with quote

Frautoincnam wrote:
Quote:
2. to understand why you need a netmask of 255.255.252.0 (=128+64+32+16+8+4 = 6 bits)

My problem was here.

Or not.
It works too with "brb AAA.BBB.219.143".
So I don't remember what I tried that didn't work.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Fri Apr 16, 2021 3:27 pm    Post subject: Reply with quote

Frautoincnam,

It works for the wrong reasons.

If you want to try a static IPv6 setup, add it into the

Code:
routes_eth0="AAA.BBB.216.1/32 dev eth0
default via AAA.BBB.216.1"
statements.

Code:
config_eth0="192.168.122.104/24
             2a01:4f8:x.y.z::8001/96"

routes_eth0="default via 192.168.122.1
             default via fe80::5054:ff:fe07:3867"


That's from a KVM of on mine. Use your numbers, not mine :)

If you run
Code:
ping6 ff02::2 -I eth0
responses will all be from routers.
Pick one. There may only be one.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Apr 16, 2021 5:36 pm    Post subject: Reply with quote

NeddySeagoon wrote:
It works for the wrong reasons.

The only solution is to ask OVH so ?

Quote:
Code:
2a01:4f8:x.y.z::8001/96"

really with ::8001/96 ?
Or just MY own IPV6 I described as 2001:41d0:XXX:YYY::ZZZZ/96
I don't know if your "x.y.z" is my "XXX.YYY.ZZZZ"
And /96 ? not /64 ?

Quote:
If you run
Code:
ping6 ff02::2 -I eth0
responses will all be from routers.
Pick one. There may only be one.

with "2001:41d0:XXX:YYY::ZZZZ/96"
I get :
Code:
# ping6 ff02::2 -I eth0
ping6: Warning: source address might be selected on device other than: eth0
PING ff02::2(ff02::2) from :: eth0: 56 octets de données
64 octets de 2001:41d0:XXX:YYY::1 : icmp_seq=1 ttl=64 temps=0.292 ms
64 octets de 2001:41d0:XXX:YYY::1 : icmp_seq=2 ttl=64 temps=0.174 ms
64 octets de 2001:41d0:XXX:YYY::1 : icmp_seq=3 ttl=64 temps=0.136 ms
64 octets de 2001:41d0:XXX:YYY::1 : icmp_seq=4 ttl=64 temps=0.237 ms
64 octets de 2001:41d0:XXX:YYY::1 : icmp_seq=5 ttl=64 temps=0.135 ms
64 octets de 2001:41d0:XXX:YYY::1 : icmp_seq=6 ttl=64 temps=0.174 ms
^C
--- statistiques ping ff02::2 ---
6 paquets transmis, 6 reçus, 0% packet loss, time 5115ms
rtt min/avg/max/mdev = 0.135/0.191/0.292/0.056 ms

# ping6 google.com -I eth0
PING google.com(fra16s49-in-x0e.1e100.net (2a00:1450:4001:80f::200e)) from 2001:41d0:XXX:YYY::ZZZZ eth0: 56 octets de données
64 octets de fra07s64-in-x200e.1e100.net (2a00:1450:4001:80f::200e) : icmp_seq=1 ttl=111 temps=12.9 ms
64 octets de fra07s64-in-x200e.1e100.net (2a00:1450:4001:80f::200e) : icmp_seq=2 ttl=111 temps=11.4 ms
64 octets de fra07s64-in-x200e.1e100.net (2a00:1450:4001:80f::200e) : icmp_seq=3 ttl=111 temps=11.4 ms
64 octets de fra16s49-in-x0e.1e100.net (2a00:1450:4001:80f::200e) : icmp_seq=4 ttl=111 temps=11.4 ms
^C
--- statistiques ping google.com ---
4 paquets transmis, 4 reçus, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 11.397/11.786/12.910/0.648 ms

Is it ok ?


Last edited by Frautoincnam on Sat Apr 17, 2021 3:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Fri Apr 16, 2021 5:42 pm    Post subject: Reply with quote

Frautoincnam,

Use whatever OVH gave you. I was only showing the syntax.

I have a heztner server that has one IPv4 address and a /64 IPv6 subnet.
The /64 is subnetted to the KVMs. A /96 each is plenty.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4133
Location: Bavaria

PostPosted: Fri Apr 16, 2021 5:47 pm    Post subject: Reply with quote

Frautoincnam wrote:
Si @pietinger is not a solution for me ?


Yes, it is not a solution for you.

In case of doubt the answer is always: Trust Neddy ...

... because even a network specialist can be wrong. I thought your netmask (/32) is a typo, because /22 would be generally the correct answer for your problem. But not in your special case. You must know: A network mask with all bits set (/32 = 255.255.255.255) means: There is no network (or: you are the network :-) ). Your host is then only able to talk with a specified router. This will be done usually for telephones, network TVs ... and in some cases for a vpn (or for point-to-point-connections; there is also an old Windows solution). I dont know OVH and the last time I played with a VPNs is many years. If Neddy knows OVH he surely can help you further.
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Apr 16, 2021 6:56 pm    Post subject: Reply with quote

pietinger wrote:
In case of doubt the answer is always: Trust Neddy ...

:D
Quote:
You must know: A network mask with all bits set (/32 = 255.255.255.255) means: There is no network (or: you are the network :-) ).

I understood that.
Quote:
Your host is then only able to talk with a specified router. This will be done usually for telephones, network TVs ... and in some cases for a vpn (or for point-to-point-connections; there is also an old Windows solution). I dont know OVH and the last time I played with a VPNs is many years. If Neddy knows OVH he surely can help you further.

Ok. I'll ask OVH.
But for the moment, I'll work with the DHCP config.

But thank you anyway for your help. I still learned some things :wink:
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Apr 16, 2021 7:38 pm    Post subject: Reply with quote

Frautoincnam wrote:
Ok. I'll ask OVH.

But, I realize that I can"t ask them, because that's a real problem of configuration.
Because with :
Code:
config_eth0="AAA.BBB.219.143/32 brd AAA.BBB.219.143"

I can set routes with :
Code:
ip route add AAA.BBB.216.1 dev eth0
ip route add default via AAA.BBB.216.1

And I have my 255.255.255.255 mask.

The problem is to add this in my configuration.

So, now, I have
Code:
dns_domain_lo="vps.ovh.net"
dns_servers_eth0="1.1.1.2 213.186.33.99"
dns_domain_eth0="vps.ovh.net"
dns_search_eth0="vps.ovh.net"
config_eth0="   AAA.BBB.219.143/32 brd AAA.BBB.219.143
                2001:41d0:XXX:YYY::ZZZZ/96"
routes_eth0="   default via 2001:41d0:XXX:YYY::1"
postup() {
        if [ "${IFACE}" = "eth0" ] ; then
                ip route add AAA.BBB.216.1 dev eth0
                ip route add default via AAA.BBB.216.1
        fi
}

And it seems to be nice.
Code:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet AAA.BBB.219.143  netmask 255.255.255.255  broadcast AAA.BBB.219.143
        inet6 2001:41d0:XXX:YYY::ZZZZ  prefixlen 96  scopeid 0x0<global>
        ether fa:16:3e:77:ac:2a  txqueuelen 1000  (Ethernet)
        RX packets 1627248  bytes 126445339 (120.5 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1592728  bytes 4062876885 (3.7 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I hope you'll confirm.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Fri Apr 16, 2021 8:05 pm    Post subject: Reply with quote

Frautoincnam,

Code:
2001:41d0:XXX:YYY::ZZZZ/96
is unlikely to be correct.
OVH will have allocated you a /64 or more likely a /128, just a single address.

The
Code:
postup() {
        if [ "${IFACE}" = "eth0" ] ; then
                ip route add AAA.BBB.216.1 dev eth0
                ip route add default via AAA.BBB.216.1
        fi
}
is not required. It can all be written in
Code:
routes_eth0="   default via 2001:41d0:XXX:YYY::1"

I'm not sure how though.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Apr 16, 2021 8:26 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Code:
2001:41d0:XXX:YYY::ZZZZ/96
is unlikely to be correct.

Ok.
Quote:
OVH will have allocated you a /64 or more likely a /128, just a single address.

I couldn't find the information in my OVH space, so tested 128 => error, 64 => no error.
Seems to be /64 ;)

Quote:
It can all be written in
Code:
routes_eth0="   default via 2001:41d0:XXX:YYY::1"

Oh ok, but how ?
I couldn't find any example with such a situation.
It is also a little bit the purpose of my first message :D

Quote:
I'm not sure how though.

me neither precisely :lol:
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Fri Apr 16, 2021 9:07 pm    Post subject: Reply with quote

Frautoincnam,

This page says you have a /128, if your VPS is on that page.
You will need to do the same host route thing as IPv4 needs to set in up properly.

Wild guess ... you need a host route. As it goes to exactly one host, not a network, its a /32

Code:
routes_eth0="   default via 2001:41d0:XXX:YYY::1
                AAA.BBB.216.1/32
                default via AAA.BBB.216.1


The AAA.BBB.216.1/32 host route must be set before the default route or the kernel will net be able to reach the next hop.
I can't test easily as as I don't have a setup like that.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Apr 16, 2021 9:34 pm    Post subject: Reply with quote

NeddySeagoon wrote:
This page says you have a /128, if your VPS is on that page.

Mine is "Starter". Not in the "compare" page. I'm not able to find details about it.

Quote:
You will need to do the same host route thing as IPv4 needs to set in up properly.

I don't really understand what you mean here.

Quote:
Code:
routes_eth0="   default via 2001:41d0:XXX:YYY::1
                AAA.BBB.216.1/32
                default via AAA.BBB.216.1


The AAA.BBB.216.1/32 host route must be set before the default route or the kernel will net be able to reach the next hop.

Ok !

Quote:
I can't test easily as as I don't have a setup like that.

It seems to be ok for me.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Fri Apr 16, 2021 9:49 pm    Post subject: Reply with quote

Frautoincnam,

All the VPS on the compare page have
Code:
IPv4 address    1
IPv6 address    /128
or one of each.
The starter VPS is lower cost, so it will not be any better.

Ahh, it's here and its the same in the connectivity department.

-- edit --

Your IPv6 needs the same thing. For IPv6 a host route is /128, not /32
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Fri Apr 16, 2021 11:58 pm    Post subject: Reply with quote

NeddySeagoon wrote:
All the VPS on the compare page have
Code:
IPv4 address    1
IPv6 address    /128
or one of each.

with /128, I get :
Code:
RTNETLINK answers: No route to host                                                          [ !! ]

and no error with /64.

Quote:
The starter VPS is lower cost, so it will not be any better.

/64 is better than /128 ?

Quote:
Your IPv6 needs the same thing. For IPv6 a host route is /128, not /32

Surely because of my bad english, it's not better.
You suggest me to make some other modification in my actual config ?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Sat Apr 17, 2021 11:13 am    Post subject: Reply with quote

Frautoincnam,

To make IPv4 work correctly, you need a host route to your IPv4 gateway, so that the default route can work.

That's the
Code:
routes_eth0="
                AAA.BBB.216.1/32
                default via AAA.BBB.216.1


As you have only one IPv6 address, you need the same thing.
Code:
routes_eth0=" 2001:41d0:XXX:YYY::1/128
                default via 2001:41d0:XXX:YYY::1


An IPv4 address consists of 32 bits, hence the /32
An IPv6 address is 128 bits, hence the /128. Both say to reach a single host.

Putting it together in a single statement.
Code:
routes_eth0=" 2001:41d0:XXX:YYY::1/128
              default via 2001:41d0:XXX:YYY::1
              AAA.BBB.216.1/32
              default via AAA.BBB.216.1


The host routes must appear before the default route that uses the host route. Other than that, ordering is not imporrtant.

As you have single IP addresses, your system does not belong to any subnet.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Sat Apr 17, 2021 3:17 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Code:
routes_eth0=" 2001:41d0:XXX:YYY::1/128
              default via 2001:41d0:XXX:YYY::1
              AAA.BBB.216.1/32
              default via AAA.BBB.216.1

Ok, it's much clearer now. Sorry for being so "heavy".

Code:
 * Bringing up interface eth0
 *   AAA.BBB.219.143/32 ...                                                                  [ ok ]
 *   2001:41d0:XXX:YYY::ZZZZ/64 ...                                                          [ ok ]
 *   Adding routes
 *     2001:41d0:XXX:YYY::1/128 ...                                                          [ ok ]
 *     default via 2001:41d0:XXX:YYY::1 ...                                                  [ ok ]
 *     AAA.BBB.216.1/32 ...                                                                  [ ok ]
 *     default via AAA.BBB.216.1 ...                                                         [ ok ]
 *   Waiting for tentative IPv6 addresses to complete DAD (5 seconds) ..                     [ ok ]

Code:
# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet AAA.BBB.219.143  netmask 255.255.255.255  broadcast AAA.BBB.219.143
        inet6 2001:41d0:XXX:YYY::ZZZZ  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::f816:3eff:fe77:ac2a  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:77:ac:2a  txqueuelen 1000  (Ethernet)
        RX packets 1187965  bytes 82903199 (79.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1182202  bytes 3075588337 (2.8 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# ip -6 route
2001:41d0:XXX:YYY::1 dev eth0 metric 2 pref medium
2001:41d0:XXX:YYY::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
multicast ff00::/8 dev eth0 proto kernel metric 256 pref medium
default via 2001:41d0:XXX:YYY::1 dev eth0 metric 2 pref medium

# route -6 -n
Table de routage IPv6 du noyau
Destination                    Next Hop                   Flag Met Ref Use If
::1/128                        ::                         Un   0   4     0 lo
2001:41d0:XXX:YYY::1/128       ::                         U    2   2     0 eth0
2001:41d0:XXX:YYY::ZZZZ/128    ::                         Un   0   2     0 eth0
2001:41d0:XXX:YYY::/64         ::                         U    256 1     0 eth0
fe80::f816:3eff:fe77:ac2a/128  ::                         Un   0   2     0 eth0
fe80::/64                      ::                         U    256 1     0 eth0
ff00::/8                       ::                         U    256 2     0 eth0
::/0                           2001:41d0:XXX:YYY::1       UG   2   1     0 eth0

Does all this seem normal to you?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Sat Apr 17, 2021 3:47 pm    Post subject: Reply with quote

Frautoincnam,

Not everyone's first language is English and I try to point the way rather than say "do this".
You are not being heavy. Teaching fishing means I point the way too far ahead on some occasions.

Where does the
Code:
2001:41d0:XXX:YYY::/64 dev eth0 proto kernel metric 256 pref medium
come from?
I would not expect to see that but its possible that OVH's router does that.

If its not coming out of your net file its OK.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Frautoincnam
Apprentice
Apprentice


Joined: 19 May 2017
Posts: 294

PostPosted: Sat Apr 17, 2021 4:42 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Not everyone's first language is English and I try to point the way rather than say "do this".
You are not being heavy. Teaching fishing means I point the way too far ahead on some occasions.

You're right. I aggree with all of that, of course. And I like learning. But sometime, it's embarassing to ask, ask and ask...

Quote:
Where does the
Code:
2001:41d0:XXX:YYY::/64 dev eth0 proto kernel metric 256 pref medium
come from?

Of course from my config ;)
I modified like (nothing else in) /etc/conf.d/net (/64 to /128):
Code:
dns_servers_eth0="1.1.1.2 213.186.33.99"
dns_domain="mydomain"
dns_search="mydomain"
config_eth0="   AAA.BBB.219.143/32 brd AAA.BBB.219.143
                2001:41d0:XXX:YYY::ZZZZ/128"
routes_eth0="   2001:41d0:XXX:YYY::1/128
                default via 2001:41d0:XXX:YYY::1
                AAA.BBB.216.1/32
                default via AAA.BBB.216.1"

Quote:
I would not expect to see that but its possible that OVH's router does that.

If its not coming out of your net file its OK.

Code:
# ifconfig eth0 | anonyme
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet AAA.BBB.219.143  netmask 255.255.255.255  broadcast AAA.BBB.219.143
        inet6 2001:41d0:XXX:YYY::ZZZZ  prefixlen 128  scopeid 0x0<global>
        inet6 fe80::f816:3eff:fe77:ac2a  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:77:ac:2a  txqueuelen 1000  (Ethernet)
        RX packets 1197619  bytes 83608442 (79.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1189537  bytes 3077120396 (2.8 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# route -6 -n | anonyme
Table de routage IPv6 du noyau
Destination                    Next Hop                   Flag Met Ref Use If
::1/128                        ::                         Un   0   4     0 lo
2001:41d0:XXX:YYY::1/128       ::                         U    2   1     0 eth0
2001:41d0:XXX:YYY::ZZZZ/128    ::                         Un   0   3     0 eth0
2001:41d0:XXX:YYY::ZZZZ/128    ::                         U    256 2     0 eth0
fe80::f816:3eff:fe77:ac2a/128  ::                         Un   0   3     0 eth0
fe80::/64                      ::                         U    256 1     0 eth0
ff00::/8                       ::                         U    256 2     0 eth0
::/0                           2001:41d0:XXX:YYY::1       UG   2   2     0 eth0
# ip -6 route | anonyme
2001:41d0:XXX:YYY::1 dev eth0 metric 2 pref medium
2001:41d0:XXX:YYY::ZZZZ dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
multicast ff00::/8 dev eth0 proto kernel metric 256 pref medium
default via 2001:41d0:XXX:YYY::1 dev eth0 metric 2 pref medium

Better now ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum