# Passing all traffic on to proxy server

**URL:** <https://forum.mikrotik.com/t/passing-all-traffic-on-to-proxy-server/95501>\
**Category:** Beginner Basics\
**Created:** [February 17, 2016, 7:14pm UTC](https://forum.mikrotik.com/t/passing-all-traffic-on-to-proxy-server/95501 "2016-02-17T19:14:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddell](https://forum.mikrotik.com/letter_avatar/ddell/32/6_449c533f586939b6e5f246632a46421f.png) [@ddell](https://forum.mikrotik.com/u/ddell)\
**Post date:** [February 17, 2016, 7:14pm UTC](https://forum.mikrotik.com/t/passing-all-traffic-on-to-proxy-server/95501/1 "2016-02-17T19:14:43Z")

</div>

Greetings,

Here is what I’m trying to accomplish. I am on a network that requires the use of a proxy server. I would prefer to not enter all the settings for the proxy into every device. Thus I want to use my mikrotik to forward all traffic to the proxy server. On my rb750, I will have one port connecting to the network, the other ports I would like to function as simple switch ports and then rules for all those ports to forward traffic to ip server. I found the article in the wiki on making a transparent web proxy but that’s not exactly what I’m trying to do. Any advice would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![scampbell](https://forum.mikrotik.com/letter_avatar/scampbell/32/6_449c533f586939b6e5f246632a46421f.png) [@scampbell](https://forum.mikrotik.com/u/scampbell)\
**Post date:** [February 18, 2016, 7:15pm UTC](https://forum.mikrotik.com/t/passing-all-traffic-on-to-proxy-server/95501/2 "2016-02-18T19:15:02Z")

</div>

You need to create a dstnat rule with

/ip firewall nat  
add chain=dstnat action=dst-nat to-address=proxyIP to-ports=8080 protocol=TCP, dst-port=80,443 in-interface=bridge-lan

This will redirect any HTTP and HTTPS to your proxy on port 8080.

Change settings to suit your proxy 🙂

---

<div class="post-metadata">

**Author:** ![ZeroByte](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/zerobyte/32/905_2.png) [@ZeroByte](https://forum.mikrotik.com/u/ZeroByte)\
**Post date:** [February 19, 2016, 2:50am UTC](https://forum.mikrotik.com/t/passing-all-traffic-on-to-proxy-server/95501/3 "2016-02-19T02:50:23Z")

</div>

> [@scampbell](#):
>
> /ip firewall nat  
> add chain=dstnat action=dst-nat to-address=proxyIP to-ports=8080 protocol=TCP, dst-port=80,443 in-interface=bridge-lan
> 
> This will redirect any HTTP and HTTPS to your proxy on port 8080.

Doesn’t transparent proxy give certificate issues with SSL?

> [@ddell](#):
>
> I am on a network that requires the use of a proxy server.

You might try setting up WPAD so browsers will automatically detect proxy settings.

Here is a page that covers the steps to deploy WPAD which is how browsers automatically detect proxy server settings.  
[http://findproxyforurl.com/deploying-wpad/](http://findproxyforurl.com/deploying-wpad/)

The format of the PAC file (which is named wpad.dat on your website) is also discussed on the page.

---

<div class="post-metadata">

**Author:** ![scampbell](https://forum.mikrotik.com/letter_avatar/scampbell/32/6_449c533f586939b6e5f246632a46421f.png) [@scampbell](https://forum.mikrotik.com/u/scampbell)\
**Post date:** [February 19, 2016, 3:28am UTC](https://forum.mikrotik.com/t/passing-all-traffic-on-to-proxy-server/95501/4 "2016-02-19T03:28:47Z")

</div>

> [@ZeroByte](#):
>
> > [@scampbell](#):
> >
> > /ip firewall nat  
> > add chain=dstnat action=dst-nat to-address=proxyIP to-ports=8080 protocol=TCP, dst-port=80,443 in-interface=bridge-lan
> > 
> > This will redirect any HTTP and HTTPS to your proxy on port 8080.
> 
> Doesn’t transparent proxy give certificate issues with SSL?
> 
> > [@ddell](#):
> >
> > I am on a network that requires the use of a proxy server.
> 
> You might try setting up WPAD so browsers will automatically detect proxy settings.
> 
> Here is a page that covers the steps to deploy WPAD which is how browsers automatically detect proxy server settings.  
> [http://findproxyforurl.com/deploying-wpad/](http://findproxyforurl.com/deploying-wpad/)
> 
> The format of the PAC file (which is named wpad.dat on your website) is also discussed on the page.

I agree proxying 443 is not at all possible on Mikrotik’s own proxy, but apparently some proxies claim they can handle this such as Squid using whats called the **CONNECT Tunnel** method (RFC2817) - [http://wiki.squid-cache.org/Features/HTTPS](http://wiki.squid-cache.org/Features/HTTPS)

I included TCP 443 just to capture all browser traffic.

The WPAD idea is excellent as I have used that for PC’s in a school environment. The one glitch with that method is that Tablets dont recognise it - (at least they didnt when we tried …hehe ) so for that we used a dstnat rule to force them to use Squid.

The Squid site had some interesting stuff on WPAD too - [http://wiki.squid-cache.org/SquidFaq/ConfiguringBrowsers#Automatic\_WPAD\_with\_DNS](http://wiki.squid-cache.org/SquidFaq/ConfiguringBrowsers#Automatic_WPAD_with_DNS) 🙂

---

<div class="post-metadata">

**Author:** ![ZeroByte](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/zerobyte/32/905_2.png) [@ZeroByte](https://forum.mikrotik.com/u/ZeroByte)\
**Post date:** [February 19, 2016, 3:31am UTC](https://forum.mikrotik.com/t/passing-all-traffic-on-to-proxy-server/95501/5 "2016-02-19T03:31:42Z")

</div>

Yup - WPAD for the willing, and dstnat for the clueless or mischievous. ![:mrgreen:](https://data-discourse.cdn.mikrotik.com/original/2X/4/442e459c5ced45cb70e8a05e77e07cea6fee4928.gif "Mr. Green")

I never set it up myself, but I did configure a ROS proxy manually in my browser one time helping in another thread here, and SSL worked without certificate issues when I did that. (explicitly set the router as my proxy)
