-
-
Def
just joined
- Posts: 23
- Joined: Wed Sep 10, 2008 11:04 pm
ERROR: Gateway Timeout with proxy
Sat Sep 13, 2008 9:57 am
Hello,
I can’t find out why I’m getting this error:
ERROR: Gateway Timeout
Your cache administrator is webmaster.
Generated Sat, 13 Sep 2008 08:31:24 GMT by 10.8.15.99 (Mikrotik HttpProxy)
I get this error only when I enable web proxy. With disabled proxy there’s no problem… everything’s going perfectly.
Here are my settings:
/proxy settings
enabled: yes
src-address: 0.0.0.0
port: 8080
parent-proxy: 0.0.0.0
parent-proxy-port: 0
cache-drive: system
cache-administrator: "webmaster"
max-cache-size: none
cache-on-disk: no
max-client-connections: 600
max-server-connections: 600
max-fresh-time: 3d
serialize-connections: no
always-from-cache: no
cache-hit-dscp: 4
/nat settings
action=masquerade chain=srcnat comment="" disabled=no out-interface=local
src-address-list=users
action=redirect chain=dstnat comment="" disabled=yes dst-port=80
protocol=tcp src-address-list=users to-ports=8080
«Allow remote requests» is in DNS settings checked.
What’s wrong?
-
-
ashish
Long time Member
- Posts: 546
- Joined: Mon Feb 12, 2007 5:50 am
- Location: Virginia, USA.
Re: ERROR: Gateway Timeout with proxy
Sat Sep 13, 2008 1:28 pm
Hi
Just put the «Dst-Nat» Rule on the TOP and Check
-
-
Def
just joined
- Posts: 23
- Joined: Wed Sep 10, 2008 11:04 pm
Topic Author
Re: ERROR: Gateway Timeout with proxy
Sat Sep 13, 2008 1:36 pm
I did… but it’s the same. Dst-nat works correctly, because if I disable it, I don’t get timeout error. So it is web proxy what’s wrong. But I still don’t know what exactly is wrong…
-
-
ashish
Long time Member
- Posts: 546
- Joined: Mon Feb 12, 2007 5:50 am
- Location: Virginia, USA.
Re: ERROR: Gateway Timeout with proxy
Sat Sep 13, 2008 1:43 pm
Second Try,
uncheck «src-address-list=users «..I mean Just Disabled.
configure in-interface=your LAN
-
-
Def
just joined
- Posts: 23
- Joined: Wed Sep 10, 2008 11:04 pm
Topic Author
Re: ERROR: Gateway Timeout with proxy
Sat Sep 13, 2008 2:46 pm
Thanks for responses,
now I don’t get any error, but pages are still loading (waiting for http://www.google.com…) but no data are downloaded…
-
-
salytwo
Frequent Visitor
- Posts: 89
- Joined: Mon Apr 18, 2011 8:53 am
Re: ERROR: Gateway Timeout with proxy
Tue Dec 06, 2011 3:23 pm
Hello all,
I need to customize this page. Can I do this?
thanks
-
-
fewi
Forum Guru
- Posts: 7717
- Joined: Tue Aug 11, 2009 3:19 am
Re: ERROR: Gateway Timeout with proxy
Tue Dec 06, 2011 3:55 pm
-
-
Iceog
just joined
- Posts: 10
- Joined: Wed Dec 07, 2011 8:43 pm
Re: ERROR: Gateway Timeout with proxy
Wed Dec 07, 2011 8:50 pm
Def,
I see you solved the problem with timeout. Can you share how You did that ?
Thanks
-
fatal1ty
- Сообщения: 2
- Зарегистрирован: 16 окт 2012, 07:55
Код: Выделить всё
/ip firewall nat
add action=redirect chain=dstnat disabled=no dst-port=0-65535 protocol=tcp
src-address=172.16.0.0/21 to-ports=8080
add action=masquerade chain=srcnat disabled=no src-address=172.16.0.0/21
/ip proxy
set always-from-cache=no cache-administrator=webmaster cache-hit-dscp=4
cache-on-disk=yes enabled=yes max-cache-size=unlimited
max-client-connections=600 max-fresh-time=3d max-server-connections=600
parent-proxy=0.0.0.0 parent-proxy-port=0 port=8080 serialize-connections=
no src-address=0.0.0.0
/ip proxy access
add action=deny disabled=no dst-host="" dst-port=80 redirect-to=
clients.bicnet.ru/client/ src-address=172.16.0.0/21
Есть такое. Интерфейс внутрь смотрит который без ip адреса ибо кроме серых айпих есть юзеры с белыми и поднят PPPoE сервер. Ситуация такая.. юзер перенаправляется, но у него страница не открывается.. в строке браузера она есть (url ссылка), а в окне браузера циклическое перенаправление и такая реакция на любую страницу, которую я указываю в redirect-to=.
-
iSupport
- Сообщения: 2360
- Зарегистрирован: 06 фев 2011, 20:44
16 окт 2012, 11:36
посмотрите мануал по прокси
http://wiki.mikrotik.com/wiki/How_to_ma … _web_proxy
нет смысла заворачивать все порты, в НТТР прокси заверните порт 80
Код: Выделить всё
add action=redirect chain=dstnat disabled=no dst-port=0-65535 protocol=tcp
src-address=172.16.0.0/21 to-ports=8080
очень широкое правило, посмотрите мануал
Граждане, сколько раз просил =) чем понятнее и точнее сформулирован вопрос — тем понятнее и точнее будет на него ответ.
Я просматриваю ВСЕ темы форума и стараюсь помочь в каждой из них
Поэтому, НА ЛС отвечаю в последнюю очередь
-
fatal1ty
- Сообщения: 2
- Зарегистрирован: 16 окт 2012, 07:55
16 окт 2012, 12:36
Спасибо, сделал так:
/ip firewall nat
Код: Выделить всё
add action=redirect chain=dstnat disabled=no dst-port=80 protocol=tcp src-address=172.16.0.0/21 to-ports=8080
add action=masquerade chain=srcnat disabled=no out-interface=ether1 src-address=172.16.0.0/21
но проблема с циклической переадресацией у пользователя не решилась. В строке поиска браузера получает
http://clients.bicnet.ru
, а в окне содержимого надпись о циклической переадресации.. и дело не в веб-сервере моем.. на какую бы страницу я редирект не делал результат — циклическая переадресация.
-
iSupport
- Сообщения: 2360
- Зарегистрирован: 06 фев 2011, 20:44
16 окт 2012, 23:58
специально проверил Для Ваc, поднял дома прокси
Код: Выделить всё
/ip firewall nat add action=redirect chain=dstnat dst-address=0.0.0.0/0 dst-port=80 protocol=tcp
src-address=192.168.0.0/16 to-ports=8080
/ip proxy set always-from-cache=no cache-administrator=webmaster cache-hit-dscp=4
cache-on-disk=no enabled=yes max-cache-size=none max-client-connections=600
max-fresh-time=3d max-server-connections=600 parent-proxy=0.0.0.0
parent-proxy-port=0 port=8080 serialize-connections=no src-address=0.0.0.0
проверить прокси можно так, заходим на
http://34.34.34.34/
должны увидеть ответ от микротика
ERROR: Gateway Timeout
While trying to retrieve the URL
http://34.34.34.34/
:
Connection timed out
Your cache administrator is webmaster.Generated Tue, 16 Oct 2012 20:54:36 GMT by 192.168.1.1 (Mikrotik HttpProxy)
Граждане, сколько раз просил =) чем понятнее и точнее сформулирован вопрос — тем понятнее и точнее будет на него ответ.
Я просматриваю ВСЕ темы форума и стараюсь помочь в каждой из них
Поэтому, НА ЛС отвечаю в последнюю очередь
-
PavelSES
- Сообщения: 48
- Зарегистрирован: 13 сен 2011, 08:30
28 мар 2013, 07:11
Не буду создавать новую тему, напишу здесь.
Есть два канала, настроены манглы, пинги трассы с клиентских машин ходят правильно.
Но возникла задача использовать встроенный в микротик прокси.
И столкнулся с проблемой, через прокси все идет на дефолтный канал, а нужно чтобы определенные сайты которые находятся в сети второго провайдера ходили через него. Отсюда вопрос как сделать чтоб с веб прокси тоже ходило часть через основной канал, часть через дополнительный?
-
iSupport
- Сообщения: 2360
- Зарегистрирован: 06 фев 2011, 20:44
28 мар 2013, 07:48
чтобы разграничить прокси на 2 канала, кхм, момент в том, что прокси перехватывает пакеты и отправлет их уже от своего имени.
Попробуйте маркировать рoутинг на пакетах от прокси ( chain= output или postrouting)
Граждане, сколько раз просил =) чем понятнее и точнее сформулирован вопрос — тем понятнее и точнее будет на него ответ.
Я просматриваю ВСЕ темы форума и стараюсь помочь в каждой из них
Поэтому, НА ЛС отвечаю в последнюю очередь
-
Coolspawn
- Сообщения: 8
- Зарегистрирован: 12 апр 2013, 11:59
17 май 2013, 20:55
а по-подробнее можно насчет output или postrouting…
если маркировать в output, трафик блокируется.. а на построутинге нет возможности connection маркирвать….
Chupaka писал(а): ↑18 фев 2021, 18:04
Здравствуйте.Ошибка показывает, что прокси пытается подключиться к сайту — но не может, потому что сервер отказывает в подключении (либо кто-то по пути ему мешает). Если без прокси сайт открывается — смотрите правила фильтра файрвола, которые могут мешать роутеру (chain=input и chain=output) подключаться к этому сайту по порту 80, например.
Доброе утро. У меня так. Пробовал 1 X chain=forward action=accept protocol=tcp dst-port=80 log=no log-prefix=»» результата не дало.
0 D ;;; special dummy rule to show fasttrack counters
chain=forward action=passthrough
1 X chain=forward action=accept protocol=tcp dst-port=80 log=no log-prefix=»»
2 chain=input action=accept connection-state=established,related,untracked log=no log-prefix=»»
3 chain=input action=accept protocol=tcp dst-port=8291 log=no log-prefix=»»
4 chain=input action=drop connection-state=invalid log=no log-prefix=»»
5 chain=input action=accept protocol=icmp log=no log-prefix=»»
6 chain=input action=drop in-interface=ether1-inet log=no log-prefix=»»
7 chain=forward action=accept log=no log-prefix=»» ipsec-policy=in,ipsec
8 chain=forward action=accept log=no log-prefix=»» ipsec-policy=out,ipsec
9 chain=forward action=fasttrack-connection connection-state=established,related log=no log-prefix=»»
10 chain=forward action=accept connection-state=established,related,untracked log=no log-prefix=»»
@MikroTik] > /ip firewall nat print
Flags: X — disabled, I — invalid, D — dynamic
0 chain=dstnat action=dst-nat to-addresses=192.168.88.20 to-ports=80 protocol=tcp
dst-address=55.256.64.120 in-interface=ether1 dst-port=80 log=no log-prefix=»»
1 ;;; MASQUERADE
chain=srcnat action=masquerade out-interface=ether1 log=no log-prefix=»»
это то, что сейчас, просто сквозняком, если сделать так:
2@MikroTik] > /ip firewall nat print
Flags: X — disabled, I — invalid, D — dynamic
0 chain=dstnat action=redirect to-ports=8080 protocol=tcp
dst-address=55.256.64.120 in-interface=ether1 dst-port=80 log=no
log-prefix=»»
1 ;;; MASQUERADE
chain=srcnat action=masquerade out-interface=ether1 log=no
log-prefix=»»
то мы попадаем на прокси микротика, что дальше не знаю
ERROR: Gateway Timeout
While trying to retrieve the URL http://hitechshop.me/:
Connection refused
Your cache administrator is webmaster.
Generated Fri, 30 Jan 2015 23:00:53 GMT by 192.168.88.1 (Mikrotik HttpProxy)
← Вернуться в раздел «В помощь системному администратору»
Автор: Neym
Дата сообщения: 15.09.2009 13:36
Первый!
Так все-таки кто-нить знает ответ на мой вопрос. Или может подскажете как лучше реализовать..
Такая вот проблемка:
Web-Server————
———Mikrotik——Internet
/
Users/24—————/
Есть МТ который смотрит в Инет. К МТ по pptp подключаются юзвери. И за МТ же стоит веб-сервер.
На МТ настроен Веб-Прокси. А на сервак dst-nat.
Так вот. Если юзвери пытаются зайти на вэб-сервер, через внешний адресс, то выдается сообщение:
ERROR: Gateway Timeout
Your cache administrator is ххххх@gmail.com.
Generated Sun, 13 Sep 2009 07:31:07 GMT by 10.10.0.1 (Mikrotik HttpProxy)
Если отключаю Web-Proxy то все отлично заходится.
Как сделать чтобы и с проксей работало?
Вырезка правил из NAT
0 chain=srcnat action=masquerade src-address=10.10.0.0/24
1 chain=dstnat action=redirect to-ports=8080 protocol=tcp
src-address=10.10.0.0/24 dst-port=80
2 chain=dstnat action=dst-nat to-addresses=10.10.0.100 to-ports=80
protocol=tcp dst-address=195.230.XXX.XXX dst-port=80
Автор: hardms3
Дата сообщения: 15.09.2009 16:01
Цитата:
Bridge — Ports
Все прописал но так нет через PPPoE так и не залогиневаеться
Автор: Neym
Дата сообщения: 15.09.2009 16:52
Проблема разрешилась. Немного изменил правило NAT:
Код:
1 chain=dstnat action=redirect to-ports=8080 protocol=tcp
src-address=10.10.0.0/24 dst-address=!195.230.xxx.xxx dst-port=80
Автор: Agurker
Дата сообщения: 16.09.2009 01:29
Люди, такой вопрос!
Сетку провайдера массово атакует SYN флуд — скорей всего абоненты, зараженные Конфикером. Лечить всех не получится, поэтому необходимо настроить сервак, чтобы он фильтровал хотя бы тот трафик, который на него поступает. На серваке крутится MikroTik OS (версию уточню днем), но в настройках TCP я нашел только следующее:
Но для борьбы с SYN флудом этого мало. Поэтому интересует следующее?
Как включить SYN cookies?
Как увеличить очередь полуоткрытых соединений?
Как уменьшить временя хранения незавершенных соединений? (TCP syn received timeout — это же оно?)
Как уменьшить временя обработки запроса на соединение?
Какие значения посоветуете поставить? Может, еще какие-то настройки могут помочь избавиться от от SYN флуда?
Заранее спасибо!
Автор: allip
Дата сообщения: 17.09.2009 07:34
объясните пожалуйста как правильно использовать режим station pseudobridge — в связке с bridge интерфейсом или можно без bridge интерфейса ? следует ли в этом режиме присваивать wlan интерфейсу ip-адрес или же все будет прозрачный обмен между ether и wlan интерфейсами на уровне mac-адресов?
Автор: attaattaatta
Дата сообщения: 17.09.2009 13:35
Цитата:
station-pseudobridge — wireless station that can be put in bridge. MAC NAT is performed on all traffic sent over the wireless interface, so that it look like coming from the station’s MAC address regardless of the actual sender (the standard does not allow station to send packets with different MAC address from its own). Reverse translation (when replies arrive from the AP to the pseudobridge station) is based on the ARP table. Non-IP protocols are being sent to the default MAC address (the last MAC address, which the station has received a non-IP packet from). That means that if there is more than one client that uses non-IP protocols (for example, PPPoE) behind the station, none of them will be able to work correctly
station-pseudobridge-clone — similar to the station-pseudobridge, but the station will clone MAC address of a particular device (set in the station-bridge-clone-mac property), i.e. it will change itsown address to the one of a different device. In case no address is set in the station-bridge-clone-mac property, the station postpones connecting to an AP until some packet, with the source MAC address different from any of the router itself, needs to be transmitted over that interface. It then connects to an AP with the MAC address of the device that have sent that packet
Цитата:
все же будет прозрачный обмен между ether и wlan интерфейсами на уровне mac-адресов
=)
Добавлено:
http://forum.mikrotik.com/viewtopic.php?f=2&t=24092
Автор: goletsa
Дата сообщения: 17.09.2009 13:50
Никто не сталкивался с багом что по SNMP отдается некоректная скорость сетевого линка?
Т.е. например если на ether1 гигабитная сетевуха, vlan принадлежащий интерфесй всего 10мбит
Изза этого в графиках сплошная пустота.
Автор: Lost Ally
Дата сообщения: 17.09.2009 16:45
Уважаемые такая проблема.
Поставил микротик, приобрел, когда пришел ключ, включаю сервер, а он сразу вырабается с надписью …лицензия экспиред..
Вопрос — как в таком случае подсунуть ему ключик?
Автор: hardms3
Дата сообщения: 17.09.2009 20:47
Ребят есть проблема немогу настроить микротик на обычную точку доступа? блин что не делаю конечный пользователь неможет залогиниться через PPPoE
/——Users/PPPoE
/
Interhet——-Web-Server/PPPoE——-Mikrotik———Users/PPPoE
——Users/PPPoE
Автор: goletsa
Дата сообщения: 17.09.2009 21:26
Я так понимаю пппое сервер внешний.
Тогда надо искать как сделать pppoe relay
Или использовать встроеный в микротик в связке с радиусом например.
Автор: hardms3
Дата сообщения: 17.09.2009 21:51
1 Что значь pppoe relay и как его зделать
2 Просветите как эту связку с радиусом зделать
3 И памагите правельно настроить микротик в точку доступа
Добавлено:
такую схему
WiFi
/——Users/PPPoE
волокно витая пара WiFi /
Interhet——-Web-Server/PPPoE——-Mikrotik—-Рипитр———Users/PPPoE
——Users/PPPoE
или такую
WiFi
/——Users/PPPoE
волокно витая пара WiFi /
Interhet——-Web-Server/PPPoE——-TP-link601——Mikrotik—-Users/PPPoE
——Users/PPPoE
Как лучше ее организовать?
Автор: goletsa
Дата сообщения: 17.09.2009 22:24
Памагите выучить русский языг.
Полистайте тему, неоднократно поднимались вопросы.
http://www.google.com/search?hl=en&safe=off&client=opera&rls=ru&hs=JL2&q=mikrotik+pppoe+relay&btnG=Search&aq=f&oq=&aqi=
В первой ссылке есть описание как сделать релей и как раз в связке с точкой доступа.
Автор: hardms3
Дата сообщения: 17.09.2009 23:01
эт я уже читал и не раз перечитывал но так настроить и не смог прямая связь есть а вот через авторизацию хоть тресни
Автор: goletsa
Дата сообщения: 18.09.2009 07:30
Цитата:
такую схему
WiFi
/——Users/PPPoE
волокно витая пара WiFi /
Interhet——-Web-Server/PPPoE——-Mikrotik—-Рипитр———Users/PPPoE
——Users/PPPoEили такую
WiFi
/——Users/PPPoE
волокно витая пара WiFi /
Interhet——-Web-Server/PPPoE——-TP-link601——Mikrotik—-Users/PPPoE
——Users/PPPoE
Вы понимаете тонкость в извращениях.
Internet—WebServer/RadiusServer—витая—-mikrotik/PPPoE—WIFI
Хотя зачем вам вообще микротик…
Раздавать то можно и без него.
Internet—-Web/PPPoE——WIFI—Users/PPPoE
Добавлено:
hardms3
Цитата:
эт я уже читал и не раз перечитывал но так настроить и не смог прямая связь есть а вот через авторизацию хоть тресни
Покажите что вводили.
Там просто создание бриджа описано было.
Автор: mindusa
Дата сообщения: 18.09.2009 09:59
Автор: hardms3
Дата сообщения: 18.09.2009 12:56
Цитата:
mindusa
просьба взгялнуть на эту тему
http://forum.ru-board.com/topic.cgi?forum=8&topic=34158#1
хм а эт конечно интересно блин придеться через utm билинг настраивать
Автор: goletsa
Дата сообщения: 18.09.2009 15:39
Зачем UTM
Можно и через nodeny ( http://nodeny.com.ua )
Халявная версия на 300 человек берется на оффсайте.
И там есть радиус сервер.
Автор: Barabakan
Дата сообщения: 18.09.2009 15:48
Я конечно ничего толком не понял в картинках, но можео на микротике просто бриджи поднять и пусть PPPoE пролезает спокойно?
Автор: goletsa
Дата сообщения: 18.09.2009 16:07
Barabakan
А смысл тогда поднимать бридж. Тогда уж проще вообще без микротика.
Автор: hardms3
Дата сообщения: 18.09.2009 16:43
Цитата:
Я конечно ничего толком не понял в картинках, но можео на микротике просто бриджи поднять и пусть PPPoE пролезает спокойно?
А поточнее можно, как поднять что прописовать через терминал
Добавлено:
Все всем спасибо разобрался как и че,
блин проблема была в самой оси
поставил 2,9 все завелось, через бридж
Автор: Barabakan
Дата сообщения: 18.09.2009 21:00
Цитата:
А смысл тогда поднимать бридж. Тогда уж проще вообще без микротика.
Ну может автору фильтры какие нужны или еще чего, мониторинг там и т.д.
Автор: tiuman
Дата сообщения: 19.09.2009 04:02
Пож-та подскажите методы защиты от подмены MAC адреса в RouterOS, PPTP proxy и всякую парольную авторизацию можете не перечислять.
гугл и поиск не умею
Автор: Barabakan
Дата сообщения: 19.09.2009 13:16
Не занимался никогда, но наверное можно замутить что-нибудь на сертификатах.
Автор: goletsa
Дата сообщения: 19.09.2009 14:23
Barabakan
Цитата:
Не занимался никогда, но наверное можно замутить что-нибудь на сертификатах.
Поясните.
Автор: tiuman
Дата сообщения: 20.09.2009 07:21
мда. придется все таки PPP истользовать.. ну ладно..
воторой вопрос. как вводить лимит на скачивание не в байтах а в мегобайтах… а то запутаться можно
Автор: goletsa
Дата сообщения: 20.09.2009 10:50
tiuman
Цитата:
мда. придется все таки PPP истользовать.. ну ладно..
Есть еще DHCP+L2 свичи + Option82+PortSecurity
Автор: Lutvun
Дата сообщения: 20.09.2009 11:21
Как сделать чтоб клиенты подключённые по WiFi не видели друг друга
Автор: Serjqwer
Дата сообщения: 20.09.2009 13:16
Подскажите
1.Возможно извенять скорость от времени суток на анлимах?
например с 8-00 до 23-59 -256кбит
с 0-00 до 7-59 -800кбит
2.Выключать юсера по дате?
3.Создать несколько профилей с разными скоростями?
Автор: goletsa
Дата сообщения: 20.09.2009 13:19
Вообщето это задачи билинга а не роутера.
Страницы: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
Предыдущая тема: Шары открываются только по IP (не по имени)
Форум Ru-Board.club — поднят 15-09-2016 числа. Цель — сохранить наследие старого Ru-Board, истории становления российского интернета. Сделано для людей.
MikroTik Web Proxy Simple Configuration
Web Proxy is one of the features in mikrotik router. By using this web proxy feature, you can save internet bandwidth and speed up the connection, because when you and your users accessing a website, some of the content of the website will be cache in memory or disk mikrotik. And when you open a website that is stored in the cache mikrotik, access to the website will be faster.
MikroTik RouterOS performs proxying of HTTP and HTTP-proxy (for FTP and HTTP protocols) requests. Proxy server performs Internet object cache function by storing requested Internet objects, i.e., data available via HTTP and FTP protocols on a system positioned closer to the recipient in the form of speeding up customer browsing by delivering them requested file copies from proxy cache at local network speed. MikroTik RouterOS implements the following proxy server features.
Regular HTTP proxy – customer (itself) specify what is proxy server for him
Transparent proxy – customer does not know about the proxy being enabled and there isn’t need any additional configuration for web browser of client.
Access list by source, destination, URL and requested method (HTTP firewall)
Cache access list to specify which objects to cache, and which not.
Direct Access List – to specify which resources should be accessed directly, and which – through another proxy server
Logging facility – allows to get and to store information about proxy operation
Parent proxy support – allows to specify other proxy server, (‘if they don’t have the requested object ask their parents, or to the original server.)
Configuring Web Proxy Configuring
Go to IP
Web Proxy
Click on Web Proxy Settings Enter the proxy port. By default is 8080
Manually configure proxy on your browser with mikrotik ip address (gatheway LAN) as a proxy IP address and port 8080
Transparent Proxy on mikrotik router
Go to IP
Firewall
NAT
General select the parameter values
On Action Tab
Select the Parameter Values
Go to Console & Paste it
Check it on Status Tab & Connection
Please Check the below you can see “Error Gateway Timeout”
Web proxy is a service that is placed between a client and the internet for HTTP web surfing. It can cache certain contents / http pages in its local cache. Mikrotik have basic PROXY package builtin called WEB PROXY. It is suitable for basic caching for small to mid size networks.
For advance caching capabilities, Use 3rd party external proxy server like SQUID.
MikroTik WEB.PROXY Recommendation
Always try NOT to use the same storage disk to store your your cache and your your Router OS, to ensure there is always enough space on your router OS Disk for logs, upgrade / update packages & Backups. Therefore It is highly recommended that the web-proxy cache is stored on a physically separate drive (store) other than the Router OS. Placing the cache on a separate drive ensures maximum performance and reduces problems if the disk becomes full or fails as the OS will then still be OK!
Caching Internet access will require a lot of read and writes to the disk, chose fast disk as for maximum performance / concurrent user request support.
Cache performance also largely depends on RAM size, the More RAM you have in your server, the Better performance you will get.
We will divide this article in 3 Sections.
1# Preparing Secondary Partition for Cache
2# Configuring Web Proxy
3# Transparent Proxy
Let’s BEGIN . . .
1# Preparing Secondary Drive for CACHE
First we will Format secondary harddrive (to be used for cache ), IF YOU DON’T WANT TO USE SECONDARY HARD-DIVE, SKIP THIS STEP.
Goto SYSTEM > STORES > DISKS
Select the Secondary Hard drive and click on FORMAT DRIVE
As shown in the image below.
.
Now go to STORES tab (by navigating to SYSTEM > STORES)
Select the WEB-Proxy package and click on COPY
It will ask you where to copy WEB-Proxy package, Select Secondary Drive in TO box.
As shown in the image below.
2# Configuring Web Proxy
Now We have to Enable Mikrotik Web Proxy by navigating to
IP > WEB PROXY
As shown in the image below.
.
Now Click on “Enable”
in Port, Type 8080
Max Cache Size , Select Unlimited from drop down menu, OR if you have limited Disk Space, then use your desired amount.
You have to specify space in KiloBytes for example 1024 KB = 1MB , so if you want to set 5 GB Cache, then use 5242880 , I am using 5 GB in this example. The cache size is really based off of how much RAM you have in the machine
As shown in the image below . . .
.
Click on Apply and your Mikrotik’s Web Proxy is Ready to be used, But Every client have to set proxy address pointing to Mikrotik IP to be able to use Proxy Service.
If we want that every user must be automatically redirected to Proxy transparently, then we have to create additional rule to forcefully redirect users to proxy service, which is called TRANSPARENT PROXY.
.
Goto IP > FIREWALL > NAT and create new rule
In Chain , Select dsntant,
In Protocol, Select 6 (tcp)
In Dst. Port, Type 80
As shown in the image below . . .
.
Now goto Action Tab,
In Action, Select redirct
In To Ports, Type 8080
As shown in the image below . . .
.
Now your newly created rule will look like something below image.
As shown in the image below . . .
OR the CLI version of above rule would be something like below.
/ip firewall nat add action=redirect chain=dstnat disabled=no dst-port=80 protocol=tcp to-ports=8080
Done. Now Mikrotik web proxy will perform as TRANSPARENT PROXY , Every user’s HTTP PORT 80 request will automatically be redirected to Mikrotik built-in Web Proxy.
You can View Proxy Status and other info via going to IP > WEB PROXY > SETTINGS > STATUS and other tabs in the same window.
As shown in the image below . . .
=========================================
WEB-PROXY Tips ‘N’ Tricks !! by Zaib (December, 2011)
=========================================
.
Howto Send CACHED Contents to user at Full Speed / Ignoring QUEUE Limit for cached-hits marked packets 🙂
First Mark Cached Contents by MANGLE Rule.
/ip firewall mangle add action=mark-packet chain=output comment="CACHE HIT/Zaib" disabled=no dscp=4 new-packet-mark=cache-hits passthrough=no
Now Create an Queue Tree which will send cache-hits packets to users at full LAN speed, ignoring the user’s Static OR Dynamic QUEUES
/queue tree add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 max-limit=0 name="Unlimited Speed for CACHE by zaib" packet-mark=cache-hits parent=global-out priority=8 queue=default
Now Try to download any cacheable content , for example download following file,
http://www.rarlab.com/rar/wrar410b5a.exe
Once Downloaded, Try to download it again from any other computer or via same test pc. You will see the Queues and rules in action, sending cache-hits packets to users at full LAN speed.Remember Mikrotik web proxy is very basic and simple proxy server with not much tweaks and nuts ‘N’ Bolts to set, So it will cache what it can. For advancements, Use SQUID instead.
As shows in the image below . . .
.
Also you can view the cache contents via going to IP > WEBPROXY > CACHE CONTENTS
As shows in the image below . . .
Howto Block Web Sites by Domain Name
You can block any web site via domain name as shown below.
/ip proxy access add action=deny disabled=no dst-host=yahoo.com /ip proxy access add action=deny disabled=no dst-host=www.yahoo.com
Howto Block Downloading via File EXTENSION Types
You can block Downloading by file types using following code,
/ip proxy access add path=*.mp3 action=deny
Howto Block OPEN PROXY
Please Make sure You are not running your proxy in OPEN PROXY mode, If so any one cane use your proxy service over the internet, and can use perform any illegal activity and your proxy IP will be logged at remote server, So Block it immediately.
Use the following.
/ip firewall filter add action=drop chain=input comment="Block Open PROXY 🙂 Zaib" disabled=no dst-port=8080 in-interface=wan protocol=tcp src-address=0.0.0.0/0
In in-interface , select your WANinterface.
Howto Add LOGO and Edit Proxy Default ERROR Pages
Goto IP > WEB PROXY
Click on RESET HTML
It will ask you that “Current html pages will be lost ! Reset anyway?” CLick on YES
As shown in the image below . . .
,
Now goto FILES and you will see webproxy/error.html ,
As shown in the image below . . .
Just copy this error.html file to your desktop and edit it using your favorite html editor.
(I personally use MS FRONTPAGE 2003 due to its easy and user friendly interface, You can use notepad to edit this file content as its very small and contains basic text only. just don’t mess with the codes, only change the text you want, for example network name support numbers etc. after saving , upload it back to Mikrotiok under web-proxy section.)
Howto Block Web Site for Single User
To block any website for a single user , Use the following …
/ip proxy access add action=deny comment="Block yahoo for single user" disabled=no dst-host=www.yahoo.com src-address=192.168.2.5 (192.168.2.5 is the user ip)
To block single user and redirect him to your policy page on any loacl web server defining the reason why he is blocked , use the following.
/ip proxy access add action=deny comment="Block yahoo for single user" disabled=no dst-host=www.yahoo.com redirect-to=192.168.2.3/policy/deny.htm src-address=192.168.2.5
(192.168.2.3 is the web server ip , & 192.168.2.5 is the user ip)
As shown in the image below . . .
.
.
Regard’s
SYED JAHANZAIB