BSD Router - LinuxUserGroupUWSP/RackMesa GitHub Wiki

##Installation

Download the image from https://bsdrp.net/downloads.

Then decompress the img into a stream and pipe it into dd to write it to a flash drive.

xzcat BSDRP_full_amd64_vga.1.0.img.xz | dd of=/dev/[FLASH_DRIVE] bs=256k

Boot off of the flash drive.

Login with root and no password.

Install onto the hard drive.

system install [HARD_DRIVE]

Reboot and log back in.

Use sysrc to allow Quagga (routing daemon manager) to run.

sysrc quagga_enable="yes"
service quagga start

Now you can use the router CLI.

cli

When you're done changing the running config, you should save it to the startup config.

wr

or

copy running-config startup-config

After using the CLI you will want to save your configurations in order to survive a reboot. The config save command will save everything in /etc and /usr/local/etc.

config save

After you have network connectivity, make sure to synchronize your system time. This is very important if you want to use DDNS.

ntpdate -u 0.europe.pool.ntp.org

Set up PXE boot

yum install -y tftp-server
service xinetd restart
yum install -y syslinux

cp -r /usr/share/syslinux/* /var/lib/tftpboot

mkdir /var/lib/tftpboot/pxelinux.cfg

touch /var/lib/tftpboot/pxelinux.cfg/default

vi /var/lib/tftpboot/pxelinux.cfg/default
default menu.c32
prompt 0
timeout 300
ONTIMEOUT local
menu title ########## PXE Boot Menu ##########
label 1
menu label ^1) Install CentOS 7 x64 with Local Repo
kernel centos7/vmlinuz
append initrd=centos7/initrd.img method=ftp://192.168.1.20/pub devfs=nomount
label 2
menu label ^2) Install CentOS 7 x64 with http://mirror.centos.org Repo
kernel centos7/vmlinuz
append initrd=centos7/initrd.img method=http://mirror.centos.org/centos/7/os/x86_64/ devfs=nomount ip=dhcp
label 3
menu label ^3) Install CentOS 7 x64 with Local Repo using VNC
kernel centos7/vmlinuz
append  initrd=centos7/initrd.img method=ftp://192.168.1.20/pub devfs=nomount inst.vnc inst.vncpassword=password
label 4
menu label ^4) Boot from local drive

LUG Configurations

ifconfig bge0.1 create >> /etc/rc.local

ifconfig bge0.2 create >> /etc/rc.local

ifconfig bge0.3 create >> /etc/rc.local

ifconfig bge0.4 create >> /etc/rc.local

ifconfig bge0.5 create >> /etc/rc.local

int bge1
ip address 143.236.254.130/28
ip address 143.236.254.131/28
ip address 143.236.254.132/28
ip address 143.236.254.133/28
ip address 143.236.254.134/28
ip address 143.236.254.135/28

no shutdown

int bge0
ip address 10.0.0.1/24
no shutdown

int bge0.1
ip address 10.0.1.1/24
no shutdown

int bge0.2
ip address 10.0.2.1/24
no shutdown

int bge0.3
ip address 10.0.3.1/24
no shutdown

int bge0.4
ip address 10.0.4.1/24
no shutdown

int bge0.5
ip address 10.0.5.1/24
no shutdown

ip route 0.0.0.0/0 143.236.254.129


sysrc pf_enable="yes"

vi /etc/pf.conf

ext_if = "bge1"
int_if = "bge0"

nat on $ext_if from $int_if:network to any -> ($ext_if)
pass from { lo0, $int_if:network } to any keep state

nat on $ext_if from $int_if:network to any -> 143.236.254.130
nat on $ext_if from $int_if.1:network to any -> 143.236.254.131
nat on $ext_if from $int_if.2:network to any -> 143.236.254.132
nat on $ext_if from $int_if.3:network to any -> 143.236.254.133
nat on $ext_if from $int_if.4:network to any -> 143.236.254.134
nat on $ext_if from $int_if.5:network to any -> 143.236.254.135

pfctl -f /etc/pf.conf  >> /etc/rc.local