Community discussions

MikroTik App
 
AndrewChedid
just joined
Topic Author
Posts: 18
Joined: Mon Sep 11, 2023 11:51 am

DHCP in VLAN is not working (Flagged as Invalid)

Thu Sep 14, 2023 11:58 am

Hello All!

I have a RB951Ui-2HnD router, on it I have setup vlans 10, 20, 30 and 99. Each vlan has its own DHCP server and running on specific ports. vlan99 on ether1, vlan10 on ether2 and ether3, vlan20 on ether4 and vlan30 on ether5. Everything seems working fine but a few issues:

dhcp_vlan10 and dhcp_vlan30 are not working
dhcp_vlan20 is giving default gateways as 0.0.0.0
dhcp_vlan99 is working perfectly fine

If someone can help I would greatly appreciate it <3
You do not have the required permissions to view the files attached to this post.
 
gigabyte091
Forum Guru
Forum Guru
Posts: 1550
Joined: Fri Dec 31, 2021 11:44 am
Location: Croatia

Re: DHCP in VLAN is not working (Flagged as Invalid)

Thu Sep 14, 2023 12:13 pm

Are you trying to configure it like a switch/AP ?

/ip address
add address=192.168.99.1/24 interface=management_vlan network=192.168.99.0
add address=192.168.10.1/24 interface=bridge1 network=192.168.10.0
add address=192.168.10.254/24 interface=ether2 network=192.168.10.0
add address=192.168.10.253/24 interface=ether3 network=192.168.10.0
add address=192.168.20.254/24 interface=ether4 network=192.168.20.0
add address=192.168.30.254/24 interface=ether5 network=192.168.30.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

Red should be changed to:

/ip address
add address=192.168.99.1/24 interface=management_vlan network=192.168.99.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

Here I think you are missing what ports are untagged:

/interface bridge vlan
add bridge=bridge1 tagged=bridge1 vlan-ids=10
add bridge=bridge1 tagged=bridge1 vlan-ids=20
add bridge=bridge1 tagged=bridge1 vlan-ids=99
add bridge=bridge1 tagged=bridge1 vlan-ids=30

Should be:

/interface bridge vlan
add bridge=bridge1 tagged=bridge1 untagged=ether2,ether3 vlan-ids=10
add bridge=bridge1 tagged=bridge1 untagged=ether4 vlan-ids=20
add bridge=bridge1 tagged=bridge1 vlan-ids=99
add bridge=bridge1 tagged=bridge1 untagged=ether1 vlan-ids=30

Sorry if any mistake is made here..
 
AndrewChedid
just joined
Topic Author
Posts: 18
Joined: Mon Sep 11, 2023 11:51 am

Re: DHCP in VLAN is not working (Flagged as Invalid)

Thu Sep 14, 2023 12:42 pm

Thank you for you response.
 
AndrewChedid
just joined
Topic Author
Posts: 18
Joined: Mon Sep 11, 2023 11:51 am

Re: DHCP in VLAN is not working (Flagged as Invalid)

Thu Sep 14, 2023 12:49 pm

i made all the changes and the results are:
dhcp_vlan99 works 100%
dhcp_vlan20 works 100%
dhcp_vlan10 gives out 0.0.0.0 as gateway
dhcp_vlan30 is not even found when I run ipconfig /renew

I am sorry for being such a pain in the a$$ with these questions and I am trying to configure it as a switch/router. wlan interfaces are shutdown I'm not using them (if that's your question)
 
gigabyte091
Forum Guru
Forum Guru
Posts: 1550
Joined: Fri Dec 31, 2021 11:44 am
Location: Croatia

Re: DHCP in VLAN is not working (Flagged as Invalid)

Thu Sep 14, 2023 1:00 pm

Be careful, switch is not the same thing as router, so this configuration is not valid. What is your upstream router ?
 
AndrewChedid
just joined
Topic Author
Posts: 18
Joined: Mon Sep 11, 2023 11:51 am

Re: DHCP in VLAN is not working (Flagged as Invalid)

Thu Sep 14, 2023 1:10 pm

Yeah my bad. Right now I am using it as a switch even though it is a router also. My entire network is basically just my laptop, the switch and a desktop computer that I try to ping. I am not routing to and from any other interface. I hope that answers your question
 
gigabyte091
Forum Guru
Forum Guru
Posts: 1550
Joined: Fri Dec 31, 2021 11:44 am
Location: Croatia

Re: DHCP in VLAN is not working (Flagged as Invalid)

Thu Sep 14, 2023 2:37 pm

So what are you trying to achieve with this setup ? From where are you gettng internet connection ?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22387
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: DHCP in VLAN is not working (Flagged as Invalid)

Thu Sep 14, 2023 3:56 pm

The problem here is no clue as to what you are trying to achieve.
Draw a network diagram that always helps. Should have a plan.

Detail where your ISP is in the mix, modem or router modem, where is your public IP,
what is the intended function of the mikrotik device etc......
 
AndrewChedid
just joined
Topic Author
Posts: 18
Joined: Mon Sep 11, 2023 11:51 am

Re: DHCP in VLAN is not working (Flagged as Invalid)

Fri Sep 15, 2023 7:50 am

I'm sorry I should have clarified. This is a practice lab, not a real setup. This is just a way to learn how to setup multiple vlans and inter-vlan routing, with each vlan being on its own subnet and having its own dhcp server. The diagram is pretty simple. 2 PCs connected to the router, each on a different VLAN.
 
gigabyte091
Forum Guru
Forum Guru
Posts: 1550
Joined: Fri Dec 31, 2021 11:44 am
Location: Croatia

Re: DHCP in VLAN is not working (Flagged as Invalid)  [SOLVED]

Fri Sep 15, 2023 7:53 am

Then reboot router to default configuration and start over, just add your configuration to default one. My advice.

Also, this is a must read if you are new: viewtopic.php?t=182373
 
AndrewChedid
just joined
Topic Author
Posts: 18
Joined: Mon Sep 11, 2023 11:51 am

Re: DHCP in VLAN is not working (Flagged as Invalid)

Fri Sep 15, 2023 8:06 am

Yeah this is the best thing to do.

Thank you anyway for bearing with me.
 
gigabyte091
Forum Guru
Forum Guru
Posts: 1550
Joined: Fri Dec 31, 2021 11:44 am
Location: Croatia

Re: DHCP in VLAN is not working (Flagged as Invalid)

Fri Sep 15, 2023 8:38 am

No problem, also you should check out youtuber TheNetworkBerg, he made a series of videos reagrding VLANs, routing, etc.