hello! i’m a new learner of Mikrotik. i’m currently trying to do a dhcp configuration. the scenario is, the R1 acts as dhcp-server and give ip dhcp to R2 ether1 (dhcp-client). i set a static ip for R2 ether2, and i want PC4 get the ip dhcp from the server too (maybe basically dhcp-relay in R2 ether2). is it possible to do that? because i've tried any ways but none of them work. i’m also kinda confused because some said i can do it as long as the interfaces are different, but it still didn’t work. thank you for the help!
Why do you have that configuration? Either you don't need it, or if you do, you probably need vLANs.
In general, although you can put IP addresses on interfaces, it is not usually necessary. The IP address goes on the bridge.
For your problem, I would suggest that we conceptually start with the connections to both R1 and R2 on ether2 and ether3 and assume that your internet connection comes into ether1 on R1, with nothing connected to ether1 on R2. Done like that, R1 is acting as a router for the internet and R2 is acting as a switch. There is no obligation to use R2 as a router unless you can give a reason why it must be a router. This configuration will give all PCs interconnection in Layer 2, such that they can find each other with ARP by MAC address and a single DHCP server will give all PCs an IP address on a single LAN IP subnet. This is what is known as a Single Broadcast Domain.
Now, if this does not work for you and you have some requirements that R2 must operate as a router, tell us why and we can work out what you need to do.
If your really want to run central DHCP server and have R2 to relay DHCP handshkes to it, then you need ... well, DHCP relay on R2.
Beware of how things are handled for R2: R2 needs two IP addresses, one for ether1 and one for ether2.
Ether1 IP address has to be in the same subnet as ether2 on R1 ... and has to be very well known to R1 ... because R1 will use it as gateway towards subnet 192.168.30.1.
Ether2 IP address on R2 also has to be very well known (to the DHCP server itself) because it'll be handled out to DHCP clients off R2's ether2 as their default gateway.
Probably the both IP addresses could be handled out by DHCP server running on R1 (or somewhere in 192.168.20.1 subnet), but that part of DHCP server config would have to be manual.
Then you'd have to set up DHCP relay on R2. And DHCP server (on R1 or wherever it is), which has to know about DHCP relay on R2 ... because it has to hand out appropriate DHCP leases if DHCP requests come in via DHCP relay via R2 (as opposed to direct DHCP requests coming in from clients directly attached to appropriate DHCP server's interface).
So while this can certainly be done, it comes with lots of considerations (and work).
In SOHO environments, if R2 really has to be router and having different IP subnets, R2 is more commonly configured with its own DHCP server (on ether2). And then it's either set up as NAT (via ether1 towards the rest of network). Or both R1 and R2 have some (small amount of) static setup when it comes to routing between different IP subnets (e.g. between 192.168.10.1/24 and 192.168.30.1/24).
hello! thank you so much for your reply and suggestion. about the suggestion, i’ve tried it and yes it works when R2 acts as the switch instead. i have that configuration because that idea suddenly came to my mind and i was just curious, so it’s just for exercise purposes
hello! thank you so much for your reply and suggestion. i’ve configured the IP address for both routers so they recognize each other. however, the dhcp-relay from R2 to PC still can’t be performed. i also think that it needs more considerations and work, so it may work, but with more complex configuration. i’ll explore again later
