def create_ipv4_filter_rule(container_ip, bridge, proto, container_port):
    """return a iptables v4 filter rule for forwarding a host port to a container IP:port"""
    return '-A FORWARD -d {container_ip} ! -i {bridge} -o {bridge}' \
           ' -p {proto} -m {proto} --dport {container_port}'\
           ' -j ACCEPT\n'.format(container_ip=container_ip,
                                 bridge=bridge,
                                 proto=proto,
                                 container_port=container_port)