Created
February 12, 2016 01:29
-
-
Save gonzopancho/f58516e98f6c8a5a3013 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requires FreeBSD kernel with | |
https://github.com/freebsd/freebsd/commit/cac3f209134f9f95a431a8480d1275c640d86d7d#diff-f4318c2cf4a50c29e6990f3e8a8a5286 | |
https://github.com/freebsd/freebsd/commit/7ab2b8809cd93e9b6da4f2284f4a5851deeff012#diff-f4318c2cf4a50c29e6990f3e8a8a5286 | |
or pfense 2.3 snapshot from 8 Jan 2016 or later | |
1. Launch the first vm with a NIC configured as a vale port: | |
$ bhyve -A -H -P \ | |
-s 0:0,hostbridge \ | |
-s 1:0,lpc \ | |
-s 2,virtio-blk,./disk-vm1 \ | |
-s 3:0,virtio-net,vale0:vm1 \ | |
-l com1,stdio \ | |
-m 1G -c 2 vm1 | |
2. Launch the second vm with a NIC configured as a vale port: | |
$ bhyve -A -H -P \ | |
-s 0:0,hostbridge \ | |
-s 1:0,lpc \ | |
-s 2,virtio-blk,./disk-vm2 \ | |
-s 3:0,virtio-net,vale0:vm2 \ | |
-l com1,stdio \ | |
-m 1G -c 2 vm2 | |
Both vale0:vm1 and vale0:vm2 are now ports on vale0 vswitch. | |
3. Setup the network in each vm: | |
$ ifconfig vtnet0 192.168.1.1 up # in 1st vm | |
$ ifconfig vtnet0 192.168.1.2 up # in 2nd vm | |
4. Ping test | |
# ping -c 5 192.168.1.1 # in 2nd vm | |
PING 192.168.1.1 (192.168.1.1): 56 data bytes | |
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=0.513 ms | |
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.356 ms | |
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.523 ms | |
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.362 ms | |
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.532 ms | |
--- 192.168.1.1 ping statistics --- | |
5 packets transmitted, 5 packets received, 0.0% packet loss | |
round-trip min/avg/max/stddev = 0.356/0.457/0.532/0.080 ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment