Community discussions

 
rene72
just joined
Topic Author
Posts: 12
Joined: Fri Jun 14, 2019 11:35 am

one dhcp server, static leases two diffent gateway addresses

Fri Jun 14, 2019 11:42 am

Hi,

I have got me an RB2011 (I am new to this hardware) and got it configured with dhcp rangen 192.168.1.100 - 192.168.1.200 gateway 192.168.1.1
I also got a few devices configures static: 192.168.1.50,192.168.1.51,192.168.1.53,192.168.1.54,192.168.1.60

Now I want to change the default gateway for ip-adress 192.168.1.53 from 192.168.1.1 to 192.168.2.5 when it assigns the static ipaddress to that device.
Is there an option to do this with the firewall rules and/or mangle rules ?
Or is there another way to accomplish this.
 
Sob
Forum Guru
Forum Guru
Posts: 4215
Joined: Mon Apr 20, 2009 9:11 pm

Re: one dhcp server, static leases two diffent gateway addresses

Fri Jun 14, 2019 2:12 pm

Where does 192.168.2.5 suddenly comes from? You didn't write what netmask you have, but in case it's the most common /24, 192.168.2.x can't be default gateway for 192.168.1.x. Or do you mean two upstream routers and routing traffic from some addresses to one and from other addresses to another?
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply.
 
rene72
just joined
Topic Author
Posts: 12
Joined: Fri Jun 14, 2019 11:35 am

Re: one dhcp server, static leases two diffent gateway addresses

Fri Jun 14, 2019 2:29 pm

Where does 192.168.2.5 suddenly comes from? You didn't write what netmask you have, but in case it's the most common /24, 192.168.2.x can't be default gateway for 192.168.1.x. Or do you mean two upstream routers and routing traffic from some addresses to one and from other addresses to another?
Hi oops my mistake. The correct text should be:
Hi,

I have got me an RB2011 (I am new to this hardware) and got it configured with dhcp rangen 192.168.1.100 - 192.168.1.200 gateway 192.168.1.1
I also got a few devices configures static: 192.168.1.50,192.168.1.51,192.168.1.53,192.168.1.54,192.168.1.60

Now I want to change the default gateway for ip-adress 192.168.1.53 from 192.168.1.1 to 192.168.1.2 when it assigns the static ipaddress to that device.
Is there an option to do this with the firewall rules and/or mangle rules ?
Or is there another way to accomplish this.
Subnet mask is 255.255.255.0
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1595
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: one dhcp server, static leases two diffent gateway addresses

Fri Jun 14, 2019 2:59 pm

You can achieve this by defining multiple networks, ex:
/ip dhcp-server network
add address=192.168.1.0/26 dns-server=192.168.1.1 domain=home gateway=192.168.1.1 netmask=24 ntp-server=192.168.1.1
add address=192.168.1.64/26 dns-server=172.16.1.2 domain=dyn.home gateway=192.168.1.2 netmask=24 ntp-server=192.168.1.2
 
rene72
just joined
Topic Author
Posts: 12
Joined: Fri Jun 14, 2019 11:35 am

Re: one dhcp server, static leases two diffent gateway addresses

Fri Jun 14, 2019 9:12 pm

You can achieve this by defining multiple networks, ex:
/ip dhcp-server network
add address=192.168.1.0/26 dns-server=192.168.1.1 domain=home gateway=192.168.1.1 netmask=24 ntp-server=192.168.1.1
add address=192.168.1.64/26 dns-server=172.16.1.2 domain=dyn.home gateway=192.168.1.2 netmask=24 ntp-server=192.168.1.2
Hi,

Yes did was it I was looking for thanx, I changed /26 to /25 to create two scopes.
Tested it and works thank you for the fast reply

Who is online

Users browsing this forum: No registered users and 30 guests