def _remove_dnsmasq_accept_rules(dev):
 table = iptables_manager.ipv4['filter']
 for port in [67, 53]:
  for proto in ['udp', 'tcp']:
   args = {'dev': dev, 'port': port, 'proto': proto}
   table.remove_rule('INPUT', ('-i %(dev)s -p %(proto)s -m %(proto)s --dport %(port)s -j ACCEPT' % args))
 iptables_manager.apply()

def _remove_dnsmasq_accept_rules ( dev ) : table = iptables_manager . ipv4 [ 'filter' ] for port in [ 67 , 53 ] : for proto in [ 'udp' , 'tcp' ] : args = { 'dev' : dev , 'port' : port , 'proto' : proto } table . remove_rule ( 'INPUT' , ( '-i %(dev)s -p %(proto)s -m %(proto)s --dport %(port)s -j ACCEPT' % args ) ) iptables_manager . apply ( )
remove dhcp and dns traffic allowed through to dnsmasq .