Berjumpa kembali dengan saya dprasit solutions / dprasit19. Di blogger saya ini berisikan tutorial-tutorial yang berhubungan dengan dunia Networking dan Sysadmin yang ingin memperdalam dan belajar seperti saya ini. Dalam artikel kali ini saya akan membahas tentang bagaimana membuat router menggunakan operating system FreeBSD. Sebelum melakukan konfigurasi router terlebih dahulu kita menginstall operating systemnya seperti artikel ini : Cara install OS FreeBSD
Langsung saja kita masuk dalam langkah-langkah konfigurasi. Disini saya akan membuat beberapa kasus diataranya :
1. WAN STATIC - LAN STATIC
root@router2:/usr/home/adit#ee /etc/rc.conf
hostname="router2.jdn.id"i
ifconfig_em0="inet 202.47.88.222 netmask 255.255.255.0"
ifconfig_em1="inet 22.22.22.1 netmask 255.255.255.0"
defaultrouter="202.47.88.221"
#SSH
sshd_enable="YES"
#GATEWAY
gateway_enable="YES"
firewall_enable="YES"
firewall_type="OPEN"
#NATD
natd_enable="YES"
natd_interface="em0"
natd_flags="-f /etc/natd.conf"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
root@router2:/usr/home/adit# ee /etc/natd.conf
port 8668
interface em0
2. WAN DHCP - LAN STATIC
root@router2:/usr/home/adit#ee /etc/rc.conf
hostname="router2.jdn.id"i
fconfig_em0="DHCP"
ifconfig_em1="inet 12.12.12.1 netmask 255.255.255.0"
#SSH
sshd_enable="YES"
#GATEWAY
gateway_enable="YES"
firewall_enable="YES"
firewall_type="OPEN"
#NATD
natd_enable="YES"
natd_interface="em0"
natd_flags="-f /etc/natd.conf"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
root@router2:/usr/home/adit# ee /etc/natd.conf
port 8668
interface em0
3. WAN DHCP - LAN DHCP
root@router2:/usr/home/adit#pkg install isc-dhcp44-server
root@router2:/usr/home/adit # ee /usr/local/etc/dhcpd.conf
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# option definitions common to all supported networks...
option domain-name "jdn.id";
option domain-name-servers 1.1.1.1, 64.6.64.6;
default-lease-time 600;
max-lease-time 7200;
# Use this to enble / disable dynamic dns updates globally.
#ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
#subnet 10.152.187.0 netmask 255.255.255.0 {
#}
# This is a very basic subnet declaration.
subnet 12.12.12.0 netmask 255.255.255.0 {
range 12.12.12.10 12.12.12.20;
option routers 12.12.12.1;
}
root@router2:/usr/home/adit#ee /etc/rc.conf
hostname="router2.jdn.id"i
fconfig_em0="DHCP"
#SSH
sshd_enable="YES"
#GATEWAY
gateway_enable="YES"
firewall_enable="YES"
firewall_type="OPEN"
#NATD
natd_enable="YES"
natd_interface="em0"
natd_flags="-f /etc/natd.conf"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
#DHCPD SERVER
dhcpd_enable="YES"
dhcpd_flags="-q"
dhcpd_conf="/usr/local/etc/dhcpd.conf"
dhcpd_ifaces="em1"
dhcpd_withumask="022"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
root@router2:/usr/home/adit# ee /etc/natd.conf
port 8668
interface em0
4.FORWARDING
root@router2:/usr/home/adit#ee /etc/rc.conf
redirect_port tcp 12.12.12.19:22 192.168.2.234:2222
5. STATIC ROUTE
route add -net 13.13.13.0/24 192.168.2.243
route del 13.13.13.0/24
Note :
service isc-dhcpd restart (Restart service DHCP Server)
sockstat -4 -l (Cek status port yang running)
tail -f /var/log/massage (Cek log error FreeBSD)
0 Comments