Changeset 2874


Ignore:
Timestamp:
Jan 14, 2010, 2:35:11 PM (15 years ago)
Author:
broder
Message:

Cleanup the invirt-web iptables so that what their doing is clearer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-web/files/etc/invirt-iptables/rules.d/50-invirt-web.mako

    r2863 r2874  
    22
    33from invirt.config import structs as cfg
    4 h_port = cfg.vnc.base_port
    5 port = cfg.vnc.base_port
     4host_port = cfg.vnc.base_port
     5server_port = host_port
    66
    77%>\
     
    1111:OUTPUT ACCEPT [8:674]
    1212% for h in cfg.hosts:
    13 -A PREROUTING -s ! ${h.ip} -i eth0 -p tcp -m tcp --dport ${port} -j DNAT --to-destination ${h.ip}:${h_port}
    14 -A POSTROUTING -d ${h.ip} -o eth0 -p tcp -m tcp --dport ${h_port} -j SNAT --to-source ${cfg.vnc.proxy_ip}
    15 <% port += 1 %>
     13-A PREROUTING -s ! ${h.ip} -i eth0 -p tcp -m tcp --dport ${server_port} -j DNAT --to-destination ${h.ip}:${host_port}
     14-A POSTROUTING -d ${h.ip} -o eth0 -p tcp -m tcp --dport ${host_port} -j SNAT --to-source ${cfg.vnc.proxy_ip}
     15<% server_port += 1 %>\
    1616% endfor
    1717COMMIT
     
    2222:OUTPUT ACCEPT [292:53151]
    2323% for h in cfg.hosts:
    24 -A FORWARD -d ${h.ip} -i eth0 -o eth0 -p tcp -m tcp --dport ${h_port} -j ACCEPT
     24-A FORWARD -d ${h.ip} -i eth0 -o eth0 -p tcp -m tcp --dport ${host_port} -j ACCEPT
    2525% endfor
    2626COMMIT
Note: See TracChangeset for help on using the changeset viewer.