Re: ipv4 route with ipv6 local link nexthop ?

Benoit Chesneau <[email protected]>
Newsgroups gmane.os.freebsd.devel.net
Message-ID <-FgPlJYuzDmWOAQb0LNtOn8Ac77pBNwN6ZEJUYGtOLPpc5uNI8Y5Q6Um_Dc__CKTl4TO73AxAgSVaOKtUosKgJM9slRZZQKvcPYQtRu1Iv8=@enki-multimedia.eu>
Hi Zhenlei,

Thanks for testing;, I was about to start a vm for it. The workaround works as well. I

It seems the same issue when you want to set a route on a n interface that doesn't have any IPs.

eg.` route add -net 10.200.1.1/32 -iface vlan200` will not work without adding an IPv4 to the interface.

Benoît

On Wednesday, March 13th, 2024 at 14:09, Zhenlei Huang <[email protected]> wrote:

>> On Mar 13, 2024, at 12:19 PM, Zhenlei Huang <[email protected]> wrote:
>>
>>> On Mar 13, 2024, at 4:36 AM, Benoit Chesneau <[email protected]> wrote:
>>>
>>> On latest freebsd 14.0 release , I am trying to join an ipv4 address over an IPV6 local link using the following command :
>>>
>>> `route add -net 10.200.1.1/32 -inet6 fe80::9439:36ff:fef0:7cbd%vlan200`
>>>
>>> But I get the following error:
>>>
>>> ```
>>> route add -net 10.200.1.1/32 -inet6 fe80::9439:36ff:fef0:7cbd%vlan200
>>> add net 10.200.1.1: gateway fe80::9439:36ff:fef0:7cbd%vlan200 fib 0: Invalid argument
>>
>> I guess that is regression by transition of route(8) to NETLINK.
>
>> Can you please build sbin/route from source without NETLINK and give it another try ?
>>
>> ```
>> # cd /usr/src/sbin/route
>> # setenv MK_NETLINK_SUPPORT no
>> # make
>> ```
>
> Hi Benoit,
>
> I managed to repeat this bug.
>
> As a workaround, add an IPv4 address to the outgoing interface (vlan200 in your case),
> ```
> # ifconfig vlan200 inet x.x.x.x/y
> ```
>
> then retry adding the route
> ```
> # route add -net 10.200.1.1/32 -inet6 fe80::9439:36ff:fef0:7cbd%vlan200
> ```
>
>>> ```
>>>
>>> ping6 to `fe80::9439:36ff:fef0:7cbd%vlan200` works. What I am doing wrong? Configuration of the interface is the following:
>>>
>>> ```
>>> vlan200: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
>>> options=4600703<RXCSUM,TXCSUM,TSO4,TSO6,LRO,RXCSUM_IPV6,TXCSUM_IPV6,MEXTPG>
>>> ether fe:d9:dd:2d:35:c5
>>> inet6 fe80::fcd9:ddff:fe2d:35c5%vlan200 prefixlen 64 scopeid 0x5
>>> groups: vlan
>>> vlan: 200 vlanproto: 802.1q vlanpcp: 0 parent interface: iavf0
>>> media: Ethernet autoselect (10Gbase-SR <full-duplex>)
>>> status: active nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL
>>>
>>> ```
>>>
>>> Benoît
>>
>> Best regards,
>> Zhenlei
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.