Community discussions

MikroTik App
 
critter
just joined
Topic Author
Posts: 4
Joined: Wed Mar 29, 2017 7:14 pm

Wrong source public IP on outgoing traffic (pppoe)

Tue Mar 05, 2024 7:07 pm

Hello everybody.
I have failed to make it work, so here I am, humble, asking for help :).

Situation:
RB4011 with local single WAN connectivity over pppoe, because we need public IP and one local subnet.

pppoe-client config is>
/interface/pppoe-client/print
Flags: X - disabled, I - invalid; R - running
0 R name="pppoe-out1" max-mtu=auto max-mru=auto mrru=disabled interface=ether1 user="some_user" password="some_pwd" profile=default keepalive-timeout=10 service-name="" ac-name="" add-default-route=yes default-route-distance=1 dial-on-demand=no use-peer-dns=no
allow=pap,chap,mschap1,mschap2

This gives me expected right public address to pppoe-out1 interface and also necessary private address to ether1 interface.
/ip addr print
Flags: D - DYNAMIC
Columns: ADDRESS, NETWORK, INTERFACE
# ADDRESS NETWORK INTERFACE
;;; LAN
0 172.30.28.1/24 172.30.28.0 bridge
1 D 10.17.46.6/24 10.17.46.0 ether1
2 D 178.211.147.67/32 10.222.222.222 pppoe-out1

Interface list:
/interface/list/export
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add comment=ISP interface=pppoe-out1 list=WAN



Dynamicic routing rules as far as I can tell are properly set, although I am not sure if both should be as default route: Anyway, if this is not OK, I must make it myself by static rules.

/ip/route> print
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, d - DHCP, v - VPN; + - ECMP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
DST-ADDRESS GATEWAY DISTANCE
DAv+ 0.0.0.0/0 pppoe-out1 1
DAd+ 0.0.0.0/0 10.17.46.1 1
DAc 10.17.46.0/24 ether1 0
DAc 10.222.222.222/32 pppoe-out1 0
DAc 172.30.28.0/24 bridge 0

NAT table is what troubles me and it is source of problem in my opinion as I am not sure which interface should be used for SNAT - ether1, pppoe-out1 or both ? Now I use interface list WAN.
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN

Result of this configuration is that when open connection to internet, that connection is registered under public IP 77.48.134.54 (which is IP of pppoe gw or something) instead of IP 178.211.147.67, which is on pppoe-out1 interface.
So Outgoing traffic have wrong source public IP, but why ?
My first thought was that I should SNAT on pppoe-out1, but is that right ?
Thank you in advance for your opinion.
 
CGGXANNX
Frequent Visitor
Frequent Visitor
Posts: 64
Joined: Thu Dec 21, 2023 6:45 pm

Re: Wrong source public IP on outgoing traffic (pppoe)

Tue Mar 05, 2024 7:54 pm

You should either disable DHCP Client on the ether1 interface (you don't need that for PPPoE to work) or, if you still want to keep it, set "Add Default Route" to "no" for that DHCP Client entry.
 
critter
just joined
Topic Author
Posts: 4
Joined: Wed Mar 29, 2017 7:14 pm

Re: Wrong source public IP on outgoing traffic (pppoe)

Tue Mar 05, 2024 8:25 pm

Man thank you, by remove dhcp client on ether1 changed things for better - it removed one default route , removed IP on ether1 and also there is no need to change anything in NAT. Thank you.

Who is online

Users browsing this forum: akakua, qatar2022 and 22 guests