- static routes (add into /etc/rc.conf)
static_routes="lan mumoffice foo"
route_lan="-net 192.168.1.0/24 192.168.1.254"
route_mumoffice="-net 10.0.0.0/8 10.30.110.5"
route_foo="-host 1.2.3.4 5.6.7.8"
note:
1.cannot write as follows:
static_routes="lan"
route_lan="-net 192.168.1.0/24 192.168.1.254"
static_routes="mumoffice"
route_mumoffice="-net 10.0.0.0/8 10.30.110.5"
otherwise, only mumoffice static routes will be added.
2. manually add static routing
route add -net
10.0.0.0/8 10.30.110.5
route add -host 1.2.3.4 4.5.6.7
note: for RHEL 5, static routing:
To set static routes, use the /etc/sysconfig/network-scripts/route-<interface> files which read at network service initialization time. For example to add static route for eth0, create a file /etc/sysconfig/network-scripts/route-eth0 and add the routes as explained below.
default via X.X.X.X dev bond0
10.10.10.0/24 via X.X.X.X dev bond0
- mounting usb thumb drive
mount -t msdos /dev/da0s1 /mnt/usb
- ifconfig in /etc/rc.conf
for alias on fxp0, put:
ifconfig_em0="inet 10.20.110.2 netmask 255.255.255.192 "
ifconfig_em0_alias0="inet 10.20.1.226 netmask 255.255.255.0"
ifconfig_em0_alias1="inet 10.20.1.227 netmask 255.255.255.0"
ifconfig_em0_alias2="inet 10.20.1.228 netmask 255.255.255.0"
manual way:add alias: ifconfig em0 inet alias 10.20.1.226 netmask 255.255.255.0
remove alias: ifconfig em0 inet -alias 10.20.1.226 netmask 255.255.255.0
note: enabling ip alias is normally required for doing port forwarding (rdr)
- gateway enable
gateway_enable="yes"
note:
for manually enabling gateway: run command : sysctl -w net.inet.ip.forwarding=1
- DNS and ssh slowness response issue
- add user 'jephe' to allow to use 'su -'
- enable raid1 mirror for hp lp1000r server (refer to http://www.freebsd.org/doc/handbook/geom-mirror.html )
2. run commands below
# sysctl kern.geom.debugflags=16
#gmirror label -v -b round-robin gm0 /dev/da0
#echo geom_mirror_load=YES >> /boot/loader.conf
# vi /etc/fstab (to change all /dev/da0 to /dev/mirror/gm0, :%s#da0#mirror\/gm0#g)
bsd# more /etc/fstab
/dev/mirror/gm0s2b none swap sw 0 0
/dev/mirror/gm0s1a / ufs rw 1 1
/dev/mirror/gm0s4d /usr ufs rw 2 2
# reboot
after reboot, you can use command 'gmirror status' or 'gmirror list' to check the raid1 status
for adding the second hard disk /dev/da1 to raid array, run
# gmirror forget gm0 (optional, depends)
# gmirror insert gm0 /dev/da1
Note: testing raid1
after rebuilding finished (gmirror status to check), you can actually shutdown da0, just use da1 to boot up.
I have tested okay.
- compile kernel to enable ipsec and carp
cp GENERIC /root/MYKERNEL
ln -sf /root/MYKERNEL
vi MYKERNEL to add the following:
# enable IPSEC
options IPSEC
options IPSEC_ESP
options IPSEC_DEBUG
# or enable CARP
device pf
device pflog
device pfsync
device carp
cd /usr/src
make buildkernel KERNCONF=MYKERNEL
make installkernel KERNCONF=MYKERNEL
reboot
- put in /etc/rc.conf for enabling pf
pf_flags=""
pf_rules="/etc/pf.conf"
pflog_logfile="/var/log/pflog"
pflog_flags=""
- mounting cdrom and usb
insert usb thumb drive
mkdir /mnt/usb
mount -t msdos /dev/da0s1 /mnt/usb
- error message '/dev/pf no such file or device'
- add alias
to remove alias
ifconfig bge0 inet -alias 10.0.202.80 netmask 255.255.255.0
to review alias
# ifconfig (without parameters)