Skip to content

Instantly share code, notes, and snippets.

@dko1905
Created April 29, 2021 17:09
Show Gist options
  • Save dko1905/96f50a38f1678672ed3e3882d3acb300 to your computer and use it in GitHub Desktop.
Save dko1905/96f50a38f1678672ed3e3882d3acb300 to your computer and use it in GitHub Desktop.
Configuring a FreeBSD 13.0 server

Configuring a FreeBSD 13.0 server

Temporary storage on gist.github.com

Configure internet

Setup static IP, hostname and DNS:

hostname="cool123"
ifconfig_re1="inet 192.168.1.x netmask 255.255.255.0"
defaultrouter="192.168.1.1"
nameserver="1.0.0.1"

Configuring ports

Fetch newest ports:

portsnap fetch
portsnap extract

Change options in make.conf:

# allow compiler optimizations specific to our CPU model
CPUTYPE?=native

# optimization level O2 is the highest supported by FreeBSD and most ports.
CFLAGS=-O2 -pipe -fno-strict-aliasing

# COPTFLAGS only apply when building the kernel
COPTFLAGS=$CFLAGS

# don't pull in X11, CUPS, etc
OPTIONS_UNSET=DOCS NLS X11 EXAMPLES CUPS GUI DEBUG

# disable profiling, unless you like 1hr compile times
MK_PROFILE=no

# default version to use when certain ports are pulled in as dependencies
# ..notice LibreSSL :-)
DEFAULT_VERSIONS+= ssl=libressl python=3.9 python2=2.7 python3=3.9

Now install vim:

# Might take some time
cd /usr/ports/editors/vim && make install clean

I recommend installing theese:

devel/git
editors/vim
ftp/curl
net-mgmt/iftop
ports-mgmt/portmaster
shells/bash
sysutils/coreutils
sysutils/tmux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment