Page 1 of 1

dhcp-client on vif

Posted: Thu Feb 10, 2011 12:43 am
by arpadffy
Hello,

I simply can not figure out how can I acquire more than one DHCP address on a WAN interface.
On ether1, it works perfect... but I need two more public IP addresses (that is possible if I attach the switch directly to the modem).

My main approach was to create a bridge. Add ether1 and virtual interfaces and set dhcp-client on them.

The problem is that the vif interfaces are in status "stopped" and could not find any indication in the wiki how to bring them up.

..also when the ether1 is bridged the DHCP renewal does not work - seems my bridge filter forwards, however I have followed the documentation and forwarding is enabled. ARP (I tried enabled and proxy-arp as well).

Please, tell me what I am doing wrong.

Thank you in advance.

Regards,
Z

PS: I see that on the screenshot ether1 is not among bridged ports, because I have been forced to remove otherwise the DHCP renewal failed :(

Re: dhcp-client on vif

Posted: Thu Feb 10, 2011 7:43 am
by blake
I found a way to do this but it limits you to only two DHCP clients / obtainable IPs (one for the bridge, one for the physical interface), and the requests cannot come from the same MAC address.

Generate a fake MAC by creating an EoIP interface, copy the MAC address, then delete the interface.
/interface eoip
add remote-peer=127.0.0.1
:put [get 0 mac-address]
remove 0
Create a bridge and manually specify the MAC using the one you copied from the EoIP interface. Add the WAN port to the bridge.
/interface bridge
add name=bridge1 auto-mac=no admin-mac=FE:B9:D5:2F:7C:E1
/interface bridge port
add bridge=bridge1 interface=WAN
Create your DHCP clients.
/ip dhcp-client
add interface=ether1 disabled=no add-deafult-route=yes use-peer-dns=yes
add interface=bridge1 disabled=no add-default-route=no use-peer-dns=no
This config assumes both leases are from the same subnet. If they are not you can set add-default-route=yes on the second DHCP client instance.

Re: dhcp-client on vif

Posted: Thu Feb 10, 2011 11:58 pm
by arpadffy
Hello,

thank you for the answer, unfortunately it does not work :(
The bridge interface can not get an IP address and what is worse the ether1 can not renew the IP as long it is listed among bridge ports.

Could it be something else?

Honestly, I still does not understand why my approach with bridged virtual interfaces does not work... also why the ether1 is not able to renew the lease as soon it is bridged.

Could somebody show me some documentation where I can learn to use about the virtual interface usage and bridges in ROS?

Thank you in advance.

Regards,
Z

Re: dhcp-client on vif

Posted: Fri Feb 11, 2011 12:06 am
by blake
Do you have any bridge filter or IP firewall rules active on your WAN port? If so, could you please share those?

The virtual-ethernet pseudo interfaces are designed to operate exclusively with Metarouter instances. They cannot function as standalone interfaces.

Here's the documentation you requested.

http://wiki.mikrotik.com/wiki/Manual:Interface/Bridge
http://wiki.mikrotik.com/wiki/Manual:In ... l-ethernet

Re: dhcp-client on vif

Posted: Sun Feb 13, 2011 11:46 pm
by arpadffy
Thank you.

I have played with the virtual interfaces and meta routers... I have a feeling that it would work, because I was able to create up to 7 mr-s with 8M memory and each had assigned a vif.

In order to work all vif'-s and the ether1 need to be bridged... but as soon I add ether1 to the bridge it loose the connection :(

I thing I give up.
It sounds like an easy task, but seems there is no solution on a ROS

Regards,
Z

Re: dhcp-client on vif

Posted: Fri Feb 18, 2011 12:22 am
by arpadffy
Hello,

I tried many other combinations during past days and nothing works.

Can anybody from the MikroTik support post here or write a wiki page that describes how to get say 5 public dhcp address from the ISP.

I can not believe that it is not possible to do with an RB450G when an ordinary switch does it if I connect five computers directly.

Thank you in advance.

Regards,
Z

Re: dhcp-client on vif

Posted: Fri Feb 18, 2011 12:34 am
by changeip
the switch isnt running dhcp, the clients are. you have to ask your ISP for a dhcp-lease using 5 different mac addresses, which is where you run into the problem. You can setup all 5 ports with a dhcp client, and then connect them all to a switch and get them that way. the next problem you will have is sending all the traffic back out the same IP that it came in on...