diskutier list
sudo diskutil partitionDisk /dev/disk2 1 MBR "Free Space" "%noformat%" 100%
sudo dd bs=1m if=2015-11-21-raspbian-jessie-lite.img of=/dev/rdisk2
Just another fucking site
diskutier list
sudo diskutil partitionDisk /dev/disk2 1 MBR "Free Space" "%noformat%" 100%
sudo dd bs=1m if=2015-11-21-raspbian-jessie-lite.img of=/dev/rdisk2
Bhyve – Guest openbsd
#!/bin/sh grub-bhyve -m obsd57.map -r hd0,msdos1 -M 1024M openbsd < obsd57.in bhyve -w -AI -H -P -s 0:0,hostbridge \ -s 1:0,lpc -s 2:0,virtio-net,tap2 \ -s 3:0,virtio-blk,./disk.img \ -l com1,stdio -c 2 \ -m 1024M openbsd
kopenbsd -h com0 -r sd0a (hd0,openbsd1)/bsd boot
(hd0) ./disk.img (cd0) ./install57.iso
#!/bin/sh bhyvectl --destroy --vm=openbsd
FreeBSD avec bhyve et libvirt
pkg install -y libvirt
libvirtd_enable="YES"
vmm_load="YES" nmdm_load="YES"
truncate alcsys-vm51.img -s 100G
wget http://xxxxx/CentOS-7-x86_64-Minimal-1511.iso
# cat device.map (hd0) ./alcsys-vm51.img (cd0) ./CentOS-7-x86_64-Minimal-1511.iso
grub-bhyve -m device.map -r cd0 -M 2048 alcsys-vm51
linux (cd0)/isolinux/vmlinuz initrd (cd0)/isolinux/initrd.img boot
ifconfig tap1 create
bhyve -AI -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,tap1 -s 3:0,virtio-blk,./alcsys-vm51.img -s 4:0,ahci-cd,./CentOS-7-x86_64-Minimal-1511.iso -l com1,stdio -c 4 -m 2048M alcsys-vm51
bhyvectl --destroy --vm=alcsys-vm51
grub-bhyve -m device.map -r hd0,msdos1 -M 2048M alcsys-vm51
configfile (hd0,msdos1)/grub2/grub.cfg
bhyve -AI -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,bridge0 -s 3:0,virtio-blk,./alcsys-vm51.img -l com1,stdio -c 4 -m 2048M alcsys-vm51
echo "configfile (hd0,msdos1)/grub2/grub.cfg" | grub-bhyve -m device.map -r hd0,msdos1 -M 2048M alcsys-vm51 bhyve -AI -H -P -s 0:0,hostbridge -s 1:0,lpc -s 2:0,virtio-net,bridge0 -s 3:0,virtio-blk,./alcsys-vm51.img -l com1,stdio -c 4 -m 2048M alcsys-vm51
<domain type='bhyve' id='97406'> <name>alcsys-vm51</name> <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid> <memory unit='KiB'>2097152</memory> <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>2</vcpu> <bootloader>/usr/local/sbin/grub-bhyve</bootloader> <bootloader_args>--directory=/grub2 --grub-cfg=grub.cfg -r hd0,msdos1 -m /vm/alcsys-vm51.map -M 2048 alcsys-vm51</bootloader_args> <os> <type arch='x86_64'>hvm</type> </os> <features> <acpi/> <apic/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> <disk type='file' device='disk'> <driver name='file' type='raw'/> <source file='/vm/alcsys-vm51.img'/> <backingStore/> <target dev='vdb' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </disk> <controller type='pci' index='0' model='pci-root'/> <controller type='sata' index='0'/> <interface type='bridge'> <mac address='52:54:00:c6:2d:7c'/> <source bridge='bridge0'/> <target dev='vnet1'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </interface> <serial type='nmdm'> <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/> <target port='0'/> </serial> <console type='nmdm'> <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/> <target type='serial' port='0'/> </console> </devices> </domain>
# cat /vm/alcsys-vm51.map (hd0) /vm/alcsys-vm51.img
virsh define alcsys-vm51.xml
virsh start alcsys-vm51
# virsh list Id Name State ---------------------------------------------------- 37911 alcsys-vm51 running
virsh console alcsys-vm51
tail -f /var/log/libvirt/bhyve/alcsys-vm51.log
Un petit problème s’est posé lors d’un besoin très spécifique consistant à rediriger temporairement le traffic http d’une jail vers une autre jail hébergée sur un autre serveur ayant sa propre GW.
En image, cela sera plus parlant:
Comme on peut le voir; avec une simple règle RDR, le traffic retour repartait sur la gw du Server B (WAN) au lieu de revenir par son chemin original (LAN).
La solution est d’ajouter sur le ServerA une règle PF indiquant de réutiliser une interface particulière – en l’occurence la même que celle utilisée pour l’allée – pour le chemin du retour du paquet.
La règle:
pass in quick on vlan10 reply-to (vlan10 192.168.10.6) proto tcp from any to 192.168.10.206 port http keep state label pra.nli.http
Maintenant le paquet emprunte la même interface pour l’allée et le retour.