#NEWLINE# def ensure_vpn_forward( public_ip , port , private_ip ) : #NEWLINE# #INDENT# 'Sets up forwarding rules for vlan.' #NEWLINE# iptables_manager . ipv4 [ 'filter' ] . add_rule ( 'FORWARD' , ( '-d %s -p udp --dport 1194 -j ACCEPT' % private_ip ) ) #NEWLINE# iptables_manager . ipv4 [ 'nat' ] . add_rule ( 'PREROUTING' , ( '-d %s -p udp --dport %s -j DNAT --to %s:1194' % ( public_ip , port , private_ip ) ) ) #NEWLINE# iptables_manager . ipv4 [ 'nat' ] . add_rule ( 'OUTPUT' , ( '-d %s -p udp --dport %s -j DNAT --to %s:1194' % ( public_ip , port , private_ip ) ) ) #NEWLINE# iptables_manager . apply ( )