XenServer

XenServer NAT 설정

1. Intro

XenServer NAT 설정시 Host에서 iptables 설정을 한다.

 

2. How to do?

2.1. Host 설정

xenbr0 IP : Public IP

xenbr0:1 IP : Guest의 Gateway로 사용할 IP ex> 10.10.10.1

# 1:N
iptables -t nat -A PREROUTING -d [Host IP] -p [tcp/udp] --dport [Port] -j DNAT --to-destination [Guest IP:Port]
iptables -t nat -A POSTROUTING -s [Guest IP 대역 ex>10.10.10.0/24] -j MASQUERADE

# 1:1
iptables -t nat -A PREROUTING -d [Host IP] -j DNAT --to-destination [Guest IP]
iptables -t nat -A POSTROUTING -s [Guest IP] -j SNAT --to-source [Host IP]
iptables -t nat -A POSTROUTING -s [Guest IP 대역 ex>10.10.10.0/24] -j MASQUERADE

2.2. Guest 설정

IP : Private IP ex> 10.10.10.11
GW : Host의 IP ex> 10.10.10.1

 

 

Back To Top