התקדמנו, עידכון:
זו הבעיה:
מסתבר ש- PPPOe כן יוצר אתגר ביצועים:
ב- UDM ונגזרותיו הביצועים גרועים מאד באופן שלא ניתן לקבל קצבים מעל 2.5G למרות שהחומרה מסוגלת לזה. ב- OPNSense / pfSense למרות השימוש ב- VirtIO או RSS יש ליבה אחת עמוסה יותר מהאחרות, מה שקובע בסופו של דבר את הקצבים שניתן לקבל עבור חומרה ספציפית, או לחילופין, זה מוריד את ה- Headroom הקיים עבור שרותים נוספים שמעמיסים גם הם את המעבד
והרעיון הוא לבנות תצורה אשר תרוץ על מכונה פיזית או וירטואלית ותבצע חיבור PPPOE , ואת הכתובת WAN המתקבלת - תעביר אחורה באמצעות DHCP. באמצעות תצורה כזו ניתן לבצע PPPOE Offloading למכונה אחרת מאשר המכונה שמבצעת Firewall, ו- NAT (וכל שאר השירותים). התצורה הזו נקראת Half Bridge. שימוש לדוגמא הוא לשים מכונה כזו לפני UDM וכך לקבל קצבים גבוהים ולעקוף את המגבלה של PPPOE. סוף סוף הצלחתי להגיע לפיתרון עובד, ורק לחדד: לא מבוצע NAT כפול או סינון כלשהוא.
גם בהמשך לשאלה כאן בפורום:
viewtopic.php?t=391405&start=360#p3400612+
התצורה רצה על Router OS של מיקרוטיק, המימוש של PPPOE הוא טוב, וניתן להשתמש בשפת Scripting שבאמצעותה ניתן לעשות הכל. הגדרות:
ממשק ether1 - upstream מתחבר ל-ONT ומבצע את חיבור ה- PPPOE
ממשק ether2 - downstream מריץ שרת DHCP המשרת את שאר הרשת
המימוש:
* חייגן PPPOE מוגדר על ether1
* שרת DHCP מוגדר על ether2, בתחילה עם כתובת dummy
* לאחר שה- PPPOE מתחבר מתבצע עידכון של ה-DHCP Pool
להלן סקריפט ההגדרה:
קוד: בחירת הכל
#[ISP] ──PPPoE──► [MikroTik] ──► [Downstream Router]
# As half bridge gets PUBLIC IP via DHCP
####################################################
# PPPoE Public IP Passthrough - Dynamic IP Handler
# Paste entirely into MikroTik terminal
####################################################
# Set system identity
/system identity
set name=Half-Bridge
#
####################################################
# ether1 is the Upstream - WAN interface
# ether2 is the downstream LAN interface
####################################################
# ── 1. Add a dummy IP address on downstream interface ───────────────────────────────
/ip/address/add interface=ether2 address=169.254.0.26/30
/ipv6/address/add interface=ether2 address=2001:db8::1
/ipv6/nd/prefix/default set autonomous=no
# ── 2. Create DHCP Server ─────────────────────────
# Dummy IP to start with
/ip/pool/add name=wan ranges=169.254.0.25
/ip/dhcp-server/add name=wan interface=ether2 address-pool=wan lease-time=2m conflict-detection=no
/ip/dhcp-server/network/add comment="WAN" address=169.254.0.24/30 gateway=169.254.0.26 dns-server=8.8.8.8,8.8.4.4
/ipv6/dhcp-server/add name=wan interface=ether2 prefix-pool=wan lease-time=2m conflict-detection=no
/ipv6/nd/set [ find default=yes ] interface=ether2 managed-address-configuration=yes other-configuration=yes mtu=1492
# ── 3. PPPoE Client ────────────────────────────────
/interface pppoe-client
add name=pppoe-out1 \
interface=ether1 \
user=<Username> \
password=<*******> \
add-default-route=yes \
use-peer-dns=yes \
disabled=no
# 4. Update script ────────────────────────────────
/system script
add name=update-passthrough \
policy=read,write,policy,test \
comment="Updates passthrough config when PPPoE IP changes" \
source={
:log info "Half Bridge: Update Script Started"
:local wanAddr4 ([/interface/pppoe-client/monitor pppoe as-value once] -> "local-address");
:local mask4 1;
:local netAddr4;
:local bcastAddr4;
:local gatewayAddr4;
:do {
:set mask4 ($mask4 + 1);
:set netAddr4 (($wanAddr4 >> $mask4) << $mask4);
:set bcastAddr4 ($netAddr4 + (1 << $mask4) - 1);
} while=(($wanAddr4 = $netAddr4) || ($wanAddr4 = $bcastAddr4));
:set gatewayAddr4 ($netAddr4 + 1);
:if ($gatewayAddr4 = $wanAddr4) do={:set gatewayAddr4 ($bcastAddr4 - 1)};
# The IP address on the pppoe interface has to be removed in order to prevent a conflict.
/ip/address/remove [find interface=pppoe-out1]
/ip/address/set [find interface=ether2] address="$gatewayAddr4/$(32 - $mask4)"
/ip/dhcp-server/network/set [find comment="WAN"] address="$netAddr4/$(32 - $mask4)" gateway=$gatewayAddr4
/ip/pool/set wan ranges=$wanAddr4
:log info "Half Bridge: Delegated ipv4 Address = [$netAddr4/$(32 - $mask4)]"
:log info "Half Bridge: Gateway ipv4 Address = [$gatewayAddr4]"
:log info "Half Bridge: Update Script Ended"
}
# 5. Run script when a DHCP v6 lease is obtained ────────────────────────────────
/ipv6 dhcp-client add interface=pppoe-out1 pool-name=wan request=prefix script=update-passthrough validate-server-duid=no
מתועד ונבדק על רשת בזק
השלבים הבאים:
* מימוש על OpenWRT
קרדיט:
עיקר הרעיון מבחינת חישוב הכתובות הוא כאן:
https://gist.github.com/maurice-w/402ee ... 9c34260283 היה צורך במספר תיקונים על מנת שיעבוד.
עריכה: עניין אותי מה ההשפעה של פתיחה בלבד של PPPOE ללא NAT או Firewall. את הבדיקה ביצעתי על RB450GX4, נתב עם ארבע ליבות ARM IPQ4019, וחמישה פורטים של גיגביט.
בתצורה הזו תעבורה של 1Gbps הלאה לנתב יצרה עומס מאוזן פחות או יותר של 30% על כל הליבות, לא מעט כאשר לא מדובר כמעט בשום עיבוד. נבדוק על מכונות חזקות יותר בהמשך.