#NEWLINE# def external_gateway_added( self , ex_gw_port , interface_name ) : #NEWLINE# #INDENT# ip_wrapr = ip_lib . IPWrapper ( namespace = self . ns_name ) #NEWLINE# ip_wrapr . netns . execute ( [ 'sysctl' , '-w' , 'net.ipv4.conf.all.send_redirects=0' ] ) #NEWLINE# for p in self . internal_ports : #NEWLINE# #INDENT# gateway = self . get_snat_port_for_internal_port ( p ) #NEWLINE# id_name = self . get_internal_device_name ( p [ 'id' ] ) #NEWLINE# if gateway : #NEWLINE# #INDENT# self . _snat_redirect_add ( gateway , p , id_name ) #NEWLINE# #UNINDENT# #UNINDENT# for port in self . get_snat_interfaces ( ) : #NEWLINE# #INDENT# for ip in port [ 'fixed_ips' ] : #NEWLINE# #INDENT# self . _update_arp_entry ( ip [ 'ip_address' ] , port [ 'mac_address' ] , ip [ 'subnet_id' ] , 'add' )