From nobody Tue Feb 14 09:04:50 2023 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PGFf55zlVz3rRJ7 for ; Tue, 14 Feb 2023 09:05:01 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from mailout.qeng-ho.org (mailout.qeng-ho.org [217.155.128.244]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PGFf541tHz3MB5 for ; Tue, 14 Feb 2023 09:05:01 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Authentication-Results: mx1.freebsd.org; none Received: from [IPV6:2a02:8010:64c9:1::2] (unknown [IPv6:2a02:8010:64c9:1::2]) by mailout.qeng-ho.org (Postfix) with ESMTP id 04A5324764; Tue, 14 Feb 2023 09:04:53 +0000 (GMT) Message-ID: Date: Tue, 14 Feb 2023 09:04:50 +0000 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: alias addresses both ipv4 and ipv6 Content-Language: en-GB To: Ian Zimmerman , freebsd-questions@freebsd.org References: <20230214010042.it7xu4zgx6ad4cht@beesty.loosely.org> From: Arthur Chance In-Reply-To: <20230214010042.it7xu4zgx6ad4cht@beesty.loosely.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4PGFf541tHz3MB5 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13037, ipnet:217.155.0.0/16, country:GB] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 14/02/2023 01:00, Ian Zimmerman wrote: > Hello, > sorry for the newbie question. We live in the age of migrations. > > I need to have both an IPv4 and an IPv6 alias on the same net > interface, and I am unsure of the numbers in the option names. > If I screw this up I'll lock myself out of the system, so I > better get it right. > > This is the networking part of my rc.conf now, with the obvious > obfuscations. > > > ifconfig_vtnet0="DHCP -tso -rxcsum -txcsum" > #ifconfig_vtnet0_alias0="123.123.123.161/17" > ifconfig_vtnet0_ipv6="inet6 accept_rtadv" > ifconfig_vtnet0_alias0="inet6 dead:beef:dead:beef::2 prefixlen 64" > > The question is how to add the commented out line. > Should it be alias0 (no conflict with the ipv6?), alias1 or what? > > I have read the rc.conf manpage, and sadly it doesn't really answer > this. It discusses each of ipv4 and ipv6 in isolation. > You can mix IPv4 and IPv6 in ifconfig_???_aliases. Here's a chunk of one of my rc.confs - ${ix0pfx} gives the IPv6 prefix for that interface. ifconfig_ix0_aliases=" \ inet 172.23.1.53/32 \ inet6 ${ix0pfx}::1:123/64 \ inet6 ${ix0pfx}::1:143/64 \ inet6 ${ix0pfx}::1:2525/64 \ inet6 ${ix0pfx}::53:1/64 \ inet6 ${ix0pfx}::a53:1/64 \ " As you can see it's one alias per line, with inet/inet6 as relavant for each alias. -- We build our computer systems the way we build our cities; over time, without a plan, on top of ruins. — Ellen Ullman