Community discussions

MikroTik App
 
dasslinc
just joined
Topic Author
Posts: 1
Joined: Sun Jan 02, 2022 8:43 pm

Issues with DHCP over VLAN

Sun Jan 02, 2022 8:55 pm

Hello all. I am having an issue trying to setup my router correctly. My goal is to segment my network into a few vlans. I have 3 switches attached to this router. I have a few devices connected to the switch that I would like to pick up dhcp on the configured vlan, but they are not doing so. For example, I have a computer attached to ether6 on vlan20, but it does not seem to pick up an IP address when the device is connected. If I attempt to set a static IP address on the computer and attach it to the port, that fails as well. I was wondering if someone could look at my configuration and tell me what I am doing incorrectly. I wish to have sfp1 and sfp2 trunked with all VLANs pushed across, and ether6 on vlan20. Please help.
Here is my configuration. 
# jan/02/2022 10:45:13 by RouterOS 6.49.2
# software id = R5E1-5B9P
#
# model = CRS326-24G-2S+
# serial number = <redacted>
/interface bridge
add name=bridge1
add name=brnet0 vlan-filtering=yes
/interface vlan
add interface=brnet0 name=vlan10 vlan-id=10
add interface=brnet0 name=vlan20 vlan-id=20
add interface=brnet0 name=vlan30 vlan-id=30
add interface=brnet0 name=vlan40 vlan-id=40
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool_88 ranges=192.168.88.2-192.168.88.254
add name=dhcp_pool_10 ranges=192.168.10.2-192.168.10.254
add name=dhcp_pool_20 ranges=192.168.20.2-192.168.20.254
add name=dhcp_pool_30 ranges=192.168.30.2-192.168.30.254
add name=dhcp_pool_40 ranges=192.168.40.2-192.168.40.254
/ip dhcp-server
add address-pool=dhcp_pool_88 disabled=no interface=bridge1 name=dhcp1
add address-pool=dhcp_pool_10 disabled=no interface=vlan10 name=dhcp_vlan10
add address-pool=dhcp_pool_20 disabled=no interface=vlan20 name=dhcp_vlan20
add address-pool=dhcp_pool_30 disabled=no interface=vlan30 name=dhcp_vlan30
add address-pool=dhcp_pool_40 disabled=no interface=vlan40 name=dhcp_vlan40
/interface bridge port
add bridge=bridge1 interface=ether2
add bridge=bridge1 interface=ether3
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=ether5
add bridge=brnet0 frame-types=admit-only-untagged-and-priority-tagged \
    ingress-filtering=yes interface=ether6 pvid=20
add bridge=bridge1 interface=ether7
add bridge=bridge1 interface=ether8
add bridge=bridge1 interface=ether9
add bridge=bridge1 interface=ether10
add bridge=bridge1 interface=ether11
add bridge=bridge1 interface=ether12
add bridge=bridge1 interface=ether13
add bridge=bridge1 interface=ether14
add bridge=bridge1 interface=ether15
add bridge=bridge1 interface=ether16
add bridge=bridge1 interface=ether17
add bridge=bridge1 interface=ether18
add bridge=bridge1 interface=ether19
add bridge=bridge1 interface=ether20
add bridge=bridge1 interface=ether21
add bridge=bridge1 interface=ether22
add bridge=bridge1 interface=ether23
add bridge=bridge1 interface=ether24
add bridge=bridge1 interface=sfp-sfpplus1
add bridge=bridge1 interface=sfp-sfpplus2
/interface bridge vlan
add bridge=brnet0 vlan-ids=20
/interface list member
add interface=ether1 list=WAN
add interface=bridge1 list=LAN
/ip address
add address=192.168.88.1/24 interface=bridge1 network=192.168.88.0
add address=192.168.10.1/24 interface=vlan10 network=192.168.10.0
add address=192.168.20.1/24 interface=vlan20 network=192.168.20.0
add address=192.168.30.1/24 interface=vlan30 network=192.168.30.0
add address=192.168.40.1/24 interface=vlan40 network=192.168.40.0
/ip dhcp-client
add disabled=no interface=ether1
/ip dhcp-server network
add address=0.0.0.0/24 gateway=0.0.0.0 netmask=24
add address=192.168.10.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=192.168.10.1
add address=192.168.20.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=192.168.20.1
add address=192.168.30.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=192.168.30.1
add address=192.168.40.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=192.168.40.1
add address=192.168.88.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=192.168.88.1
/ip dns
set servers=8.8.8.8,8.8.4.4
/ip firewall filter
add action=accept chain=input comment="defconf: accept ICMP after RAW" \
    protocol=icmp
add action=accept chain=input comment=\
    "defconf: access established,related,untracked" connection-state=\
    established,related,untracked
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
    in-interface-list=!LAN
/ip firewall nat
add action=masquerade chain=srcnat
/system clock
set time-zone-name=America/Los_Angeles
/system identity
set name=R0
/system routerboard settings
set boot-os=router-os
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Issues with DHCP over VLAN

Thu Jan 06, 2022 5:56 pm

For every vlan interface on top of bridge, you need that vlan id defined as tagged on bridge interface. For example:
/interface bridge vlan
add bridge=brnet0 vlan-ids=20 tagged=brnet0
That goes for all other interfaces where given vlan id should appear as tagged.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19325
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Issues with DHCP over VLAN

Thu Jan 06, 2022 7:37 pm

Make/Model of router?
Make/Mode of switches?

Suggest having a thorough read of this article........
viewtopic.php?t=143620

if any of the above are MT devices, then suggest you post their configs for best assistance once you have some questions..........
/export hide-sensitive file=anynameyouwish

If they are MT devices and you are using the bridge construct its easy to lock yourself out so recommend you use the SAFE MODE liberally and consider configuring OFF the bridge.
viewtopic.php?t=181718

Who is online

Users browsing this forum: Bing [Bot], Sacred9670 and 51 guests