Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jan 2015 11:54:43 -0500
From:      Allan Jude <allanjude@freebsd.org>
To:        freebsd-virtualization@freebsd.org
Subject:   Re: ipv4 routing from bhyve
Message-ID:  <54B3FC53.3080900@freebsd.org>
In-Reply-To: <20150111213203.60018E00B1@smtp.hushmail.com>
References:  <20150111213203.60018E00B1@smtp.hushmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--GpLfWkt1VkxDEghiGsKD4BimKimlghjeW
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 2015-01-11 16:32, williamecowell@hush.ai wrote:
> Hello, I hope I can have some assistance.
>=20
> I am trying to get networking via wlan0 but without NAT or bridging (do=
esn't work on wifi unless WDS).
>=20
> say my my main network is 10.10.2.0/24, gateway/internet is 10.10.2.1, =
my ip is 10.10.2.252.
>=20
> I started to config my bhyve network on 172.16.32.0/24
>=20
> I added a bridge interface with an ip of 172.16.32.1
>=20
> enable forwarding and fastforwarding. from my understanding of the hand=
book chapter things should work when I type:
>=20
> # route add -net 172.16.32.0/24 10.10.2.252
> route: writing to routing socket: File exists
> add net 172.16.32.0: gateway 10.10.2.252 fib 0: route already in table
> #=20
>=20
> # netstat -4nr
> Routing tables
>=20
> Internet:
> Destination        Gateway            Flags      Netif Expire
> default            10.10.2.1        UGS       lagg0
> 127.0.0.1          link#3             UH          lo0
> 10.10.2.0/24     link#5             U         lagg0
> 10.10.2.252      link#5             UHS         lo0
> 172.16.32.0/24    link#4             U       bridge0
> 172.16.32.1       link#4             UHS         lo0
> #=20
>=20
> bridge0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 =
mtu 1500
> 	ether 00:bd:0f:fc:01:10
> 	inet 172.16.32.1 netmask 0xffffff00 broadcast 172.16.32.255=20
> 	nd6 options=3D9<PERFORMNUD,IFDISABLED>
> 	id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
> 	maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
> 	root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
> 	member: tap0 flags=3D143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
> 	        ifmaxaddr 0 port 6 priority 128 path cost 2000000
> lagg0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mt=
u 1500
> ...
> 	inet 10.10.2.252 netmask 0xffffff00 broadcast 10.10.2.255=20
> 	nd6 options=3D9<PERFORMNUD,IFDISABLED>
> 	media: Ethernet autoselect
> 	status: active
> 	laggproto failover lagghash l2,l3,l4
> 	laggport: alc0 flags=3D1<MASTER>
> 	laggport: wlan0 flags=3D4<ACTIVE>
> tap0: flags=3D8903<UP,BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu=
 1500
> 	options=3D80000<LINKSTATE>
> 	ether 00:bd:8f:62:67:10
> 	nd6 options=3D9<PERFORMNUD,IFDISABLED>
> 	media: Ethernet autoselect
> 	status: no carrier
> wlan0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mt=
u 1500
> ...
> pflog0: flags=3D141<UP,RUNNING,PROMISC> metric 0 mtu 33160
> tap9: flags=3D8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	options=3D80000<LINKSTATE>
> 	ether 00:bd:cb:46:02:09
> 	nd6 options=3D1<PERFORMNUD>
> 	media: Ethernet autoselect
> 	status: no carrier
> tap1: flags=3D8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	options=3D80000<LINKSTATE>
> 	ether 00:bd:58:61:02:01
> 	nd6 options=3D1<PERFORMNUD>
> 	media: Ethernet autoselect
> 	status: no carrier
>=20
> Willy,
>=20
> PS. sorry for the x post as wasn't sure which list..
>=20
> _______________________________________________
> freebsd-virtualization@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@fr=
eebsd.org"
>=20

You can use ip forwarding (or fast forwarding) to send traffic generated
on the new subnet (172.16.32.0/24) out to your network. But unless you
configure a static route (or setup a routing protocol like RIP), the
other hosts on your network will not know how to reach 172.16.32.0/24 to
reply. So the static route you were trying to add, would need to be
added to every machine EXCEPT the VM Host, which already has an IP in
that subnet.

--=20
Allan Jude


--GpLfWkt1VkxDEghiGsKD4BimKimlghjeW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQIcBAEBAgAGBQJUs/xWAAoJEJrBFpNRJZKfeMkP/irmCtZPYndktcNBrmpsTcYB
iaDzLOy+k1+hk3POyBYTgeqhtu2ttEcuRvO4szPTQ4uwNQDMFqYlKO73iwy/tgTn
uRZwenP9yE4IJfwC+fUKvKs2puUA/U8Aay1FOptC5/4xZH/m/f8IbsO+dI7ql1si
OLTaN0q1vikECp8mZsbImojRRYMvHIF3VqLshByYWRDSNxG+m9NVJXNPkpm9YLZW
Vlo2+0EhdLKSPyqRCh4lLT/QhIUMsg2u4ISBN6kLXt9qzvdNR1xZC8JaP9JttxRN
poJt3St48oWAEmPlmT2OWl3bLcw1RXHg/GOcN/JBnJ33ZiGBv+72nHYCv65YVE/r
3YQM3rGtG8+W3qhmUZpnV9lCZjZxd4NcrxvvQ2hVa90YYZhKfMmkM/BSVTln0t1g
2JuHgYV9V13tlItXbaboxq3HyLdS/2Za/5ROi8748MutjH2dvZXa+g90Ld/wYBCT
fL1q3XJ2sNCNPCNtNkj2G++dASdKtReqLJ9iseutd7c4UVpIkpUcBbRnHD6M8w6d
MYrw8f6VRODjPCpVQlqZFfCL7yLikDicL0qgI1xUgd4fU+4LRxoY/LAz8L+nXhM2
9p9bZIZBrUewxIm7JmXNfhXJSXkCSHxaEW/q+W61HkWJU1IQ2di57xWHVqPbNxGG
zudWQK0rK0QP7b3olAlG
=HhdC
-----END PGP SIGNATURE-----

--GpLfWkt1VkxDEghiGsKD4BimKimlghjeW--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54B3FC53.3080900>