Random notes
For su
to work you have to add users to wheel group
pw groupmod wheel -m <user>
Configure color ls
# edit /etc/csh.login
setenv CLICOLOR
Create a bridge with name br-test
, set link up and enable ipv6
ifconfig bridge create name br-test up inet6 accept_rtadv auto_linklocal -ifdisabled
Delete bridge
ifconfig br-test destroy
Add device to the bridge and enable stp on that port
ifconfig br-test addm em1 stp em1
ifconfig em1 up # link must also be up for it to work
Delete device from bridge
ifconfig br-test deletem em1
Notes about vlan setup under FreeBSD
I also asked about this in FreeBSD forums
Only tagged traffic can be received and sent. Every VLAN needs a new bridge because you can't create VLAN interfaces on top of the bridge directly, gives a "ifconfig: SIOCIFCREATE2: Protocol not supported" error.
ifconfig em0 name lan0 up
ifconfig em1 name lan1 up
ifconfig vlan create vlan 10 vlandev lan0 name lan0.10
ifconfig vlan create vlan 10 vlandev lan1 name lan1.10
ifconfig vlan create vlan 101 vlandev lan0 name lan0.101
ifconfig vlan create vlan 101 vlandev lan1 name lan1.101
ifconfig bridge create name br-test.10 up
ifconfig br-test.10 addm lan0.10 stp lan0.10 addm lan1.10 stp lan1.10
ifconfig bridge create name br-test.101 up
ifconfig br-test.101 addm lan0.101 stp lan0.101 addm lan1.101 stp lan1.101
Uses epair interfaces meant for vnet jails to tap VLANs from the bridge. This seems to work but is not documented anywhere. Traffic from host has to go through the epair interface. New vlan's can be easily created on the epair interface.
ifconfig em0 name lan0 up
ifconfig em1 name lan1 up
ifconfig bridge create name br-test up
ifconfig br-test addm lan0 stp lan0 addm lan1 stp lan1
ifconfig epair create name br-test-trunk up
ifconfig epair0b name br-test-con up
ifconfig br-test addm br-test-con
ifconfig vlan create vlan 10 vlandev br-test-trunk name br-test.10 up
ifconfig vlan create vlan 101 vlandev br-test-trunk name br-test.101 up
Everything is done through geom
lsblk(8) for freebsd, github link
FreeBSD kernel can print its geom configuration as parsable formats
sysctl kern.geom.confxml
sysctl kern.geom.confdot
sysctl kern.geom.conftxt
some script to parse that sysctl output: geom_show
It turns out that UFS under FreeBSD supports snapshots. Up to 20 can be created.
mount -u -o snapshot /.snap/mysnapshot /
Other option is to use mksnap_ff
mksnap_ff /.snap/mysnapshot
After that /.snap/mysnapshot file works as a read only filesystem image that can be dd
or fsck
or event mounted.
To delete the snapshot use rm
rm -f /.snap/mysnapshot
fetch
instead of wget
to disable tls cert verification:
fetch --no-verify-peer https://host/path
mkdir -p /var/jail/testj
cd /var/jail
fetch --no-verify-peer https://download.freebsd.org/ftp/releases/amd64/12.1-RELEASE/base.txz