Community discussions

MUM Europe 2020
 
CSteve
newbie
Topic Author
Posts: 30
Joined: Wed Feb 10, 2016 4:52 pm

Dhcp on VLans

Mon Feb 15, 2016 12:37 pm

Hey guys, i m really new to RouterOS and i m trying to configure the following vlan network topology on a CCR-1016 (V6.33.5)

eth 2-Vlan0 (192.168.0.0/24 network, Gw 192.168.0.1/24), the router will act as an dhcp server on this network, i need untagged traffic to connect a"dumb switch"
eth3- Vlan 3, and Vlan 4 both on the same trunk, on the same port (network 192.168.3.0/24, and netw. 192.158.4.0/24), the router will act as a Dhcp on both of the networks as well. I need tagged traffic on a single uplink to a managed switch.

Heres what i have done untill now:

/interface vlan add name=vlan0 interface=ether2 vlan-id=1
/interface vlan add name=vlan3 interface=ether3 vlan-id=3
/interface vlan add name=vlan4 interface=ether3 vlan-id=4

/ip address
add address=192.168.0.1/24 interface=vlan0
add address=192.168.3.1/24 interface=vlan3
add address=192.168.4.1/24 interface=vlan4

/interface bridge add name=br-vlan0
bridge port add bridge=br-vlan0 interface=vlan0
bridge port add bridge=br-vlan0 interface=ether2

Now the DHCP part:

ip pool add name=PoolVlan0 ranges=192.168.0.50-192.168.0.100
ip pool add name=PoolVlan3 ranges=192.168.3.50-192.168.3.100
ip pool add name=PoolVlan4 ranges=192.168.4.50-192.168.4.100

#For Vlan0
ip dhcp-server add interface=br-vlan0 address-pool=PoolVlan0 (only way it works on the acces port if i put on bridge interface.I don t know if its the correct way for sure)
ip dhcp-server network add address=192.168.0.0/24 gateway=192.168.0.1/24 dns-server=8.8.8.8
#For Vlan3
ip dhcp-server add interface=ether3 address-pool=PoolVlan3
ip dhcp-server network add address=192.168.3.0/24 gateway=192.168.3.1/24 dns-server=8.8.8.8
#For Vlan4
ip dhcp-server add interface=ether3 address-pool=PoolVlan4
ip dhcp-server network add address=192.168.4.0/24 gateway=192.168.4.1/24 dns-server=8.8.8.8

-For vlan0 it looks like dhcp works, i can ping gateway ip and i have leased ip. But i m unsure about the bridge interface(its really new to me the bridging concept). I can see traffic on vlan0 and on br-vlan0 . I dont know which one is the real one.
-On Vlan 3 and Vlan 4 i can t get an ip, and i cant sort it out why

!!-My final goal is to route and apply firewall rules to VLAN traffics. How can i apply firewall rules to Vlan0 (which is on a bridge interface)?

Any input, or guidance would be much appreciated.
S.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4051
Joined: Wed May 11, 2011 6:08 pm

Re: Dhcp on VLans  [SOLVED]

Mon Feb 15, 2016 4:23 pm

Don't use the vlan0 interface, just use ether2 anywhere you would have said "vlan0"
And don't use br-vlan0 - again just use ether2 itself.
When given a spoon,
you should not cling to your fork.
The soup will get cold.
 
CSteve
newbie
Topic Author
Posts: 30
Joined: Wed Feb 10, 2016 4:52 pm

Re: Dhcp on VLans

Mon Feb 15, 2016 8:11 pm

Don't use the vlan0 interface, just use ether2 anywhere you would have said "vlan0"
And don't use br-vlan0 - again just use ether2 itself.
So i practically won t use the bridge what i created ?

Do you have any ideas about the trunk port why is not working?

Thank you for your time.
 
kiaunel
Member Candidate
Member Candidate
Posts: 211
Joined: Mon Jul 21, 2014 7:59 pm
Location: Romania

Re: Dhcp on VLans

Mon Feb 15, 2016 10:14 pm

ZeroByte is right you don`t need bridge or vlan0 on ether2. Just use ether2. Now for the trunk port in the other end is trunk configured?
 
CSteve
newbie
Topic Author
Posts: 30
Joined: Wed Feb 10, 2016 4:52 pm

Re: Dhcp on VLans

Mon Feb 22, 2016 12:35 pm

ZeroByte is right you don`t need bridge or vlan0 on ether2. Just use ether2. Now for the trunk port in the other end is trunk configured?
My switch was configured ok, but i ve put the dhcp server on the wrong interface (should have been on vlan3 instead of ether 3). Thx
 
CSteve
newbie
Topic Author
Posts: 30
Joined: Wed Feb 10, 2016 4:52 pm

Re: Dhcp on VLans

Mon Feb 22, 2016 12:36 pm

Don't use the vlan0 interface, just use ether2 anywhere you would have said "vlan0"
And don't use br-vlan0 - again just use ether2 itself.
I ve deleted the bridge interface and used ether2, now its working correctly. Thank you for your response.

Who is online

Users browsing this forum: No registered users and 39 guests