Community discussions

MikroTik App
 
ictoplossing
just joined
Topic Author
Posts: 14
Joined: Wed Jul 12, 2023 6:50 pm

Open port from external via PPPoE and VLAN

Wed Jul 12, 2023 7:21 pm

Hello guys,
I try to setup VPN (L2TP) on my Mikrotik. I can connect from internal network but i try via cloud host - it don't work.

Mikrotik have connection via PPPoE with username:password and must have VLAN10.

Where am i wrong?

There is my config:
/interface bridge
add admin-mac=00:00:00:00:00:00 auto-mac=no comment=defconf name=bridge \
    vlan-filtering=yes
/interface vlan
add interface=ether1 name=vlan1 vlan-id=10

/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/ip pool
add name=dhcp ranges=10.0.0.10-10.0.0.254
add name=vpn-pool ranges=9.0.0.10-9.0.0.15
/ip dhcp-server
add address-pool=dhcp interface=bridge lease-time=10m name=defconf
/ppp profile
add change-tcp-mss=yes dns-server=9.0.0.1 local-address=9.0.0.1 name=profile1 \
    remote-address=vpn-pool
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=wlan1
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface l2tp-server server
set default-profile=profile1 enabled=yes use-ipsec=required
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
/ip address
add address=10.0.0.1/24 comment=defconf interface=bridge network=10.0.0.0
/ip cloud
set ddns-enabled=yes
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server network
add address=10.0.0.0/24 comment=defconf dns-server=10.0.0.1 gateway=10.0.0.1 \
    netmask=24
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=10.0.0.1 comment=defconf name=router.lan

/ip firewall filter
add action=accept chain=input comment=\
    "defconf: accept established,related,untracked" connection-state=\
    established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
    invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
    "defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
    in-interface-list=!LAN
add action=accept chain=forward comment="defconf: accept in ipsec policy" \
    ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" \
    ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" \
    connection-state=established,related hw-offload=yes
add action=accept chain=forward comment=\
    "defconf: accept established,related, untracked" connection-state=\
    established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" \
    connection-state=invalid
add action=drop chain=forward comment=\
    "defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat \
    connection-state=new in-interface-list=WAN
add action=accept chain=input comment=VPN dst-port=443,500,4500,1701 \
    protocol=udp
add action=accept chain=input comment=VPN protocol=ipsec-esp

/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" \
    ipsec-policy=out,none out-interface-list=WAN
add action=masquerade chain=srcnat out-interface=pppoe-out1
add action=dst-nat chain=dstnat comment=VPN disabled=no dst-port=443 \
    protocol=tcp to-ports=443
	
/ip upnp
set enabled=yes
I guess that i must make Firewall rule or NAT between VLAN and Bridge?
 
drasked
just joined
Posts: 11
Joined: Sun Jun 18, 2023 1:03 pm

Re: Open port from external via PPPoE and VLAN  [SOLVED]

Thu Jul 13, 2023 7:34 pm

/ip firewall filter
add action=accept chain=input comment=VPN dst-port=443,500,4500,1701 \
    protocol=udp
add action=accept chain=input comment=VPN protocol=ipsec-esp

these two need to be above:

add action=drop chain=input comment="defconf: drop all not coming from LAN" \
    in-interface-list=!LAN

might need to enable proxy arp as well:

/interface bridge set 0 arp=proxy-arp

And this wouldn't hurt if you base your firewall rules on WAN/LAN list:

/interface list member
add interface=pppoe-out1 list=WAN
 
ictoplossing
just joined
Topic Author
Posts: 14
Joined: Wed Jul 12, 2023 6:50 pm

Re: Open port from external via PPPoE and VLAN

Fri Jul 14, 2023 10:38 am

Hello drasked,
Thank you for your advices, all work fine! But port 443 still closed if i try to check this port via portchecker online. It's not matter for me.

Now if i am with my vpn connected i can't open any website but can open local network resources.

Image
Image

Any idea?
Last edited by ictoplossing on Fri Jul 14, 2023 10:45 am, edited 2 times in total.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 23404
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Open port from external via PPPoE and VLAN

Fri Jul 14, 2023 6:45 pm

Have you thought about trying wireguard instead??
 
ictoplossing
just joined
Topic Author
Posts: 14
Joined: Wed Jul 12, 2023 6:50 pm

Re: Open port from external via PPPoE and VLAN

Mon Jul 24, 2023 6:58 pm

Have you thought about trying wireguard instead??
Omg, i didn't knew it. Thank you!