Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Tutorial Proxy Hit supaya tidak terlimit oleh captive portal (PFsense 1.2.3)

    Scheduled Pinned Locked Moved Indonesian
    23 Posts 5 Posters 18.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      anto_DIGIT
      last edited by

      Berikut ini adalah cara sederhana untuk membuat Proxy Hit supaya tidak terlimit oleh BW limiter Captive Portal, penerapannya dilakukan di PFsense 1.2.3 release.
      Tentu saja sebelumnya sudah terinstall paket proxy server yg diset transparent.

      Sebelum melakukan langkah di bawah ini, pastikan tidak melakukan langkah disamping ini –-> http://forum.pfsense.org/index.php/topic,18823.0.html
      Karena captiveportal pasti terbypass, dan BW limiter tidak berlaku.

      Untuk pfsense 2.0 beta lihat di sini http://forum.pfsense.org/index.php/topic,29019.0.html

      Langkah pertama :

      isikan kode2 ini ke dalam Custom Options di GUI Pfsense : Services –> Proxy Server -- > General

      zph_mode tos;
      zph_local 0x04;
      zph_parent 0;
      zph_option 136;

      Ingat TOS 0x04

      Melalui putty, coba cek paket yg ditandai apakah sudah muncul :

      tcpdump -nvi re0 | grep 'tos 0x4'

      Langkah 2
      /usr/local/captiveportal/index.php
      backup dulu file lama
      cp /usr/local/captiveportal/index.php /usr/local/captiveportal/index.bak
      Kemudian edit file

      lihat di baris 290, kemudian sesuaikan menjadi seperti di bawah ini :

      _if ($peruserbw && !empty($bw_down) && is_numeric($bw_down)) {
                 $bw_down_pipeno = $ruleno + 45500;

      exec("/sbin/ipfw pipe 30002 config bw 4Mbit/s");
                 exec("/sbin/ipfw add $ruleno set 2 pipe $bw_down_pipeno ip from any to $clientip out not iptos reliability");
                 exec("/sbin/ipfw pipe $bw_down_pipeno config bw {$bw_down}Kbit/s queue 100");

      exec("/sbin/ipfw add $ruleno pipe 30002 all from any to $clientip out proto TCP iptos reliability");

      } else {
                 exec("/sbin/ipfw add $ruleno set 2 skipto 50000 ip from any to $clientip out");_

      Bandwidth utk proxy-hit diset 4Mbps, silakan sesuaikan dengan kebutuhan dan kemampuan alat ..
      Save, lalu captiveportal direstart, atau di klik lagi tombol "save"

      Langkah 3
      Cek lagi dng :

      ketik ipfw list
      perhatikan yg muncul adalah list dari rule
      lalu ketik ipfw pipe show
      perhatikan yg muncul adalah list dari pipe

      Langkah 4 (bila menggunakan traffic shapping)
      Sesuaikan bandwith di Traffic shapping agar max BW LAN tidak terlimit.

      Langkah 5
      Buatlah firewall rule utk memblok port 3128, karena jika ada salah satu client yg mengisi opsi proxy di browser bisa membypass captiveportal.

      Langkah 6
      Selamat mencoba ..

      Dari sini sebenarnya bisa dikembangkan modifikasi lain yaitu beberapa IP client dengan BW (up & down) yg berbeda …

      1 Reply Last reply Reply Quote 0
      • S
        serangku
        last edited by

        PERTAMAX … inget tetangga sebelah  ;D

        izin mencoba yah om ...

        ada yg mau nemenin ?
        ayo ... jangan malu2 kucing ...  ;)

        1 Reply Last reply Reply Quote 0
        • 1
          111ichael
          last edited by

          om anthon, gmna ya mau cek kalo hit proxy tidak kena limit captive portal?

          1 Reply Last reply Reply Quote 0
          • A
            anto_DIGIT
            last edited by

            @111ichael:

            om anthon, gmna ya mau cek kalo hit proxy tidak kena limit captive portal?

            sudah ada paket yg terdeteksi melalui :

            tcpdump -nvi re0 | grep 'tos 0x4'

            Kalau sudah ada cek dari status traffic graph ..
            Terlebih dulu di browser spt mozilla / IE dsb .. "clear recent history" atau "clear cache"

            mestinya kalau ter-hit BW akan melebihi batas dari BW limitter .. dan yg tidak, tidak boleh melebihi batas  tsb…

            Kalau sudah menginstall youtube cache, lebih mudah lagi ketauan ...
            Atau download file, juga bisa ketauan ...
            Tapi itu semua tergantung konfigurasi squid kita masing2 ..

            1 Reply Last reply Reply Quote 0
            • K
              kakashi
              last edited by

              makasih om @anto_DIGIT …

              saya mau coba
              fresh install pake v 1.2.3 plus lusca, squidguard dan lightsquid ...
              lusca saya coba pake yang dari addrian chadd

              settingan di atas bisa di terapkan di posisi tanpa CP atau harus pake CP om ?
              soalnya disini gak pake CP ...

              btw ... kudu coba dulu
              ntar kalu mentok, gak ragu2 nanya yah om ...

              1 Reply Last reply Reply Quote 0
              • A
                anto_DIGIT
                last edited by

                @kakashi:

                makasih om @anto_DIGIT …

                saya mau coba
                fresh install pake v 1.2.3 plus lusca, squidguard dan lightsquid ...
                lusca saya coba pake yang dari addrian chadd

                settingan di atas bisa di terapkan di posisi tanpa CP atau harus pake CP om ?
                soalnya disini gak pake CP ...

                btw ... kudu coba dulu
                ntar kalu mentok, gak ragu2 nanya yah om ...

                harus pakai CP, kalau di pfs 2.0 bisa diterapkan untuk tanpa CP ..

                1 Reply Last reply Reply Quote 0
                • 1
                  111ichael
                  last edited by

                  @anto_DIGIT:

                  @111ichael:

                  om anthon, gmna ya mau cek kalo hit proxy tidak kena limit captive portal?

                  sudah ada paket yg terdeteksi melalui :

                  tcpdump -nvi re0 | grep 'tos 0x4'

                  Kalau sudah ada cek dari status traffic graph ..
                  Terlebih dulu di browser spt mozilla / IE dsb .. "clear recent history" atau "clear cache"

                  mestinya kalau ter-hit BW akan melebihi batas dari BW limitter .. dan yg tidak, tidak boleh melebihi batas  tsb…

                  Kalau sudah menginstall youtube cache, lebih mudah lagi ketauan ...
                  Atau download file, juga bisa ketauan ...
                  Tapi itu semua tergantung konfigurasi squid kita masing2 ..

                  udah 24 jam di tes om… mantab... hit proxynya tidak terlimit...... makasih ya.... maju terus komunitas pfsense indonesia!!!
                  ;)

                  1 Reply Last reply Reply Quote 0
                  • A
                    anto_DIGIT
                    last edited by

                    @111ichael:

                    @anto_DIGIT:

                    @111ichael:

                    om anthon, gmna ya mau cek kalo hit proxy tidak kena limit captive portal?

                    sudah ada paket yg terdeteksi melalui :

                    tcpdump -nvi re0 | grep 'tos 0x4'

                    Kalau sudah ada cek dari status traffic graph ..
                    Terlebih dulu di browser spt mozilla / IE dsb .. "clear recent history" atau "clear cache"

                    mestinya kalau ter-hit BW akan melebihi batas dari BW limitter .. dan yg tidak, tidak boleh melebihi batas  tsb…

                    Kalau sudah menginstall youtube cache, lebih mudah lagi ketauan ...
                    Atau download file, juga bisa ketauan ...
                    Tapi itu semua tergantung konfigurasi squid kita masing2 ..

                    udah 24 jam di tes om… mantab... hit proxynya tidak terlimit...... makasih ya.... maju terus komunitas pfsense indonesia!!!
                    ;)

                    Wah, berhasil ya ..
                    Terus terang modifikasi di atas sebetulnya belum pernah coba sendiri di pfsense 1.2.3 .. hanya berdasar cara yg sudah pernah dilakukan di pfsense 2.0 beta3

                    1 Reply Last reply Reply Quote 0
                    • Z
                      zass
                      last edited by

                      kalau tanpa settingan begini –> http://forum.pfsense.org/index.php/topic,18823.0.html - maka traffic shaper queues  p2p masuk dalam qlandef atau tidak ?

                      1 Reply Last reply Reply Quote 0
                      • A
                        anto_DIGIT
                        last edited by

                        @zass:

                        kalau tanpa settingan begini –> http://forum.pfsense.org/index.php/topic,18823.0.html - maka traffic shaper queues  p2p masuk dalam qlandef atau tidak ?

                        sebetulnya yg bermasalah hanya http yg masuk ke qlandef , selain itu tidak ..  karena rule utk transparent proxy hanya mengutak-atik TCP dest port 80 …

                        1 Reply Last reply Reply Quote 0
                        • 1
                          111ichael
                          last edited by

                          mau tanya nih… klo proxy hit di terapkan di pf 2.0 gmn ya? apa sma dengan yang di 1.2.3?

                          memang yg 2.0 bugnya msh ada untuk captive portalnya... udah pernah dicoba...

                          1 Reply Last reply Reply Quote 0
                          • A
                            anto_DIGIT
                            last edited by

                            @111ichael:

                            mau tanya nih… klo proxy hit di terapkan di pf 2.0 gmn ya? apa sma dengan yang di 1.2.3?

                            memang yg 2.0 bugnya msh ada untuk captive portalnya... udah pernah dicoba...

                            hampir sama, tetapi kalau di versi 2 filenya beda … /etc/inc/captiveportal.inc

                            Redirectnya masih problem, tapi  developernya kok bilangnya spt ini ..
                            http://forum.pfsense.org/index.php/topic,25476.0.html
                            Going to need a lot more info than "it doesn't work". It does work in every scenario I have setup, and we've deployed it in production in the past week for a WISP on several systems with multiple VLANs on each and no problems. I suspect at this point if it doesn't work you don't have things setup right for DNS to function, hence are never hitting the firewall to get redirected.

                            1 Reply Last reply Reply Quote 0
                            • 1
                              111ichael
                              last edited by

                              @anto_DIGIT:

                              @111ichael:

                              mau tanya nih… klo proxy hit di terapkan di pf 2.0 gmn ya? apa sma dengan yang di 1.2.3?

                              memang yg 2.0 bugnya msh ada untuk captive portalnya... udah pernah dicoba...

                              hampir sama, tetapi kalau di versi 2 filenya beda … /etc/inc/captiveportal.inc

                              Redirectnya masih problem, tapi  developernya kok bilangnya spt ini ..
                              http://forum.pfsense.org/index.php/topic,25476.0.html
                              Going to need a lot more info than "it doesn't work". It does work in every scenario I have setup, and we've deployed it in production in the past week for a WISP on several systems with multiple VLANs on each and no problems. I suspect at this point if it doesn't work you don't have things setup right for DNS to function, hence are never hitting the firewall to get redirected.

                              Sebenarnya pada saat login sdh bisa, usernya yg login sudah masuk di statusnya captive portal, tapi disisi user/client pada saat selesai login akan teredireck ke halaman login kembali, itu jika saya aktifkan 'enable popup logout windows'. kalo tdk di aktifkan redirectnya akan berjalan normal.

                              1 Reply Last reply Reply Quote 0
                              • A
                                anto_DIGIT
                                last edited by

                                @111ichael:

                                Sebenarnya pada saat login sdh bisa, usernya yg login sudah masuk di statusnya captive portal, tapi disisi user/client pada saat selesai login akan teredireck ke halaman login kembali, itu jika saya aktifkan 'enable popup logout windows'. kalo tdk di aktifkan redirectnya akan berjalan normal.

                                Tks infonya .. tadinya sekitar 2 bulan lalu tdk ada masalah walaupun diaktifkan 'enable popup logout windows' …

                                1 Reply Last reply Reply Quote 0
                                • 1
                                  111ichael
                                  last edited by

                                  @anto_DIGIT:

                                  lihat di baris 290, kemudian sesuaikan menjadi seperti di bawah ini :

                                  _**if ($peruserbw && !empty($bw_down) && is_numeric($bw_down)) {
                                              $bw_down_pipeno = $ruleno + 45500;

                                  exec("/sbin/ipfw pipe 30002 config bw 4Mbit/s");
                                              exec("/sbin/ipfw add $ruleno set 2 pipe $bw_down_pipeno ip from any to $clientip out not iptos reliability");
                                              exec("/sbin/ipfw pipe $bw_down_pipeno config bw {$bw_down}Kbit/s queue 100");

                                  exec("/sbin/ipfw add $ruleno pipe 30002 all from any to $clientip out proto TCP iptos reliability");
                                         
                                  } else {
                                              exec("/sbin/ipfw add $ruleno set 2 skipto 50000 ip from any to $clientip out");**
                                  Bandwidth utk proxy-hit diset 4Mbps, silakan sesuaikan dengan kebutuhan dan kemampuan alat ..
                                  Save, lalu captiveportal direstart, atau di klik lagi tombol "save"

                                  om anto saya sedang mencoba rule bandwidth iptos nya di set per ip. tinggal dilihat apa bisa jalan juga jika di rulenya di setting seperti ini… ^_^

                                  _**if ($peruserbw && !empty($bw_down) && is_numeric($bw_down)) {
                                              $bw_down_pipeno = $ruleno + 45500;
                                              $bw_down_pipeno_tos = $ruleno + 30000;

                                  exec("/sbin/ipfw add $ruleno set 2 pipe $bw_down_pipeno ip from any to $clientip out not iptos reliability");
                                              exec("/sbin/ipfw pipe $bw_down_pipeno config bw {$bw_down}Kbit/s queue 100");
                                       
                                        exec("/sbin/ipfw add $ruleno set 2 pipe $bw_down_pipeno_tos ip from any to $clientip out proto TCP iptos reliability");
                                              exec("/sbin/ipfw pipe $bw_down_pipeno_tos config bw 4Mbit/s");**__

                                  1 Reply Last reply Reply Quote 0
                                  • A
                                    anto_DIGIT
                                    last edited by

                                    silakan dicoba ..  ;D

                                    1 Reply Last reply Reply Quote 0
                                    • K
                                      kakashi
                                      last edited by

                                      bro …

                                      tcpdump -nvi re0 | grep 'tos 0x4'
                                      atau tos 0x04 ?

                                      saya coba tcpdump -nvi fxp0 tanpa tambahan | grep 'tos 0x4'
                                      munculnya tos 0x0, gak nongol yg 0x04 ataupun 0x4

                                      mohon pencerahan ...

                                      1 Reply Last reply Reply Quote 0
                                      • A
                                        anto_DIGIT
                                        last edited by

                                        @kakashi:

                                        bro …

                                        tcpdump -nvi re0 | grep 'tos 0x4'
                                        atau tos 0x04 ?

                                        saya coba tcpdump -nvi fxp0 tanpa tambahan | grep 'tos 0x4'
                                        munculnya tos 0x0, gak nongol yg 0x04 ataupun 0x4

                                        mohon pencerahan ...

                                        Kalau itu tdk muncul, kemungkinan proxy mungkin belum ditandai, atau karena rule yg salah (cek di tmp/rules.debug)
                                        lihat squid.conf  ..
                                        bisa juga karena disable "Allow users on interface"

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          serangku
                                          last edited by

                                          ini ada sedikit pencerahan setelah googling2 …
                                          berhubungan dengan tos dan dscp

                                          http://www.oneunified.net/blog/Networks/index.blog

                                          1 Reply Last reply Reply Quote 0
                                          • A
                                            anto_DIGIT
                                            last edited by

                                            @serangku:

                                            ini ada sedikit pencerahan setelah googling2 …
                                            berhubungan dengan tos dan dscp

                                            http://www.oneunified.net/blog/Networks/index.blog

                                            Tks infonya ..

                                            Di pfsense beta4, sudah dicoba sekalipun ipfw sudah berhasil mendeteksi TOS tertentu, tetapi PF tidak bisa mendeteksi. Floating rule juga belum berfungsi maksimal, apalagi digabungkan dng layer 7.
                                            Bagi rekan2 yg mau coba implementasikan ke versi 1.2.3, silakan memasukkan

                                            pass out quick on rl0 from any to 192.168.10.0/24 tos 0x04 no state queue dn_cache

                                            masukkan ke /etc/inc/filter.inc
                                            jangan lupa utk sesuaikan
                                            rl0 –- > interface LAN
                                            dn_cache ---> queue, sebelumnya harus dibuat dulu ..
                                            tos 0x4 ---> khusus utk di posting ini, silakan sesuaikan jika menggunakan tos lain ..

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.