xref: /linux-tools/misc/scripts/iptables/clear_vips_trie_iptablerules.py (revision de922be4e919572d28577568db563e691d5e7702)
1*de922be4SDavid Wang# iptables -t nat -N services
2*de922be4SDavid Wang# iptables -t nat -A OUTPUT -d 10.10.0.0/16 -j services
3*de922be4SDavid Wang# iptables -t nat -N myservice
4*de922be4SDavid Wang# iptables -t nat -A myservice  -m statistic --mode random --probability 0.3333 -j DNAT --to-destination 172.18.1.3
5*de922be4SDavid Wang# iptables -t nat -A myservice  -m statistic --mode random --probability 0.5 -j DNAT --to-destination 172.18.1.4
6*de922be4SDavid Wang# iptables -t nat -A myservice  -j DNAT --to-destination 172.18.1.5
7*de922be4SDavid Wang
8*de922be4SDavid Wang
9*de922be4SDavid Wang
10*de922be4SDavid Wang# iptables -t nat -A OUTPUT -d 10.10.0.0/16 -j myservice
11*de922be4SDavid Wang
12*de922be4SDavid Wangprint "iptables -t nat -F services"
13*de922be4SDavid Wangfor a in range(1, 101):
14*de922be4SDavid Wang    cc = "myservice_%d" % a
15*de922be4SDavid Wang    print "iptables -t nat -F %s" % cc
16*de922be4SDavid Wang    print "iptables -t nat -X %s" % cc
17*de922be4SDavid Wang
18*de922be4SDavid Wangprint "iptables -t nat -F services"
19*de922be4SDavid Wang
20*de922be4SDavid Wang
21