Community discussions

MikroTik App
 
lurch
just joined
Topic Author
Posts: 23
Joined: Mon Jan 24, 2022 5:45 pm

dhcp server with vlan

Mon May 09, 2022 6:38 pm

Hi i'm trying to do the following and struggling to get it working.

What i need
1, Setup a dhcp server with subnet i.e 10.20.20.0/24
2, Create a vlan i.e Vlan 100
3, When I untag a port i.e 10 with vlan 100 it gets an ip form the above range.

So far I have
1, Created a bridge interface called dhcp, type bridge, vlan 100
2, Dhcp server/dhcp name dhcp interface dhcp address pool dhcp
3, Dhcp server/networks, address 10.20.20.0/24 gateway (mikrotik ip)
4, Untagged port 10 with vlan 100 and set bridge name to dhcp

I get an ip address of 10.20.20.252 on port 10 with gateway of mikrotik ip which is on bridge interface "bridge" ie not the dhcp bridge how do i either allow traffic to pass between bridges or create a new gateway i,e 10.20.20.254 and allow traffic through that?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11381
Joined: Thu Mar 03, 2016 10:23 pm

Re: dhcp server with vlan

Mon May 09, 2022 6:48 pm

Post the configuration ... you get it by running /export hide-sensitive file=anynameyouwish inside terminal window. Get the file off device, open it with text editor, redact any sensitive data remeaning (device's serial number, wireless passwords, PPPoE usernames, ...). Then copy-paste the remaining herem, enclosing it inside [code] [/code] environment.

You should include at least sections /interface and /ip dhcp-server (with subtrees).
 
lurch
just joined
Topic Author
Posts: 23
Joined: Mon Jan 24, 2022 5:45 pm

Re: dhcp server with vlan

Mon May 09, 2022 8:06 pm

Hi thanks for the reply here is the relevant config, ideally I would like the dhcp range to have it's own gateway ip.
# jan/17/1970 08:03:18 by RouterOS 6.48.6
# software id = AUTI-FPMJ
#
# model = CRS354-48G-4S+2Q+

/interface bridge
add admin-mac=xx:xx:xx:xx:xx auto-mac=no comment=defconf name=bridge \
    vlan-filtering=yes
add name=dhcp pvid=100 vlan-filtering=yes
/interface ethernet
set [ find default-name=ether3 ] disabled=yes
/interface list
add name=WAN
add name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=hotspot
/ip pool
add name=dhcp ranges=10.20.20.0-10.20.20.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=dhcp name=dhcp
/interface bridge port
add bridge=dhcp comment=defconf interface=ether10 pvid=100

/interface bridge vlan
add bridge=bridge vlan-ids=1

/interface list member
add interface=ether1 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
add interface=ether9 list=LAN
add interface=ether10 list=LAN
add interface=ether11 list=LAN
add interface=ether12 list=LAN
add interface=ether13 list=LAN
add interface=ether14 list=LAN
add interface=ether15 list=LAN
add interface=ether16 list=LAN
add interface=ether17 list=LAN
add interface=ether18 list=LAN
add interface=ether19 list=LAN
add interface=ether20 list=LAN
add interface=ether21 list=LAN
add interface=ether22 list=LAN
add interface=ether23 list=LAN
add interface=ether24 list=LAN
add interface=ether25 list=LAN
add interface=ether26 list=LAN
add interface=ether27 list=LAN
add interface=ether28 list=LAN
add interface=ether29 list=LAN
add interface=ether30 list=LAN
add interface=ether31 list=LAN
add interface=ether32 list=LAN
add interface=ether33 list=LAN
add interface=ether34 list=LAN
add interface=ether35 list=LAN
add interface=ether36 list=LAN
add interface=ether37 list=LAN
add interface=ether38 list=LAN
add interface=ether39 list=LAN
add interface=ether40 list=LAN
add interface=ether41 list=LAN
add interface=ether42 list=LAN
add interface=ether43 list=LAN
add interface=ether44 list=LAN
add interface=ether45 list=LAN
add interface=ether46 list=LAN
add interface=ether47 list=LAN
add interface=ether48 list=LAN
add interface=ether49 list=LAN
add interface=qsfpplus1-1 list=LAN
add interface=qsfpplus1-2 list=LAN
add interface=qsfpplus1-3 list=LAN
add interface=qsfpplus1-4 list=LAN
add interface=qsfpplus2-1 list=LAN
add interface=qsfpplus2-2 list=LAN
add interface=qsfpplus2-3 list=LAN
add interface=qsfpplus2-4 list=LAN
add interface=sfp-sfpplus1 list=LAN
add interface=sfp-sfpplus2 list=LAN
add interface=sfp-sfpplus3 list=LAN
add interface=sfp-sfpplus4 list=LAN
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=\
    192.168.88.0
add address=10.10.0.9/24 interface=ether2 network=10.10.0.0
add address=10.20.20.0/24 interface=dhcp network=10.20.20.0
/ip dhcp-server network
add address=10.20.0.0/24 dns-server=1.1.1.1 gateway=10.10.0.9 netmask=24
/ip route
add distance=1 gateway=10.10.0.9
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11381
Joined: Thu Mar 03, 2016 10:23 pm

Re: dhcp server with vlan

Mon May 09, 2022 9:23 pm

So you have two bridges:
  1. bridge named bridge with single port member (ehger10 with PVID=100).
    Associated interface has PVID=1, has IP address set to 192.168.88.1/24 and no DHCP server.
  2. bridge named dhcp without any ports members.
    Associated interface has PVID=100, has IP address 10.20.20.0/24 (wrong, this is network address and is not valid device address) and dhcp server ... however network section does not contain valid setup for this network (router address 10.20.20.0/24 versus dhcp-server network 10.20.0.0/24). And gateway address set in dhcp network is invalid as well, gateway should be inside dhcp clients' network or else tgey won't be able to use it.
These two bridges are separate entities.

In short: there are many wrong things in your current setup, some are due to your inexperience with ROS and some are due to lack of overall networking knowledge.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 18958
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: dhcp server with vlan

Mon May 09, 2022 9:28 pm

Readthis.......... for some guidance.

viewtopic.php?t=143620
 
lurch
just joined
Topic Author
Posts: 23
Joined: Mon Jan 24, 2022 5:45 pm

Re: dhcp server with vlan

Mon May 09, 2022 9:39 pm

Thanks for your reply

re "Router address 10.20.20.0/24 versus dhcp-server network 10.20.0.0/24" that was an error made while eradicating/changing config to paste here. My networking knowledge was sufficient for my cisco certification but alas i'm new to ROS.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 18958
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: dhcp server with vlan

Tue May 10, 2022 12:29 am

Thanks for your reply

re "Router address 10.20.20.0/24 versus dhcp-server network 10.20.0.0/24" that was an error made while eradicating/changing config to paste here. My networking knowledge was sufficient for my cisco certification but alas i'm new to ROS.
A few differences to be sure...... Sounds like you will adapt quickly!!
I came from Zyxel Routers which is halfway between PlugNpray and MT

Who is online

Users browsing this forum: Bing [Bot], outtahere and 67 guests