# Different gateway for two PPPoE server instance

**URL:** <https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491>\
**Category:** General\
**Created:** [July 17, 2021, 2:55pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491 "2021-07-17T14:55:39Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![anishpsla](https://forum.mikrotik.com/letter_avatar/anishpsla/32/6_449c533f586939b6e5f246632a46421f.png) [@anishpsla](https://forum.mikrotik.com/u/anishpsla)\
**Post date:** [July 17, 2021, 2:55pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/1 "2021-07-17T14:55:39Z")

</div>

I want to use different gateways for my two instance of PPPoE server. I try many tutorials available in Internet but still all the traffic is going through first Gateway only. I am using 2 different /20 pools for those PPPoE servers.

![](https://i.postimg.cc/fb47Xr0S/Mikrotik-pppoe.png)

I want to route traffic from PPPoE server 1 to interface 172.16.11.89/24 and PPPoE server 2 to interface 172.16.10.89/24

---

<div class="post-metadata">

**Author:** ![anishpsla](https://forum.mikrotik.com/letter_avatar/anishpsla/32/6_449c533f586939b6e5f246632a46421f.png) [@anishpsla](https://forum.mikrotik.com/u/anishpsla)\
**Post date:** [July 20, 2021, 2:37pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/2 "2021-07-20T14:37:49Z")

</div>

Any updates ? I am waiting for help from experts

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [July 20, 2021, 2:51pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/3 "2021-07-20T14:51:58Z")

</div>

You practically did not provide any detailed description, data, or export of the configuration, just for example

Nobody is interested in being a detective, with dozens of questions before being told anything useful.

No answer to your question? [How to write posts](http://forum.mikrotik.com/t/getting-the-most-out-of-this-forum/40983/1)

---

<div class="post-metadata">

**Author:** ![anishpsla](https://forum.mikrotik.com/letter_avatar/anishpsla/32/6_449c533f586939b6e5f246632a46421f.png) [@anishpsla](https://forum.mikrotik.com/u/anishpsla)\
**Post date:** [July 20, 2021, 6:33pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/4 "2021-07-20T18:33:11Z")

</div>

> I want to route traffic from PPPoE server 1 to interface 172.16.11.89/24 and PPPoE server 2 to interface 172.16.10.89/24

Hope the image and the above description is enough understanding the question.

The problem is, whatever I do, all the traffic is going through the first interface (172.16.10.89/24). I can’t route the traffic through the second interface.

---

<div class="post-metadata">

**Author:** ![anav](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/anav/32/2112_2.png) [@anav](https://forum.mikrotik.com/u/anav)\
**Post date:** [July 20, 2021, 7:33pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/5 "2021-07-20T19:33:44Z")

</div>

/export hide-sensitive file=anynameyouwish

---

<div class="post-metadata">

**Author:** ![anishpsla](https://forum.mikrotik.com/letter_avatar/anishpsla/32/6_449c533f586939b6e5f246632a46421f.png) [@anishpsla](https://forum.mikrotik.com/u/anishpsla)\
**Post date:** [July 24, 2021, 1:03pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/6 "2021-07-24T13:03:03Z")

</div>

The attachment have all the details. Waiting for expert advice.  
[file\_config.rsc](https://forum.mikrotik.com/uploads/short-url/3f7mtSAcr6u90NkJ71llmIX9KUR.rsc) (1.82 KB)

---

<div class="post-metadata">

**Author:** ![DarkNate](https://forum.mikrotik.com/letter_avatar/darknate/32/6_449c533f586939b6e5f246632a46421f.png) [@DarkNate](https://forum.mikrotik.com/u/DarkNate)\
**Post date:** [July 24, 2021, 1:46pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/7 "2021-07-24T13:46:33Z")

</div>

You need to create a separate profile per PPPoE Server with a unique gateway in the “local address” field. After that PPPoE Client behind each PPPoE Server will get unique gateway and can talk to each other without going to layer 2.

Details [here](https://www.daryllswer.com/edge-router-bng-optimisation-guide-for-isps/)

---

<div class="post-metadata">

**Author:** ![anishpsla](https://forum.mikrotik.com/letter_avatar/anishpsla/32/6_449c533f586939b6e5f246632a46421f.png) [@anishpsla](https://forum.mikrotik.com/u/anishpsla)\
**Post date:** [July 25, 2021, 4:44am UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/8 "2021-07-25T04:44:51Z")

</div>

Thankyou for your reply, But my requirement is something different.

I want to route two instances of PPPoE server into two upstream providers. At present, I can’t do it. All traffic are going through first upstream provider only. Hope the attached file help you further to understand my requirement.

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [July 25, 2021, 7:05am UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/9 "2021-07-25T07:05:23Z")

</div>

Paste this on terminal and use this as start point. I hope I’ve wroted it correctly.  
Each line is a failover for the other, if for some reason one of the two ISP go down.

```plaintext
/ip route
add check-gateway=ping distance=10 gateway=172.16.4.1 routing-mark=PPPoE1
add check-gateway=ping distance=20 gateway=172.16.4.9 routing-mark=PPPoE1
add check-gateway=ping distance=20 gateway=172.16.4.1 routing-mark=PPPoE2
add check-gateway=ping distance=10 gateway=172.16.4.9 routing-mark=PPPoE2
add check-gateway=ping distance=10 gateway=172.16.4.1
add check-gateway=ping distance=20 gateway=172.16.4.9
/ip route rule
add action=lookup-only-in-table src-address=100.64.64.0/21 table=PPPoE1
add action=lookup-only-in-table dst-address=100.64.64.0/21 table=PPPoE1
add action=lookup-only-in-table src-address=100.64.72.0/21 table=PPPoE2
add action=lookup-only-in-table dst-address=100.64.72.0/21 table=PPPoE2

```

**I do not see any firewall rules, is a test or you are kidding?**

---

<div class="post-metadata">

**Author:** ![anishpsla](https://forum.mikrotik.com/letter_avatar/anishpsla/32/6_449c533f586939b6e5f246632a46421f.png) [@anishpsla](https://forum.mikrotik.com/u/anishpsla)\
**Post date:** [July 26, 2021, 4:36pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/10 "2021-07-26T16:36:11Z")

</div>

Thanks for your reply. Can you do one more thing for me.

I do not want to failover. First upstream provider is fully loaded (1G). So I want to route second instance of PPPoE to another upstream provider. I do not want to failover.

**I can’t set routing mark in mangle or it’s not properly working. Please post proper mangle rule also**

> I do not see any firewall rules, is a test or you are kidding?

It’s a heavily edited version. I delete all those lines I think unnecessary for public view.

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [July 26, 2021, 4:49pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/11 "2021-07-26T16:49:28Z")

</div>

The routing is routing and the mangling is mangling.  
The “mangling” is moved on proper place, the routes rules

```plaintext
/ip route
add check-gateway=ping distance=10 gateway=172.16.4.1
add check-gateway=ping distance=10 gateway=172.16.4.1 routing-mark=PPPoE1
add check-gateway=ping distance=10 gateway=172.16.4.9 routing-mark=PPPoE2
/ip route rule
add action=lookup-only-in-table src-address=100.64.64.0/21 table=PPPoE1
add action=lookup-only-in-table dst-address=100.64.64.0/21 table=PPPoE1
add action=lookup-only-in-table src-address=100.64.72.0/21 table=PPPoE2
add action=lookup-only-in-table dst-address=100.64.72.0/21 table=PPPoE2

```

---

<div class="post-metadata">

**Author:** ![anishpsla](https://forum.mikrotik.com/letter_avatar/anishpsla/32/6_449c533f586939b6e5f246632a46421f.png) [@anishpsla](https://forum.mikrotik.com/u/anishpsla)\
**Post date:** [July 26, 2021, 5:12pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/12 "2021-07-26T17:12:14Z")

</div>

Without mangle how can I do Routing-Mark like here

```plaintext
/ip route
add check-gateway=ping distance=10 gateway=172.16.4.1 routing-mark=PPPoE1

```

---

<div class="post-metadata">

**Author:** ![rextended](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/rextended/32/67729_2.png) [@rextended](https://forum.mikrotik.com/u/rextended)\
**Post date:** [July 26, 2021, 5:21pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/13 "2021-07-26T17:21:55Z")

</div>

??? is the same line on the script on previous post… ???

---

<div class="post-metadata">

**Author:** ![anishpsla](https://forum.mikrotik.com/letter_avatar/anishpsla/32/6_449c533f586939b6e5f246632a46421f.png) [@anishpsla](https://forum.mikrotik.com/u/anishpsla)\
**Post date:** [September 21, 2021, 2:25pm UTC](https://forum.mikrotik.com/t/different-gateway-for-two-pppoe-server-instance/150491/14 "2021-09-21T14:25:30Z")

</div>

For simplicity, I configure another Mikrotik and not working. If I disable rule and remove it in route I can ping. Please help

```plaintext
/ip address> print
103.x.x.x/29 103.x.x.0 ether1                                                                       
103.y.y.y/29 103.y.y.0 ether2                                                                       
192.168.1.1/24 192.168.1.0 ether6
192.168.2.1/24 192.168.2.0 ether7

/ip firewall nat> print
chain=srcnat action=src-nat to-addresses=103.x.x.x src-address=192.168.1.0/24 out-interface=ether1 log=no log-prefix="" 
chain=srcnat action=src-nat to-addresses=103.y.y.y src-address=192.168.2.0/24 out-interface=ether2 log=no log-prefix=""

/ip route> print
dst-address=0.0.0.0/0 gateway=103.x.x.x gateway-status=103.x.x.x reachable via ether1 distance=1 scope=30 target-scope=10 routing-mark=route1 
dst-address=0.0.0.0/0 gateway=103.y.y.y gateway-status=103.y.y.y reachable via ether2 distance=1 scope=30 target-scope=10 routing-mark=route2 
dst-address=0.0.0.0/0 gateway=103.x.x.x gateway-status=103.x.x.x reachable via ether1 distance=1 scope=30 target-scope=10 

/ip route rule> print detail
src-address=192.168.1.0/24 action=lookup-only-in-table table=route1 
src-address=192.168.2.0/24 action=lookup-only-in-table table=route2 
dst-address=192.168.1.0/24 action=lookup-only-in-table table=route1 
dst-address=192.168.2.0/24 action=lookup-only-in-table table=route2

```
