Community discussions

MikroTik App
mattsawatzky
newbie
Topic Author
Posts: 41
加入: Wed Oct 27, 2010 12:43 am

DHCP Server Multiple Interfaces

Wed Jun 08, 2011 7:09 am

I'm wondering if I can make my RB450G give out a different IP range depending on which interface the network is on. What I'm wanting to do is have my internal personal network on the one interface like it currently is, but also adding another network on a secondary interface that's in a different IP Range, but can still access the internet through the bridge without being able to access the other interface. Is there a way to give out say 192.168.1.x to eth1 and 192.168.2.x to eth2 using just the RB450G?
Top
fewi
Forum Guru
Forum Guru
Posts: 7717
加入: Tue Aug 11, 2009 3:19 am

Re: DHCP Server Multiple Interfaces

Wed Jun 08, 2011 7:12 am

If you want another network then you simply should not bridge the two interfaces, and configure them as you describe. At that point things will "just work".

Only bridge when you absolutely have to.
Top
mattsawatzky
newbie
Topic Author
Posts: 41
加入: Wed Oct 27, 2010 12:43 am

Re: DHCP Server Multiple Interfaces

Wed Jun 08, 2011 7:20 am

Ok, then can I bridge the eth2 interface with the WAN1 one and get internet that way while maintaining no access to eth1?

EDIT: What I have now is a LAN1, WAN, and bridge interfaces. I'm wanting to use another interface for the other network. How do I get this interface to have internet access?
Top
blake
Member
Member
Posts: 426
加入: Mon May 31, 2010 10:46 pm
Location:Arizona

Re: DHCP Server Multiple Interfaces

Wed Jun 08, 2011 7:30 am

I'm not sure why you need to use the bridge interfaces. The configuration below should work.
Code:Select all
/ip address add interface=ether1 address=192.168.1.1/24 add interface=ether2 address=192.168.2.1/24 /ip pool add name=pool1 ranges=192.168.1.10-192.168.1.254 add name=pool2 ranges=192.168.2.10-192.168.2.254 /ip dhcp-server add disabled=no authoritative=yes bootp-support=none name=dhcp1 interface=ether1 address-pool=pool1 add disabled=no authoritative=yes bootp-support=none name=dhcp2 interface=ether2 address-pool=pool2 /ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 add address=192.168.2.0/24 gateway=192.168.2.1 /ip dhcp-client add disabled=no interface=WAN use-peer-dns=yes add-default-route=yes /ip firewall connection tracking set enabled=yes /ip firewall filter add chain=forward action=accept connection-state=established add chain=forward action=accept connection-state=related add chain=forward action=drop connection-state=invalid add chain=forward action=drop out-interface=!WAN src-address=192.168.1.0/24 comment="Prevent inter-subnet communication" add chain=forward action=drop out-interface=!WAN src-address=192.168.2.0/24 comment="Prevent inter-subnet communication" /ip firewall nat add chain=srcnat action=masquerade out-interface=WAN
Top
mattsawatzky
newbie
Topic Author
Posts: 41
加入: Wed Oct 27, 2010 12:43 am

Re: DHCP Server Multiple Interfaces

Wed Jun 08, 2011 7:35 am

Forgive my ignorance, but what exactly does the bridge do? Do I technically need the bridge at all?
Top
blake
Member
Member
Posts: 426
加入: Mon May 31, 2010 10:46 pm
Location:Arizona

Re: DHCP Server Multiple Interfaces

Wed Jun 08, 2011 7:45 am

It allows you to take layer 3 interfaces in RouterOS and bridge them at layer 2 so that they emulate a layer 2 environment. If you're still confused, read this:TCP/IP Guide: Understanding The OSI Reference Model.

Hope this helps.
Top

Who is online

Users browsing this forum:Ahrefs [Bot],nescafe2002,Semrush [Bot]and 11 guests