From owner-freebsd-net@freebsd.org Wed Sep 16 18:54:37 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 551293EE806 for ; Wed, 16 Sep 2020 18:54:37 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bs8Qz6scgz4723 for ; Wed, 16 Sep 2020 18:54:35 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 08GIsRft047324 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 16 Sep 2020 11:54:27 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 08GIsRuF047323; Wed, 16 Sep 2020 11:54:27 -0700 (PDT) (envelope-from jmg) Date: Wed, 16 Sep 2020 11:54:27 -0700 From: John-Mark Gurney To: Abelenda Diego Cc: kaycee gb , freebsd-net@freebsd.org Subject: Re: IP "routing" issue Message-ID: <20200916185427.GQ4213@funkthat.com> Mail-Followup-To: Abelenda Diego , kaycee gb , freebsd-net@freebsd.org References: <20200909164254.5e7e3891@debian> <20200910185400.593a8ce2@debian> <20200915191052.GN4213@funkthat.com> <20200916182141.2705bb70@debian> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="k+8GP5RjC/E7LQ/F" Content-Disposition: inline In-Reply-To: <20200916182141.2705bb70@debian> X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Wed, 16 Sep 2020 11:54:28 -0700 (PDT) X-Rspamd-Queue-Id: 4Bs8Qz6scgz4723 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 208.87.223.18) smtp.mailfrom=jmg@gold.funkthat.com X-Spamd-Result: default: False [-2.75 / 15.00]; TO_DN_SOME(0.00)[]; SIGNED_PGP(-2.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:32354, ipnet:208.87.216.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.91)[-0.910]; FREEFALL_USER(0.00)[jmg]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.06)[0.057]; NEURAL_HAM_LONG(-0.99)[-0.995]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[funkthat.com]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FREEMAIL_CC(0.00)[hotmail.fr,freebsd.org]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-net]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 18:54:37 -0000 --k+8GP5RjC/E7LQ/F Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Abelenda Diego wrote this message on Wed, Sep 16, 2020 at 18:21 +0200: > Thank you for your input. >=20 > Due to how convoluted the change in the configuration of FreeBSD would ha= ve > been I had to completely change my infrastructure to match the vision my > datacenter unilaterally imposed on me... So now I don't have this need an= ymore. Ok. Glad you were able to solve your problem, though obviously not the way= you wanted to. Just for the archives, this style of routing should work fine in FreeBSD. > On Tue, 15 Sep 2020 12:10:52 -0700 > John-Mark Gurney wrote: >=20 > > Abelenda Diego wrote this message on Thu, Sep 10, 2020 at 18:54 +0200: > > > Hello, > > >=20 > > > Thank you for pointing route "-iface" however I can't seem to manage = what I > > > want. > > >=20 > > > When I use: > > > "route add -host $IP_NOT_IN_SUBNET -iface bce0" > > >=20 > > > I get "netstat -rn" to say someting like: > > >=20 > > > Internet: > > > Destination Gateway Flags Netif Expire > > > default $UPSTREAM_GW UGS bce0 > > > 10.0.0.1 link#7 UHS lo0 > > > $IP_NO_IN_SUBNET $MAC_ADDRESS_OF_BCE0 UHS bce0 > > >=20 > > >=20 > > > Which seem somehow appropriate, so I try to ping $IP_NOT_IN_SUBNET an= d I > > > get: > > >=20 > > > root@opnsense2:~ # ping $IP_NOT_IN_SUBNET > > > PING $IP_NOT_IN_SUBNET ($IP_NOT_IN_SUBNET): 56 data bytes > > > 36 bytes from $UPSTREAM_GW: Redirect Host(New addr: $PUBLIC_IP_OF_BCE= 0). > > >=20 > > > Which doesn't seem appropriate at all wrt the routing table... > > >=20 > > > Did I use "route add" wrong? > > >=20 > > > Also I want to keep the setup simple, going through private IPs on the > > > public VLAN of the datacenter might get me in trouble with them, and = using > > > other VLANs for that will be a pain. =20 > >=20 > > Can you provide a diagram of the network layout, and where the > > configuration needs to go? Because if it's just the opnsense box that > > needs the IP addresses, adding them as an alias to bce is enough to > > make it work. > >=20 > > If you're trying to do something else, like have boxes behind the > > opnsense box have those IP addresses, then: > > route add $IP_NO_IN_SUBNET $IP_OF_BOX_WITH_IP_NO_IN_SUBNET > >=20 > > would just work. > >=20 > > I just noticed the 10.0.0.1 IP on lo0, and that's a bit odd to have... > >=20 > > > On Wed, 9 Sep 2020 17:35:45 +0200 > > > kaycee gb wrote: > > > =20 > > > > Le Wed, 9 Sep 2020 16:42:54 +0200, > > > > Abelenda Diego a =E9crit : > > > > =20 > > > > > Hello, > > > > >=20 > > > > > I've got a FreeBSD installation in a DataCenter that provided me = with a > > > > > single address IPv4 with an upstream gateway (cidr is fine the up= stream > > > > > gateway works everything is nice and running). I use this machine= for > > > > > Masquerading an private infrastructure. > > > > >=20 > > > > > Now I need other machines with public IPv4 and when I requested t= he > > > > > additional IPv4 to the DataCenter, they gave me a bunch of /32 ad= dresses > > > > > saying that my previous IPv4 MUST be configured as next-hop on th= eir > > > > > side. From my understanding in FreeBSD the route command is unabl= e to > > > > > perform this kind of configuration where you tell that the IPv4 /= 32 is > > > > > available without next-hop (no via) on a specific link. I know the > > > > > linux "ip route add $IP dev $LINK" configures this, but I cannot = seem > > > > > to map this knowledge to FreeBSD. > > > > >=20 > > > > > Is it possible to perform this very special setup with any comman= d on > > > > > FreeBSD? If yes what is that command? > > > > >=20 > > > > > Best regards, > > > > > Diego Abelenda =20 > > > >=20 > > > > Hi, > > > >=20 > > > > Do the other machines have a private address ? Is it a problem if t= hey > > > > have one ?=20 > > > > If it is possible, you can route via this private address on your F= reeBSD > > > > installation to the new one and assign a public/32 to the last. > > > >=20 > > > > Alternatively to doing routing like above, if you have a firewall e= nabled > > > > on the first machine, you can do address forwarding between the fir= st and > > > > the new one.=20 > > > >=20 > > > > And last, maybe with something like -iface from "route" you can ach= ieve > > > > what you want. =20 --=20 John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --k+8GP5RjC/E7LQ/F Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJfYl9iXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2MEI1RTRGMTNDNzYyMDZDNjEyMDBCNjAy MDVGMEIzM0REMDA2QURBAAoJECBfCzPdAGraB1kP/iqm+c1McTBkIu7gL4nLT+wv QfBa/RUAoCy2JtHAqPKD2o+VcPeqARTQ4EFiEHm5POKsE7KQBz8OAMTo0lKjL5yN cA7NFOqvo9LhKne5wqgmZV04dGW198BPcps8bOv2vulTuY2nJBmHVJ2Z0wF4nQoL seJLm/1IOQYuozTW3PXx//c0n5Kk/f//jh0ljlq1zVscLPTOMLQUyK31jqU5JM89 zWq5sJKN16aC/ganEda7EOqUuH/rH2ed5XtP5mxNIQssiTl7DxCMWn/+30df7KFX NytF+YO7X3PInVIlVE5v4i7KRKifHzCXWkbw2ms2CfIXnWaDLCV6giMIiTgpt9OC T6gk9bbRxwk4RPcR1Y3PVjTh862kRswACiwvnq2nVGvUfnx8mCErvOwjW37KoHVH 7uYJ0mYL9sQuxdpOYr/IYV4uMmpThUHbddGSZPFB4aV6EJT3/w2rlTWaKAlNP61L wYmbvkd9TUtXqqgdWLoY7eXaCpYnvfhpN/jVcAaTfgUF8TNKwvQhCAkF6YnqdFfm POECjBOHAt/Hffg2EbBYAcY9yStz/+CENFTtkqSpTyEE1z9Z4hFGEC9dF/Ha9SXJ ezLkksH6Cas8HtJq9jQL5He1bdJxPqf+o5r2BgP/rxcSBskp8K3r8SV7QGq5Kr15 z44AVUXDjNe/TtU/STwF =TsAj -----END PGP SIGNATURE----- --k+8GP5RjC/E7LQ/F--