HOME  |  SERVICES  |  Profile  |  RSS

 
Showing posts with label OpenBSD. Show all posts
Showing posts with label OpenBSD. Show all posts

Setting Bandwidth Management OpenBSD

3:03 PM 0 Comments

Langsung saja buka file pf.conf : # vi /etc/pf.conf

# Interface
ext_if="rl0" #---> interface ethernet keluar (isp)
int_if="rl1" #---> interface ethernet lokal

#Target
ip_client1="192.168.1.10"
ip_client2="192.168.1.11"
ip_client3="192.168.1.12"

# Queue
altq on {$ext_if $int_if} hfsc queue {q_def,q_client1,q_share}
queue q_def bandwidth 512Kb hfsc(default realtime 512Kb upperlimit 512Kb)
queue q_client1 bandwidth 512Kb hfsc(realtime 512Kb)
queue q_share bandwidth 512Kb hfsc(realtime 512Kb upperlimit 512Kb) \
(q_client2,q_client3)
queue q_client2 bandwidth 128Kb hfsc(realtime 128Kb upperlimit 512Kb)
queue q_client3 bandwidth 64Kb hfsc(realtime 64Kb upperlimit 256Kb)

# nat/rdr

nat-anchor "ftp-proxy/*"
nat on $ext_if from $int_if:network to any -> $ext_if

rdr-anchor "ftp-proxy/*"

# pass queue
pass in quick on $int_if from $ip_client1 to any keep state queue q_client1
pass out quick on $int_if from any to $ip_client1 keep state queue q_client1

pass in quick on $int_if from $ip_client2 to any keep state queue q_client2
pass out quick on $int_if from any to $ip_client2 keep state queue q_client2

pass in quick on $int_if from $ip_client3 to any keep state queue q_client3
pass out quick on $int_if from any to $ip_client3 keep state queue q_client3

~

simpan :wq

jalankan: #pfctl -f /etc/pf.conf


Read More...

Setting OpenBSD 4.2 sebagai Router

2:44 PM 1 Comments

Instalasi openbsd

- Siapkan cd openbsd4,2 os
- Botting dari cdroom, jalankan perintah seperti berikut :

root on rd0a swap on rd0b dump on rd0b
erase ^?, werase ^W, kill ^U, intr ^C, status ^T
(I)nstall, (U)pgrade or (S)hell? i [enter]
...
Terminal type: [vt220] Enter
kbd(8) mapping? ('L' for list) [none] Enter
...
Proceed with install? [no] y [enter]
...
Available disks are: wd0.
Which one is the root disk? (or done) [wd0] Enter
...
Do you want to use *all* of wd0 for OpenBSD? [no] yes Enter
...
Partisi hardisk
Initial label editor (enter '?' for help at any prompt)

> p

# size offset fstype [fsize bsize cpg]
a: 17593.2M 1498.7M unused 0 0
c: 19092.9M 0.0M unused 0 0
...
delete partisi yang ada (misal a, b, c, d) kecuali c :
> d a
> d b
> d d

buat partisi baru a, b, dan d
> a a
offset: [3069360] Enter
size: [36030960] 4g
Rounding to cylinder: 317520
FS type: [4.2BSD] Enter
mount point: [none] /
> a b
offset: [3386880] Enter
size: [35713440...] 1g
Rounding to cylinder: 619920
FS type: [swap] Enter
> a d

offset: [4006800] Enter
size: [35093520...] Enter
Rounding to cylinder: 257040
FS type: [4.2BSD] Enter
mount point: [none] /var

(karena untuk sebuah router sebenarnya cukup memerlukan 1 muont point /var saja untuk /home, /usr, /tmp tidak diperlukan)

cek label

> p

# size offset fstype [fsize bsize cpg]
a: 4.0G 1498.7M 4.2BSD 2048 16384 16 # /
b: 1.0G 1653.8M swap
c: 19092.9M 0.0M unused 0 0
d: 17.0G 1956.4M 4.2BSD 2048 16384 16 # /var
...

> w
> q
...
Write new label?: [y] Enter
...
Mount point for wd0g (size=6297480k)? (or 'none' or 'done') [/var] Done
...
The next step *DESTROYS* all existing data on these partitions!
Are you really sure that you're ready to proceed? [no] y
...
System hostname (short form, e.g. 'foo'): kodok
...
Configure the network? [yes] Enter
Available interfaces are: fxp0 xl0.

Which one do you wish to initialize? (or 'done') [fxp0] xl0
Symbolic (host) name for xl0? [kodok] Enter

