mrmarble
Usuari@ ADSLzone
- Mensajes
- 4
Buenas a todos! Soy de España y me dedico al desarrollo de software, pero de redes entiendo poco 
Llevo ya una semana trasteando con mi nuevo Mikrotik RB5009UG+S+IN y una ONT Ubiquiti Loco siguiendo los manuales que hay en el foro y con ayuda de san Google lo configure todo y tengo acceso a Internet sin problemas. Me surgen un par de dudas respecto a la ONT y sobre VLANs, dejo aqui mi config (he omitido los scripts y los leases de dhcp):
En el post de Tips & Tricks, hay un comentario sobre como acceder a la ONT a traves del router, he seguido la guia pero no consigo acceder, la ONT tiene la IP 192.168.10.2 y la interfaz eth1 tiene la 192.168.10.1, desde mi pc puedo hacer un ping a 192.168.10.1, pero 192.168.10.2 no responde, si hago un ping desde el mikrotik responde sin problemas (incluso probe con /tool/fetch a acceder al portal web de la ont y sin problemas) no se que puede estar pasando, lo estuve mirando con un amigo que tiene el mismo setup (router+ont) y el puede acceder sin problemas.
Sobre las reglas del firewall, esta regla que viene configurada por defecto
El tema de las VLANs es mas una consulta que un problema, me gustaria segmentar la red, ya que tengo varios dispositivos de IoT y un servidor en casa para media y domotica, mi router wifi es un TP-Link Deco M4 (mesh) en modo AP que no tiene configuracion para VLANs, no se si soporta enviar los tags, pero bueno mi duda principal es si puedo crear un bridge con varias VLANs asociadas a la misma interfaz del router y asignar los dispositivos a una VLAN en concreto, por ejemplo VLANs para IoT, Invitados y usuarios, donde por defecto al conectarse un dispositivo nuevo, el DHCP lo configura en la VLAN de invitados y yo manualmente lo muevo a la que corresponda (o lo dejo en invitados), lei el post sobre VLAN bridge pero no lo entendi muy bien.
Muchas gracias y buen dia a todos.
Llevo ya una semana trasteando con mi nuevo Mikrotik RB5009UG+S+IN y una ONT Ubiquiti Loco siguiendo los manuales que hay en el foro y con ayuda de san Google lo configure todo y tengo acceso a Internet sin problemas. Me surgen un par de dudas respecto a la ONT y sobre VLANs, dejo aqui mi config (he omitido los scripts y los leases de dhcp):
NGINX:
# apr/28/2022 09:47:55 by RouterOS 7.2.1
# software id = YCKV-FGWZ
#
# model = RB5009UG+S+
# serial number = EC190F4AE01B
/interface bridge
add name=bridge-ISP
/interface ethernet
set [ find default-name=ether1 ] comment=WAN
set [ find default-name=ether2 ] comment=LAN
set [ find default-name=ether3 ] comment=LAN
set [ find default-name=ether4 ] comment=LAN
set [ find default-name=ether5 ] comment=LAN
set [ find default-name=ether6 ] comment=LAN
set [ find default-name=ether7 ] comment=LAN
set [ find default-name=ether8 ] comment=LAN
set [ find default-name=sfp-sfpplus1 ] comment=LAN
/interface vlan
add interface=ether1 name=vlan3-telefono vlan-id=3
add interface=ether1 name=vlan6-internet vlan-id=6
/interface pppoe-client
add add-default-route=yes disabled=no interface=vlan6-internet name=internet user=adslppp@telefonicanetpa
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool0 ranges=192.168.1.2-192.168.1.254
/ip dhcp-server
add address-pool=dhcp_pool0 interface=bridge-ISP lease-script="\r\
\n\r\
\n# Created Jotne 2021 v1.0\r\
\n# Modified by diamuxin\r\
\n\r\
\n/ip dhcp-server lease\r\
\n# Test if this is a Bound session and the lease is a dynamic one.\r\
\n# Do not change older reservation.\r\
\n:if ((\$leaseBound=1) && ([find where dynamic mac-address=\$leaseActMAC]!=\"\")) do={\r\
\n\r\
\n # Get the lease number\r\
\n :local Lease [find mac-address=\$leaseActMAC]\r\
\n\r\
\n # Get date, time and Device name\r\
\n :local date [/system clock get date]\r\
\n :local time [/system clock get time]\r\
\n :local DeviceName [/system identity get name]\r\
\n\r\
\n # Make the lease static\r\
\n make-static \$Lease\r\
\n\r\
\n # Get host name\r\
\n :local Name [get \$Lease host-name ]\r\
\n\r\
\n # Add date and time as a comment to show when it was seen first time\r\
\n comment comment=\"\$date \$time \$Name\" \$Lease\r\
\n\r\
\n :delay 2s\r\
\n # START Send Telegram Module\r\
\n :local MessageText \"\\E2\\84\\B9 \$DeviceName: Info DHCP %0D%0A Nombre: \$Name %0D%0A IP: \$leaseActIP %0D%0A MAC: \$leaseActMAC %0D%0A Comentario: \$comment\";\r\
\n :local SendTelegramMessage [:parse [/system script get MyTGBotSendMessage source]];\r\
\n \$SendTelegramMessage MessageText=\$MessageText;\r\
\n #END Send Telegram Module\r\
\n\r\
\n # Send a message to the log\r\
\n :log info message=\"DHCP Info: IP=\$leaseActIP MAC=\$leaseActMAC name=\$Name\"\r\
\n}\r\
\n\r\
\n" name=dhcp1
/routing rip instance
add afi=ipv4 disabled=no name=rip
/interface bridge port
add bridge=bridge-ISP interface=ether2
add bridge=bridge-ISP interface=ether3
add bridge=bridge-ISP interface=ether4
add bridge=bridge-ISP interface=ether5
add bridge=bridge-ISP interface=ether6
add bridge=bridge-ISP interface=ether7
add bridge=bridge-ISP interface=ether8
/interface list member
add interface=ether1 list=WAN
add interface=internet list=WAN
add interface=ether2 list=LAN
add interface=ether3 list=LAN
add interface=ether4 list=LAN
add interface=ether5 list=LAN
add interface=ether6 list=LAN
add interface=ether7 list=LAN
add interface=ether8 list=LAN
/ip address
add address=192.168.1.1/24 interface=bridge-ISP network=192.168.1.0
add address=192.168.10.1/24 comment=ont interface=ether1 network=192.168.10.0
/ip cloud
set ddns-enabled=yes ddns-update-interval=1d
/ip dhcp-client
add add-default-route=no interface=vlan3-telefono use-peer-dns=no use-peer-ntp=no
/ip dhcp-server network
add address=192.168.1.0/24 dns-server=192.168.1.140 gateway=192.168.1.1
add address=192.168.10.0/24 gateway=192.168.10.1
/ip dns
set servers=1.1.1.1
/ip firewall address-list
add address=173.245.48.0/20 comment="Cloudflare edge nodes" list=Cloudflare
add address=103.21.244.0/22 comment="Cloudflare edge nodes" list=Cloudflare
add address=103.22.200.0/22 comment="Cloudflare edge nodes" list=Cloudflare
add address=103.31.4.0/22 comment="Cloudflare edge nodes" list=Cloudflare
add address=141.101.64.0/18 comment="Cloudflare edge nodes" list=Cloudflare
add address=108.162.192.0/18 comment="Cloudflare edge nodes" list=Cloudflare
add address=190.93.240.0/20 comment="Cloudflare edge nodes" list=Cloudflare
add address=188.114.96.0/20 comment="Cloudflare edge nodes" list=Cloudflare
add address=197.234.240.0/22 comment="Cloudflare edge nodes" list=Cloudflare
add address=198.41.128.0/17 comment="Cloudflare edge nodes" list=Cloudflare
add address=162.158.0.0/15 comment="Cloudflare edge nodes" list=Cloudflare
add address=104.16.0.0/13 comment="Cloudflare edge nodes" list=Cloudflare
add address=104.24.0.0/14 comment="Cloudflare edge nodes" list=Cloudflare
add address=172.64.0.0/13 comment="Cloudflare edge nodes" list=Cloudflare
/ip firewall filter
add action=accept chain=input comment="voip: accept rip multicast traffic" dst-address=224.0.0.9 dst-port=520 in-interface=vlan3-telefono protocol=udp
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" disabled=yes 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=forward connection-nat-state=dstnat connection-state=new in-interface=ether1
/ip firewall mangle
add action=set-priority chain=postrouting new-priority=1 out-interface=internet
add action=set-priority chain=postrouting new-priority=4 out-interface=vlan3-telefono
/ip firewall nat
add action=masquerade chain=srcnat comment="pppoe: masq public ip" out-interface=internet
add action=masquerade chain=srcnat comment="voip: masq voip" out-interface=vlan3-telefono
add action=dst-nat chain=dstnat comment="Server https" dst-port=443 in-interface=internet protocol=tcp src-address-list=Cloudflare to-addresses=192.168.1.220 to-ports=443
add action=dst-nat chain=dstnat comment="Server http" dst-port=80 in-interface=internet protocol=tcp src-address-list=Cloudflare to-addresses=192.168.1.220 to-ports=80
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh address=192.168.1.0/24
set api disabled=yes
set api-ssl disabled=yes
/routing rip interface-template
add instance=rip interfaces=vlan3-telefono mode=passive
/snmp
set enabled=yes
/system clock
set time-zone-name=Europe/Madri
En el post de Tips & Tricks, hay un comentario sobre como acceder a la ONT a traves del router, he seguido la guia pero no consigo acceder, la ONT tiene la IP 192.168.10.2 y la interfaz eth1 tiene la 192.168.10.1, desde mi pc puedo hacer un ping a 192.168.10.1, pero 192.168.10.2 no responde, si hago un ping desde el mikrotik responde sin problemas (incluso probe con /tool/fetch a acceder al portal web de la ont y sin problemas) no se que puede estar pasando, lo estuve mirando con un amigo que tiene el mismo setup (router+ont) y el puede acceder sin problemas.
Sobre las reglas del firewall, esta regla que viene configurada por defecto
add action=drop chain=input comment="defconf: drop all not coming from LAN" disabled=yes in-interface-list=!LAN
al activarla se me cae medio internet, no entiendo por que, las listas de LAN y WAN estan bien (creo)El tema de las VLANs es mas una consulta que un problema, me gustaria segmentar la red, ya que tengo varios dispositivos de IoT y un servidor en casa para media y domotica, mi router wifi es un TP-Link Deco M4 (mesh) en modo AP que no tiene configuracion para VLANs, no se si soporta enviar los tags, pero bueno mi duda principal es si puedo crear un bridge con varias VLANs asociadas a la misma interfaz del router y asignar los dispositivos a una VLAN en concreto, por ejemplo VLANs para IoT, Invitados y usuarios, donde por defecto al conectarse un dispositivo nuevo, el DHCP lo configura en la VLAN de invitados y yo manualmente lo muevo a la que corresponda (o lo dejo en invitados), lei el post sobre VLAN bridge pero no lo entendi muy bien.
Muchas gracias y buen dia a todos.