[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libvir] Port forwarding



What do people think about adding port forwarding to network configurations?

At the moment it's unnecessarily difficult to connect to (eg.) sshd port or remote desktop port on a virtual machine running under the virtual network configuration. If those ports could be mapped to consecutive ports on the public (eth0) interface then connecting would be simply a matter of knowing the port number.

AFAICS this could be implemented by adding rules such as these to the iptables:

iptables -t nat -A PREROUTING -i $EXTIF -p tcp --dport 80 \
  -j DNAT --to-destination 192.168.122.5
iptables -A FORWARD -i $EXTIF -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i $INTIF -p tcp -d $EXTIP --dport 80 \
  -j DNAT --to-destination 192.168.122.5
iptables -A FORWARD -i $INTIF -p tcp -d $EXTIP --dport 80 -j ACCEPT

(rules taken from http://www.ma.utexas.edu/users/stirling/computergeek/server.html)

Rich.

PS. I'm assuming that this is _not_ what the current /network/forward XML does? It seems to enable forwarding for a single privileged guest as far as I can work out.

--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]