def ensure_vpn_forward(public_ip, port, private_ip):
 iptables_manager.ipv4['filter'].add_rule('FORWARD', ('-d %s -p udp --dport 1194 -j ACCEPT' % private_ip))
 iptables_manager.ipv4['nat'].add_rule('PREROUTING', ('-d %s -p udp --dport %s -j DNAT --to %s:1194' % (public_ip, port, private_ip)))
 iptables_manager.ipv4['nat'].add_rule('OUTPUT', ('-d %s -p udp --dport %s -j DNAT --to %s:1194' % (public_ip, port, private_ip)))
 iptables_manager.apply()

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