Community discussions

MikroTik App
 
arisk
newbie
Topic Author
Posts: 27
Joined: Wed Aug 01, 2018 12:56 pm

Set vlan interface as DHCP server

Wed Aug 01, 2018 1:04 pm

Hello everyone,
I'm totally new to Mikrotik. I'm practicing with a RB 3011 Routerboard which i've connected to my home router.
I've already made a bridge(ports ether1-5) with DHCP relay to my home router which works fine.
What i want to do now, is set vlan81 interface as a DHCP server at ether6 and use my laptop from that port to access the Internet.
My configuration though does not seems to work for making the vlan a DHCP server.
Here it is:
/interface bridge
add fast-forward=no name=bridge1
/interface ethernet
set [ find default-name=ether1 ] name=ether1_1stBridge
set [ find default-name=ether2 ] name=ether2_1stBridge
set [ find default-name=ether3 ] name=ether3_1stBridge
set [ find default-name=ether4 ] name=ether4_1stBridge
set [ find default-name=ether5 ] name=ether5_1stBridge
set [ find default-name=ether8 ] name=ether8_2ndBridge
set [ find default-name=ether9 ] name=ether9_2ndBridge
set [ find default-name=ether10 ] name=ether10_2ndBridge
/interface vlan
add interface=ether6 name=vlan81 vlan-id=81
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=pool81 ranges=172.17.81.10-172.17.81.254
/ip dhcp-server
add add-arp=yes address-pool=pool81 disabled=no interface=vlan81 name=server81
/interface bridge port
add bridge=bridge1 interface=ether1_1stBridge
add bridge=bridge1 interface=ether2_1stBridge
add bridge=bridge1 interface=ether3_1stBridge
add bridge=bridge1 interface=ether4_1stBridge
add bridge=bridge1 interface=ether5_1stBridge
/ip address
add address=172.17.7.252/24 interface=bridge1 network=172.17.7.0
add address=172.17.81.1/24 interface=ether6 network=172.17.81.0
/ip dhcp-relay
add dhcp-server=172.17.7.254 disabled=no interface=bridge1 name=relay1
/ip dhcp-server network
add address=172.17.81.0/24 dns-server=172.17.81.1 gateway=172.17.81.1
/ip dns
set allow-remote-requests=yes servers=172.17.7.254
/ip firewall nat
add action=masquerade chain=srcnat out-interface=bridge1
/ip route
add distance=1 gateway=bridge1 pref-src=172.17.7.252

Any help would be reeeeeeeeeeally appreciated.
 
Kurosudo
just joined
Posts: 21
Joined: Wed Aug 01, 2018 1:21 pm

Re: Set vlan interface as DHCP server

Wed Aug 01, 2018 1:28 pm

You set IP for ether6 not for vlan. This is your problem. Set 172.17.81.1/24 to vlan81 interface and then create DHCP server via DHCP SETUP it will be easier than making pools etc.
 
arisk
newbie
Topic Author
Posts: 27
Joined: Wed Aug 01, 2018 12:56 pm

Re: Set vlan interface as DHCP server

Wed Aug 01, 2018 2:12 pm

Hello Kurosudo and thanks for your immidiate response. I put 172.17.81.1 in vlan81, deleted my dhcp server configuration and made a new one through DHCP setup button. However nothing changed... my pc doesn't take an IP.
I made a DHCP server work that way for a physical port yesterday, but i cannot make it for the vlan.. so i wonder if there is something else i'm missing about configuration of vlans......
Perhaps should i configure it through the "Switch" tab? I also gave that a try with no luck..
 
User avatar
skylark
Member Candidate
Member Candidate
Posts: 144
Joined: Wed Feb 10, 2016 3:55 pm

Re: Set vlan interface as DHCP server  [SOLVED]

Wed Aug 01, 2018 2:36 pm

Does your PC also have configured VLANs? Because now , if you configure DHCP server on the VLAN interface, then DHCP server is sending out tagged packages with tag 81.
 
arisk
newbie
Topic Author
Posts: 27
Joined: Wed Aug 01, 2018 12:56 pm

Re: Set vlan interface as DHCP server

Wed Aug 01, 2018 2:41 pm

Ops.. didn't even know.. may be a silly question but how do i configure vlans on my pc?
 
Kurosudo
just joined
Posts: 21
Joined: Wed Aug 01, 2018 1:21 pm

Re: Set vlan interface as DHCP server

Wed Aug 01, 2018 3:45 pm

Ops.. didn't even know.. may be a silly question but how do i configure vlans on my pc?
Depends on you NIC. Many "integrated" NIC doesn't support VLAN tag. It will be better to use switch with vlan support.
 
arisk
newbie
Topic Author
Posts: 27
Joined: Wed Aug 01, 2018 12:56 pm

Re: Set vlan interface as DHCP server

Wed Aug 01, 2018 5:19 pm

Thank you both guys!
I'll try the switch. I'll also check my NIC about VLans.
Probably i'll be back with questions.
 
User avatar
r0berts
newbie
Posts: 49
Joined: Mon Jul 30, 2018 3:29 pm

Re: Set vlan interface as DHCP server

Wed Aug 01, 2018 11:21 pm

Out of interest - what would be use for VLANs on a home network? Except of course specifically learning about the technology, but otherwise at home network I have yet to find use for VLANs therefore I am happy to have avoided the complication so far.
 
DummyPLUG
Frequent Visitor
Frequent Visitor
Posts: 79
Joined: Wed Jan 03, 2018 10:17 am

Re: Set vlan interface as DHCP server

Wed Aug 01, 2018 11:52 pm

Out of interest - what would be use for VLANs on a home network? Except of course specifically learning about the technology, but otherwise at home network I have yet to find use for VLANs therefore I am happy to have avoided the complication so far.
such as sperate untrusted device from trusted, as you know many device such as IPcam, setup box are so easy to inject malware
 
User avatar
r0berts
newbie
Posts: 49
Joined: Mon Jul 30, 2018 3:29 pm

Re: Set vlan interface as DHCP server

Thu Aug 02, 2018 12:45 am

A good point
 
arisk
newbie
Topic Author
Posts: 27
Joined: Wed Aug 01, 2018 12:56 pm

Re: Set vlan interface as DHCP server

Thu Aug 02, 2018 2:53 am

Good point indeed. In my case it's just practice.. i borrowed the device from work :)
 
Kurosudo
just joined
Posts: 21
Joined: Wed Aug 01, 2018 1:21 pm

Re: Set vlan interface as DHCP server

Thu Aug 02, 2018 9:23 am

Out of interest - what would be use for VLANs on a home network? Except of course specifically learning about the technology, but otherwise at home network I have yet to find use for VLANs therefore I am happy to have avoided the complication so far.
Vlan in home network is really good. For example i live with numerous roomates and i don't want to give them full access to my network. For this i just made VLAN trusted/untrusted/Multicast vlan for watching TV and Management vlan. It's pretty neat have configuration with vlans.
 
arisk
newbie
Topic Author
Posts: 27
Joined: Wed Aug 01, 2018 12:56 pm

Re: Set vlan interface as DHCP server

Mon Aug 06, 2018 2:13 pm

Thank you very much for your answers.
Switch did the job.
As for my NIC, it would support VLAN tagging as long as i download Intel's drivers for that purpose.

Who is online

Users browsing this forum: No registered users and 70 guests