btw, DHCP is ports 67-68...I have deny udp 66-67 on both input and forward chain
btw, DHCP is ports 67-68...I have deny udp 66-67 on both input and forward chain
[admin@Mikrotik] > /ip firewall filter print det
Flags: X - disabled, I - invalid, D - dynamic
0 chain=input action=drop protocol=udp dst-port=67,68
1 chain=forward action=drop protocol=udp dst-port=67,68
2 chain=output action=drop protocol=udp dst-port=67,68
[admin@Mikrotik] > /ip firewall filter pri stats
Flags: X - disabled, I - invalid, D - dynamic
# CHAIN ACTION BYTES PACKETS
0 input drop 0 0
1 forward drop 0 0
2 output drop 0 0
[admin@Mikrotik] > /tool sniffer set interface=vlan935
[admin@Mikrotik] > /tool sniffer start
[admin@Mikrotik] > /tool sniffer stop
[admin@Mikrotik] > /ip firewall filter print stat
Flags: X - disabled, I - invalid, D - dynamic
# CHAIN ACTION BYTES PACKETS
0 input drop 656 2
1 forward drop 0 0
2 output drop 0 0
[admin@Mikrotik] > /tool sniffer packet print det
0 time=1.662 direction=in src-mac=00:1E:52:87:F4:4A dst-mac=FF:FF:FF:FF:FF:FF
interface=vlan935 src-address=0.0.0.0:68 (bootpc)
dst-address=255.255.255.255:67 (bootps) protocol=ip ip-protocol=udp size=342
ip-packet-size=328 ip-header-size=20 dscp=0 identification=4229
fragment-offset=0 ttl=255
1 time=1.663 direction=out src-mac=00:0C:42:43:62:C9 dst-mac=00:1E:52:87:F4:4A
interface=vlan935 src-address=10.35.0.1:67 (bootps)
dst-address=10.35.0.254:68 (bootpc) protocol=ip ip-protocol=udp size=342
ip-packet-size=328 ip-header-size=20 dscp=0 identification=0 fragment-offset=0
ttl=16
[admin@Mikrotik] > /ip dhcp-server lease print
Flags: X - disabled, R - radius, D - dynamic, B - blocked
# ADDRESS MAC-ADDRESS HOST-NAME SERVER RATE-LIMIT STATUS
0 D 10.35.0.254 00:1E:52:87:F4:4A test-lap... DHCP-... bound
Thank you for that information. I'm glad to at least know now why this issue exists, and that it isn't a Mikrotik bug. It should still be documented, however.This is a linux thing not a mikrotik thing. I have been building fiewalls with linux for a long time and no matter what firewall rules I put in place dhcp still gets through whether it's a client or server on that local firewall.
That's great to know that the bridge firewall can intercept those packets! You are right, I was using the IP Firewall option, not the Bridge Firewall.
As for the raw versus ip option, I put in a feature request and support said "not currently, but probably in the future".
Is this for your CCR to be a dhcp client, or a dhcp relay?Hello there,
Any news on that ? My ISP need to receive DHCP Request with a priority of 6. In the current state, I can't "manipulate" the dhcp packet with the firewall "stack", so, no connexion... my crr 1009 is a 400 euros paper weight right now :/
My ccr is a dhcp client in that situation.Is this for your CCR to be a dhcp client, or a dhcp relay?Hello there,
Any news on that ? My ISP need to receive DHCP Request with a priority of 6. In the current state, I can't "manipulate" the dhcp packet with the firewall "stack", so, no connexion... my crr 1009 is a 400 euros paper weight right now :/
If client, you should be able to set priority on such traffic using the mangle table's output chain.
/ip firewall mangle
add chain=output out-interface=WAN protocol=udp dst-port=67 action=set-priority new-priority=6
(replace WAN with whichever interface has the dhcp client configured, e.g. ether1-gateway)
Actually, you're comparing apples and oranges. This thread is about blocking inbound DHCP request frames from reaching a dhcp server process listening on an interface. The firewall (i.e. netfilters package) can't interfere with / modify these frames due to the fact that the dhcp daemon apparently binds the raw ethernet interface and not a UDP socket - so it has the same access to an interface that sniffer would - namely it sees the frames before they are passed to the firewall....My ccr is a dhcp client in that situation.
And your solution doesn't work from what I understand, because the dhcp request is a raw socket thing, and doesn't enter in the firewall stack.
Actually, you're comparing apples and oranges. This thread is about blocking inbound DHCP request frames from reaching a dhcp server process listening on an interface. The firewall (i.e. netfilters package) can't interfere with / modify these frames due to the fact that the dhcp daemon apparently binds the raw ethernet interface and not a UDP socket - so it has the same access to an interface that sniffer would - namely it sees the frames before they are passed to the firewall....My ccr is a dhcp client in that situation.
And your solution doesn't work from what I understand, because the dhcp request is a raw socket thing, and doesn't enter in the firewall stack.
However, your situation is that you want to modify packets as they are being sent from the dhcp client process, which is different, so it's entirely likely that you can just modify the priority. (which if memory serves is a field in a VLAN header, not a packet header) - now it's still possible that the dhcp client process is also operating at a raw frames level and would thus bypass the mangle table as well, but you could watch the rule for hits, and verify with sniffer+wireshark that the priority is being set properly. If the mangle table doesn't see any hits, then you could also use the bridge filter solution above to modify the outgoing DHCP requests. (output bridge filter chain) Honestly, I'm not sure why the ISP requires that a priority be set - is this using some kind of WiMax connection? (that's the only thing I've ever messed with that maps traffic based on priority as a pure requirement)
Thx, I just tried, but the bridge filter rule does nothing, the counters stay at 0. For the sake of it I tried to change to out-interface to vlan832-orange, same thing.make a bridge called WAN
/interface bridge add name=WAN
connect the ether8 interface to it:
/interface bridge port add interface=ether8 bridge=WAN
move the vlan interface off of ether8 and onto the WAN bridge
/interface vlan set [find where name=vlan832-orange] interface=WAN
Then make a bridge filter rule:
/interface bridge filter add action=set-priority chain=output dst-port=67 out-bridge=WAN ip-protocol=udp mac-protocol=ip \
new-priority=6 out-interface=ether8
Try in-bridge instead of out-bridge or just leaving no bridge specified?Thx, I just tried, but the bridge filter rule does nothing, the counters stay at 0. For the sake of it I tried to change to out-interface to vlan832-orange, same thing.
Try in-bridge instead of out-bridge or just leaving no bridge specified?Thx, I just tried, but the bridge filter rule does nothing, the counters stay at 0. For the sake of it I tried to change to out-interface to vlan832-orange, same thing.
Also - you might grab a quick paket sniffer capture to disk and open it in wireshark to double-check the port number and so forth.
Yes there is an hw switch. Can you put a priority on only one type of traffic with the dot1P function ?Does the CCR have a hardware switch on it? (too lazy and braindead today to go look at the product flier on routerboard.com)
If so, there's an option in the HW switch to twiddle things, including the Dot1P priority value - my 2011 has settings for this, and perhaps this would be the best way to do it w/o using a bridge.