Why I cannot obtain IP from ether4?

Dear sir,

I am new in setting up Mikrotik, I have a problem that I could not obtain IP from ether4. Could you please correct me.

The following is the script in my router.

/interface bridge
add fast-forward=no name=bridge1

/interface wireless
set [ find default-name=wlan1 ] ssid=MikroTik

/interface vlan
add interface=bridge1 name=vlan1 vlan-id=10

/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik

/ip pool
add name=dhcp_pool0 ranges=192.168.2.2-192.168.2.254

/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=vlan1 name=dhcp1

/interface bridge port
add bridge=bridge1 interface=ether4
add bridge=bridge1 interface=vlan1

/ip address
add address=192.168.2.1/24 interface=vlan1 network=192.168.2.0

/ip dhcp-server network
add address=192.168.2.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=192.168.2.1

/system routerboard settings
set silent-boot=no

The config does not make much sense - you created vlan1 on bridge1, but then you connected vlan1 into bridge1. This literary creates a loop and I don’t dare to guess what will happen. In addition you got dhcp server on vlan1 which is now child of bridge1, therefore it should be moved to bridge1 but due to the loop, i am unsure if its gonna happen.

Can you describe your intention as simple as possible?
Quick guess:
If all you need is DHCP on Ether4, then you don’t need bridge, nor vlan. delete both and assign your address and DHCP to Ether4 directly.
if you require your DHCP to work ONLY over vlan on ether4, then you should create Vlan interface on Ether4 (no bridge needed) and assign your DHCP and address to the vlan interface.

The interface is classed as a slave as it is part of a bridge, you can’t run a DHCP client or server on a salve port, you would need to put it onto the bridge. That and the above.

Your comments are greatly appreciated. Thank you very much. It works!

My intention is to obtain IP address from VLAN that created on Mikrotik router. The ether4 is the port that I connected it to my computer (without setting VLAN ID on Ethernet adapter card on my laptop).

Firstly, I try to create Vlan interface on ether4 (no bridge needed) and assign DHCP and address to the vlan interface. Then, I connect my laptop to ether4. The result was that my laptop could not receive any IP from Mikrotik. (This, I think I have to untag VLAN on my laptop, but my laptop is not support VLAN ID <== I guess)

Secondly, I try to create bridge interface and assign DHCP server to the bridge. Then, I create VLAN on the bridge that I just created. Then, add ether4 to the bridge. Then, I connect my laptop to ether4 and my laptop received IP from Mikrotik router.



# jan/02/1970 00:14:43 by RouterOS 6.43.4
# software id = QSI1-GKWK
#
# model = 951Ui-2HnD
# serial number = 643206B4FAA6
/interface bridge
add fast-forward=no name=testbridge
/interface wireless
set [ find default-name=wlan1 ] ssid=MikroTik
/interface vlan
add interface=testbridge name=vlan1 vlan-id=10
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool1 ranges=192.168.5.2-192.168.5.254
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=testbridge name=dhcp1
/interface bridge port
add bridge=testbridge interface=ether4
/ip address
add address=192.168.5.1/24 interface=testbridge network=192.168.5.0
/ip dhcp-server network
add address=192.168.5.0/24 dns-server=8.8.8.8,8.8.4.4 gateway=192.168.5.1
/system routerboard settings
set silent-boot=no