You should really only be filtering out the management port.

if p['device_owner'] != 'network:router_management']