Freebsd Port Forwarding.

Jika di linux mungkin sudah sering dilakukan jika di bsd mungkin masih agak kesulitan dan lupa 😛
apa itu port forwarding : contohnya kita punya 1 gateway dan 1 lokal komputer dengan services 80 / httpd . kita tidak ingin install httpd server di gateway kita demi alasan keamanan. maka kita coba buat server di balik gateway but there is something problem. gimana supaya bisa di akses oleh public di internet. nah dari itu kasus kita butuh port forwarding yaitu melompatkan port dari port public ke ip lokal di port lokal, dan melompatkan port lokal dan ip lokal ke public.
contoh:
ip public = 22.22.22.22
ip lokal = 1.2.3.4
kita pengen listen httpd di public 22.22.22.22 port 80 dengan tetapi server tidak di gateway tetapi di lokal maka kita lompatkan port 80 ke ip lokal dan melompatkan ip lokal dan portnya ke public berikut scriptnya:
kalo pake PF :
rdr on interface inbound proto tcp from any to IP server A port 80 -> IP server B port80
kalo pake ipfw
ipfw add rule number forward ipserver B 80 ip from any to ipserver A 80 in via interface inbound

Freebsd permit root login via ssh

mengizinkan root login via ssh, default dari system freebsd tidak mengizinkan root login via remotely. Hal ini dengan satu alasan yaitu keamanan dan ada beberapa bugs di openssh yang menjadikan di system freebsd defaultnya root tidak bisa remotely.
tetapi untuk memudahkan konfigurasi sering kita harus  meng enable kan root via remote(ssh) dengan melempar masalah security ini jauh2 dan  ke arah firewall saja. untuk bisa remote ssh via putty ke mesin maka yang harus kita rubah adalah di file
sshd_config        <<< letaknya ada di /etc/ssh/
coba cari permitrootlogin
sshd_config   <<< ini masi default belum bisa root via ssh
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
sshd_config  <<< setelah dirubah supaya ssh with account root bisa dilakukan
# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
setelah dirubah simpen dengan perintah esc lalu ketik :wq  lalu tekan enter
setelah itu kita reload configurasi sshd kita dengan perintah
lpds-125-163-ardan# /etc/rc.d/sshd reload
Reloading sshd config files.
lpds-125-163-ardan#
===============================================================
selesai sekarang kita coba remote system freebsd kita dengan putty menggunakan account root :P~
login as: root
Using keyboard-interactive authentication.
Password:
Last login: Mon Jun  4 06:16:20 2007 from 192.168.0.101
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California.  All rights reserved.
FreeBSD 6.2-RELEASE (SMP) #0: Fri Jan 12 11:05:30 UTC 2007
Welcome to FreeBSD!
Before seeking technical support, please use the following resources:
o  Security advisories and updated errata information for all releases are
at http://www.FreeBSD.org/releases/ – always consult the ERRATA section
for your release first as it’s updated frequently.
o  The Handbook and FAQ documents are at http://www.FreeBSD.org/ and,
along with the mailing lists, can be searched by going to
http://www.FreeBSD.org/search/.  If the doc distribution has
been installed, they’re also available formatted in /usr/share/doc.
If you still have a question or problem, please take the output of
`uname -a’, along with any relevant error messages, and email it
as a question to the questions@FreeBSD.org mailing list.  If you are
unfamiliar with FreeBSD’s directory layout, please refer to the hier(7)
manual page.  If you are not familiar with manual pages, type `man man’.
You may also use sysinstall(8) to re-enter the installation and
configuration utility.  Edit /etc/motd to change this login announcement.
lpds-125-163-ardan