From owner-freebsd-virtualization@FreeBSD.ORG Sun Jan 11 22:59:53 2015 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93E6AB06; Sun, 11 Jan 2015 22:59:53 +0000 (UTC) Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com [IPv6:2607:f8b0:400d:c04::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C01DCAB; Sun, 11 Jan 2015 22:59:53 +0000 (UTC) Received: by mail-qg0-f42.google.com with SMTP id q108so15614237qgd.1; Sun, 11 Jan 2015 14:59:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=jO4qqRqiAf84By1LZZ/WryI32LSxWUVSn+abzMqjUwk=; b=eK2tZAiRqw7WrSon6ZRkTqgzEFsyvJPKxBRDcafH9XAZb9iENEWc5drP6jmmGHYLFz FiqPFWi54/VmKJINIOkybThP6xSiXKk90p5ozdDsCbXYL1RyIFej44LQMWv6GvHgbVKi 71pl+cdTpObRxd9iv8H54s8xQ1U2QaRb/QsEjJiT/gaXNsf0UADFHkNykPgWAJpqQ4Qo /QpeFqCzwXibmDMW9QtUsVdyvlZAoJ7Btc9Bxb8/WL29gELgNu4sFiVtHHpUyO3YMs3O o4ixip3wUHOnGdLQGHa6ThtAhEJWA5HICzlk6WVfDGgJHNgmkWvSSIW5fKDRcIYx0OdQ INUA== MIME-Version: 1.0 X-Received: by 10.140.20.50 with SMTP id 47mr42240029qgi.61.1421017192396; Sun, 11 Jan 2015 14:59:52 -0800 (PST) Received: by 10.96.218.162 with HTTP; Sun, 11 Jan 2015 14:59:52 -0800 (PST) In-Reply-To: <20150111213203.60018E00B1@smtp.hushmail.com> References: <20150111213203.60018E00B1@smtp.hushmail.com> Date: Sun, 11 Jan 2015 14:59:52 -0800 Message-ID: Subject: Re: ipv4 routing from bhyve From: Jason Cox To: williamecowell@hush.ai Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: freebsd-net@freebsd.org, freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2015 22:59:53 -0000 I am in no way an expert on bhyve (have not used it) so I am going to look at this from a pure network standpoint. A bridge is a layer 2 connection and is used to bridge two separate networks over layer 2. That means they share the same IP subnet, but have no other means of connecting together physically (note: to connect two networks with different IP Subnets IE: 10.10.1.0/24 and 172.16.32.0/24 you use a router since that is layer 3). So with an example like using VirtualHost, when you add a VM and set it to bridge, you are telling VirtualHost you want the VM to be on the same network as your physical machine. Thus from the standpoint of the rest of you network, it "looks" like it is a separate machine. It could even DHCP from your LANs DHCP server and get a LAN IP if you wanted. So your bridge needs to contain the physical interface you want to pass traffic out on (like your wlan0 or lagg0). Then you add your bhyve guests as taps to that bridge to get them access to the same physical network over the bridge. You really do not need to set an IP on the bridge interface, unless say for example you where going to bridge two physical networks together on like em0 and em1. You would assign an IP to bridge0, not em0 or em1 to be able to access/admin the server from either LAN. I hope this helps some... On Sun, Jan 11, 2015 at 1:32 PM, wrote: > Hello, I hope I can have some assistance. > > I am trying to get networking via wlan0 but without NAT or bridging > (doesn't work on wifi unless WDS). > > 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. > > I started to config my bhyve network on 172.16.32.0/24 > > I added a bridge interface with an ip of 172.16.32.1 > > enable forwarding and fastforwarding. from my understanding of the > handbook chapter things should work when I type: > > # 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 > # > > # netstat -4nr > Routing tables > > 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 > # > > bridge0: flags=8843 metric 0 mtu > 1500 > ether 00:bd:0f:fc:01:10 > inet 172.16.32.1 netmask 0xffffff00 broadcast 172.16.32.255 > nd6 options=9 > 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=143 > ifmaxaddr 0 port 6 priority 128 path cost 2000000 > lagg0: flags=8843 metric 0 mtu 1500 > ... > inet 10.10.2.252 netmask 0xffffff00 broadcast 10.10.2.255 > nd6 options=9 > media: Ethernet autoselect > status: active > laggproto failover lagghash l2,l3,l4 > laggport: alc0 flags=1 > laggport: wlan0 flags=4 > tap0: flags=8903 metric 0 mtu 1500 > options=80000 > ether 00:bd:8f:62:67:10 > nd6 options=9 > media: Ethernet autoselect > status: no carrier > wlan0: flags=8843 metric 0 mtu 1500 > ... > pflog0: flags=141 metric 0 mtu 33160 > tap9: flags=8802 metric 0 mtu 1500 > options=80000 > ether 00:bd:cb:46:02:09 > nd6 options=1 > media: Ethernet autoselect > status: no carrier > tap1: flags=8802 metric 0 mtu 1500 > options=80000 > ether 00:bd:58:61:02:01 > nd6 options=1 > media: Ethernet autoselect > status: no carrier > > Willy, > > PS. sorry for the x post as wasn't sure which list.. > > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to " > freebsd-virtualization-unsubscribe@freebsd.org" > -- Jason Cox