# Iptables NAT slow



## aggressivenetworks (Jan 12, 2015)

I have a dedicated server with kvm running. Each VPS has native ipv6 but I run iptables to forward packets via ipv4 to the internal ips. I was wondering if there anyway i speed up the ipv4 side that running though iptables?   Here is the script

iptables -F

iptables -A FORWARD -i intbr0 -j ACCEPT

iptables -t nat -A POSTROUTING -o viifbr0 -j SNAT --to 162.219.26.00

iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT

iptables -t nat -A PREROUTING -p tcp -d 162.219.26.00 --dport 200 -i viifbr0 -j DNAT --to-destination 192.168.1.2:22

iptables -t nat -A PREROUTING -p udp -d 162.219.26.00 --dport 200 -i viifbr0 -j DNAT --to-destination 192.168.1.2:22

iptables -t nat -A PREROUTING -p tcp -d 162.219.00.00 --dport 201:220 -j DNAT --to-destination 192.168.1.2

iptables -t nat -A PREROUTING -p udp -d 162.219.00.00 --dport 201:220 -j DNAT --to-destination 192.168.1.2


----------

