How to make pflog interface permanent

I was searching preaty long time for solution of my problem that i described bellow:
Every time I have created log interface by typing:

ifconfig pflog2 create

also redirect log from it to the file

pflogd -i pflog2 -f /var/log/2.log

and restarted the system – configurtion was cleared …
I tried many things to achieve success …. no results
Finally i decided to do it in the funny way :

echo “ifconfig pflog2 create” >>/etc/rc.local
echo “pflogd -i pflog2 -f /var/log/2.log” >>/etc/rc.local

It’s functioning.
I couldn’t find better way to do that.

htop – could not read procfs

After installation of htop you can often see

Error: could not read procfs (compiled to look in /compat/linux/proc).

there is some operations you should do :

1. Install linux_base-f10

[root@gw-ds14 ~]# pkg install linux_base-f10
Updating FreeBSD repository catalogue…
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 1 packages will be affected (of 0 checked):

New packages to be INSTALLED:
linux_base-f10: 10_8

The process will require 135 MB more space.
17 MB to be downloaded.

Proceed with this action? [y/N]: y
Fetching linux_base-f10-10_8.txz: 100% 17 MB 1.6M/s 00:11
Checking integrity… done (0 conflicting)
[1/1] Installing linux_base-f10-10_8: 100%

+++ Please mount linprocfs manually! +++

Running linux ldconfig…
[root@gw-ds14 ~]#

2. Enable linux in rc.conf

[root@gw-ds14 ~]# echo ‘linux_enable=”YES”‘ >> /etc/rc.conf

3. Add linproc to fstab

[root@gw-ds14 ~]# echo ‘linproc  /compat/linux/proc     linprocfs rw    0       0’ >>/etc/fstab

4. Mount linproc

[root@gw-ds14 ~]# mount -a

5. Run htop

htop

 

Configuring unbound

Unbound is default dns server in FreeBSD10.

Configuration sample file you’ll find in

/usr/local/etc/unbound/unbound.conf.sample

Obviously config file shouldn’t have “.sample” config name postfix

My “eyasy mode” for unbound (forwarding only dns) have really short conf :

server:
interface: 10.214.0.1
access-control: 10.214.0.0/16 allow
verbosity: 1

forward-zone:
name: “.”
forward-addr: 8.8.8.8 # Google Public DNS
forward-addr: 74.82.42.42 # Hurricane Electric
forward-addr: 4.2.2.4 # Level3 Verizon

and restart service by

[root@gw-ds14 ~]# service unbound restart
Stopping unbound.
Waiting for PIDS: 823.
Obtaining a trust anchor:Starting unbound.

Looks fine for now 🙂

Last thing you should do is check how your dns is responding (i checked from win7 machine):

C:\Users\User>nslookup o2.pl 10.214.0.1
Server: UnKnown
Address: 10.214.0.1

Non-authoritative answer:
Name: o2.pl
Addresses: 2001:67c:25c4::103
193.17.41.103

C:\Users\User>

Seams ok.

Ps1. Don’t forget to unlock 53 udp port on your firewall.
Ps2. If you are planning to test dns from localmachine you should install nslookup (which is not installed by default)

[root@gw-ds14 ~]# pkg install bind-tools
Updating FreeBSD repository catalogue…
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 2 packages will be affected (of 0 checked):

New packages to be INSTALLED:
bind-tools: 9.10.1_3
idnkit: 1.0_5

The process will require 26 MB more space.
3 MB to be downloaded.

Proceed with this action? [y/N]: y
Fetching bind-tools-9.10.1_3.txz: 100% 2 MB 2.5M/s 00:01
Fetching idnkit-1.0_5.txz: 100% 189 KB 193.2k/s 00:01
Checking integrity… done (0 conflicting)
[1/2] Installing idnkit-1.0_5: 100%
[2/2] Installing bind-tools-9.10.1_3: 100%
[root@gw-ds14 ~]#

success again 🙂

 

FreeBSD + full keboard support for bash

It’s preatty anoing when your bash console is giving you ~~~~~ for home, end or del key.

Easy way to get it work is set an environment variables by adding to your /etc/profile file line :

export INPUTRC=/usr/local/etc/inputrc

and fill this file with content

set meta-flag on
set input-meta on
set convert-meta off
set output-meta on
“\e[1~”: beginning-of-line
“\e[4~”: end-of-line
“\e[5~”: beginning-of-history
“\e[6~”: end-of-history
“\e[3~”: delete-char
“\e[2~”: quoted-insert
“\e[5C”: forward-word
“\e[5D”: backward-word

don’t forget to chmod  the file  🙂
To see effects relogin or just put

bash

into console

Bash as default shell 4 your user.

I love bash – that’s why I setted it as default for my root 🙂

[root@gw-ds14 ~]# whereis bash
bash: /usr/local/bin/bash /usr/local/man/man1/bash.1.gz /usr/ports/shells/bash
[root@gw-ds14 ~]# chsh -s /usr/local/bin/bash root
chsh: user information updated