The media options for xl0 are currently
media: Ethernet autoselect (100baseTX full-duplex)
Do you want to change the media options? [no] Enter
IPv4 address for xl0? (or 'dhcp') 192.168.1.1

Netmask? [255.255.255.0] Enter
IPv6 address for xl0? (or 'rtsol' or 'none') [none] Enter

Available interfaces are: fxp0.
Which one do you wish to initialize? (or 'done') [fxp0] Enter

Symbolic (host) name for fxp0? [kodok] Enter
The media options for fxp0 are currently

media: Ethernet autoselect (10baseT half-duplex)
Do you want to change the media options? [no] Enter

IPv4 address for fxp0? (or 'none' or 'dhcp') 10.11.8.142
Netmask? [255.255.255.0] Enter IPv6 address for fxp0? (or 'rtsol' or 'none') [none] Enter

No more interfaces to initialize.
DNS domain name? (e.g. 'bar.com') [my.domain] example.com

DNS nameserver? (IP address or 'none') [68.87.77.130 68.87.72.130] Enter
Use the nameserver now? [yes] Enter

Default route? (IP address, 'dhcp' or 'none') [dhcp] Enter
Edit hosts with ed? [no] Enter
Do you want to do any manual network configuration? [no] Enter
...
set password login root
Password for root account? (will not echo) pAssWOrd
Password for root account? (again) pAssWOrd
...
Let's install the sets!

Location of sets? (cd disk ftp http or 'done') [cd] Enter
Available CD-ROMs are: cd0.
...
Available CD-ROMs are: cd0.
Which one contains the install media? (or 'done') [cd0] Enter
Pathname to the sets? (or 'done') [4.2/i386] Enter
...
sets are labeled '[x]'.
[X] bsd
[X] bsd.rd
[X] bsd.mp
[X] base42.tgz
[X] etc42.tgz
[X] misc42.tgz
[X] comp42.tgz
[X] man42.tgz
[X] game42.tgz
[X] xbase42.tgz
[X] xetc42.tgz
[X] xshare42.tgz
[X] xfont42.tgz
[X] xserv42.tgz
Set name? (or 'done') [bsd.mp] all
...
Set name? (or 'done') [done] Enter
Ready to install sets? [yes] Enter
Getting bsd ...
...
Start sshd(8) by default? [yes] y
...
NTP server? (or 'none' or 'default') [none] default
...
Do you expect to run the X Window System? [yes] No (bila mau pakai YES]
...
Change the default console to com0? [no] Enter
...
What timezone are you in? ('?' for list) [Canada/Mountain] Asia/Jakarta
...

CONGRATULATIONS! Your OpenBSD install has been successfully completed!
To boot the new system, enter halt at the command prompt. Once the
system has halted, reset the machine and boot from the disk.
# reboot
...
sampe disini sudah jadi
bila masih kebingungan bisa melihat manual
http://www.openbsd.org/faq/faq4.html

Set Routing

- edit file pf.conf dalam folder /etc
perintah: #vi /etc/pf.conf

edit isinya seperti berikut:
ext_if="fxp0"
int_if="xl0"
nat-anchor "ftp-proxy/*"
rdr-anchor "ftp-proxy/*"
nat on $ext_if from $int_if:network to any -> $ext_if
rdr pass on $int_if proto tcp to port ftp -> 127.0.0.1 port 8021

~
~
:wq (Save dan keluar)

- Edit file rc.conf.local
#vi /etc/rc.conf
pf=YES
named_flags=""
sendmail_flags=no
~
~
:wq (Save dan keluar)

- Aktifkan forwarding di /etc/sysctl.conf
net.inet.ip.forwarding=1

- Jalankan dengan perintah :
#pfctl -f /etc/pf.conf

kalau tidak ada error router sudah siap digunakan
reboot dulu deh :D

- untuk mengubah ip interface:
#vi /etc/hostname.xl0
#vi /etc/hostname.fxp0
(nama xl0 dan fxp0 tergantung jenis LANCard-nya)

- untuk mengubah gateway:
#vi /etc/mygate

- untuk mengubah DNS :
#vi /etc/resolv.conf

- jika selesai mengubah ip, gateway, dns jangan lupa:
#sh /etc/netstart

- jika selesai mengubah pf.conf jangan lupa :
#pfctl -f /etc/pf.conf

Sampai disini aja
baca manual lbh lengkap atau YM aq : qodirly

Thanks


Read More...





CO.CC:Free Domain