OpenBSD
Install
Steps
- Choose (I)nstall
- Keyboard layout: en (or sf)
- System hostname
- Network interfaces to be configured
- em
- wpi
- Need the firmware to be ready (could not read firmware wpi-3945abg)
- https://superuser.com/a/832026/578935
- vlan
- DNS domain name: my.domain
- DNS nameservers: none
- Password for root account
- Start sshd by default: yes
- Start X Window System by xenodm: no
- Setup a user: yes
- Allow root ssh login: no
- Which disk is the root disk?
- Disk layout
- Location of sets: disk, is mounted: no
- Timezone: Europe/Paris
Firmware
- Check for missing firmware with
fw_update -vi. - Install or update firmware for all drivers with
fw_update -a(Internet connection required). - Or download non-free firmware here and install them with
fw_update -p <dir>, the.tgzfirmware must be in the directory specified, no need to extract.
Creating a bootable USB from macOS
- Download
installXX.fs(includes file sets, unlikeminirootXX.fs) - Insert USB key
- Get USB key device node
diskutil list(e.g./dev/disk2) - Unmount key:
diskutil unmountDisk /dev/diskX - Write installer to key:
sudo dd if=installXX.fs of=/dev/rdiskX bs=1m - macOS will say the key can’t be read but that’s okay.
- https://superuser.com/questions/631592/why-is-dev-rdisk-about-20-times-faster-than-dev-disk-in-mac-os-x
- http://osxdaily.com/2015/06/05/copy-iso-to-usb-drive-mac-os-x-command
- https://www.openbsd.org/faq/faq4.html
Partition layout
One partition layout
- Use (C)ustom layout
- Delete all partitions with
d * - Create swap with
a band with size e.g. 512M - Create main partition with
awith mount point/
Info: partion b is swap, partition c is whole disk
Bigger /usr for ports
- To use whole disk: W for MBR, G for GPT
- (E)dit auto layout
- p g prints all partitions
- R f resize auto allocated partition (f = /usr)
- Input new size, e.g. 25g
- q save & quit
Relayd
- Daemon is
relayd, control isrelayctl - Conf is at
/etc/relayd.conf. - Interesting command is
relayctl show summary. /etc/rc.conf.localmust be modified to start relayd at startup.anchor "relayd/*”must be added in/etc/pf.conf.- The forward IPv6 address is the local IPv4 address converted to IPv6 address:
relay tcp6to4 { listen on <ipv6 address> port 80 forward to 0:0:0:0:0:ffff:c0a8:65 port 8080 inet }
Cron jobs
- Edit cron jobs with
crontab -e. - List them with
crontab -l.SHELL=/bin/sh PATH=/bin:/usr/bin:/usr/local/bin HOME=/var/log */5 * * * * /home/user/script.sh
/etc/hostname.if
Config for DHCP and IPv6
dhcp
inet6 autoconf
inet6 alias <ipv6>
/etc/sysctl.conf
Config for IPv6?
net.inet6.ip6.forwarding=0
net.inet6.ip6.accept_rtadv=1
Mounting a USB drive
Get the list of disks:
$ sysctl hw.disknames
hw.disknames=wd0:,cd0:,sd0:
Find out which partition to mount:
$ disklabel sd0
# /dev/rsd0c
type: SCSI
…
16 partitions:
# …
i: <size> <offset> <fstype>
Create the mount folder:
$ mkdir /mnt/folder
Mount the drive:
$ mount -t <fstype> /dev/sd0i /mnt/folder
Misc
pkg_info -mlist of manually installed packages- Set
pkg_path? /etc/installurlmust not be empty: