Closed kylinsoong closed 5 months ago
% ./f5-tmsh-generator.py config/bigip-v13-new.running-config config/app/request-perist-sourceip_1800s.txt
---- 一号机网络配置 ----
---- 二号机网络配置 ----
---- 业务变更配置 ----
tmsh create ltm pool CeShiYingYong_192.168.20.100_80_pool members add { 192.168.10.21:8080 192.168.10.22:8080 192.168.10.23:8080 192.168.10.24:8080 } monitor tcp
tmsh create ltm snatpool CeShiYingYong_192.168.20.100_80_snat members add { 192.168.20.101 192.168.20.102 }
tmsh create ltm persistence source-addr sourceip_1800s timeout 1800
tmsh create ltm virtual CeShiYingYong_192.168.20.100_80_vs destination 192.168.20.100:80 pool CeShiYingYong_192.168.20.100_80_pool ip-protocol tcp profiles add { fastL4 { } } source-address-translation { type snat pool CeShiYingYong_192.168.20.100_80_snat } persist replace-all-with { sourceip_1800s }
tmsh save sys config
---- 变更回退配置 ----
tmsh delete ltm virtual CeShiYingYong_192.168.20.100_80_vs
tmsh delete ltm persistence source-addr sourceip_1800s
tmsh delete ltm snatpool CeShiYingYong_192.168.20.100_80_snat
tmsh delete ltm pool CeShiYingYong_192.168.20.100_80_pool
tmsh save sys config
% ./f5-tmsh-generator.py config/bigip-v13-new.running-config config/app/request-perist-sourceip_300s.txt
---- 一号机网络配置 ----
---- 二号机网络配置 ----
---- 业务变更配置 ----
tmsh create ltm pool CeShiYingYong_192.168.20.100_80_pool members add { 192.168.10.21:8080 192.168.10.22:8080 192.168.10.23:8080 192.168.10.24:8080 } monitor tcp
tmsh create ltm snatpool CeShiYingYong_192.168.20.100_80_snat members add { 192.168.20.101 192.168.20.102 }
tmsh create ltm persistence source-addr sourceip_300s timeout 300
tmsh create ltm virtual CeShiYingYong_192.168.20.100_80_vs destination 192.168.20.100:80 pool CeShiYingYong_192.168.20.100_80_pool ip-protocol tcp profiles add { fastL4 { } } source-address-translation { type snat pool CeShiYingYong_192.168.20.100_80_snat } persist replace-all-with { sourceip_300s }
tmsh save sys config
---- 变更回退配置 ----
tmsh delete ltm virtual CeShiYingYong_192.168.20.100_80_vs
tmsh delete ltm persistence source-addr sourceip_300s
tmsh delete ltm snatpool CeShiYingYong_192.168.20.100_80_snat
tmsh delete ltm pool CeShiYingYong_192.168.20.100_80_pool
tmsh save sys config
% ./f5-tmsh-generator.py config/bigip-v13-new.running-config config/app/request-perist-cookie_300s.txt
---- 一号机网络配置 ----
---- 二号机网络配置 ----
---- 业务变更配置 ----
tmsh create ltm pool CeShiYingYong_192.168.20.100_80_pool members add { 192.168.10.21:8080 192.168.10.22:8080 192.168.10.23:8080 192.168.10.24:8080 } monitor tcp
tmsh create ltm snatpool CeShiYingYong_192.168.20.100_80_snat members add { 192.168.20.101 192.168.20.102 }
tmsh create ltm persistence cookie cookie_300s
tmsh create ltm virtual CeShiYingYong_192.168.20.100_80_vs destination 192.168.20.100:80 pool CeShiYingYong_192.168.20.100_80_pool ip-protocol tcp profiles add { http { } } service-down-immediate-action reset source-address-translation { type snat pool CeShiYingYong_192.168.20.100_80_snat } persist replace-all-with { cookie_300s }
tmsh save sys config
---- 变更回退配置 ----
tmsh delete ltm virtual CeShiYingYong_192.168.20.100_80_vs
tmsh delete ltm persistence cookie cookie_300s
tmsh delete ltm snatpool CeShiYingYong_192.168.20.100_80_snat
tmsh delete ltm pool CeShiYingYong_192.168.20.100_80_pool
tmsh save sys config
% ./f5-tmsh-generator.py config/bigip-v13-new.running-config config/app/request-perist-cookie_1800s.txt
---- 一号机网络配置 ----
---- 二号机网络配置 ----
---- 业务变更配置 ----
tmsh create ltm pool CeShiYingYong_192.168.20.100_80_pool members add { 192.168.10.21:8080 192.168.10.22:8080 192.168.10.23:8080 192.168.10.24:8080 } monitor tcp
tmsh create ltm snatpool CeShiYingYong_192.168.20.100_80_snat members add { 192.168.20.101 192.168.20.102 }
tmsh create ltm persistence cookie cookie_1800s
tmsh create ltm virtual CeShiYingYong_192.168.20.100_80_vs destination 192.168.20.100:80 pool CeShiYingYong_192.168.20.100_80_pool ip-protocol tcp profiles add { http { } } service-down-immediate-action reset source-address-translation { type snat pool CeShiYingYong_192.168.20.100_80_snat } persist replace-all-with { cookie_1800s }
tmsh save sys config
---- 变更回退配置 ----
tmsh delete ltm virtual CeShiYingYong_192.168.20.100_80_vs
tmsh delete ltm persistence cookie cookie_1800s
tmsh delete ltm snatpool CeShiYingYong_192.168.20.100_80_snat
tmsh delete ltm pool CeShiYingYong_192.168.20.100_80_pool
tmsh save sys config
% ./f5-tmsh-generator.py config/bigip-v13-new.running-config config/app/request-perist-none.txt
---- 一号机网络配置 ----
---- 二号机网络配置 ----
---- 业务变更配置 ----
tmsh create ltm pool CeShiYingYong_192.168.20.100_80_pool members add { 192.168.10.21:8080 192.168.10.22:8080 192.168.10.23:8080 192.168.10.24:8080 } monitor tcp
tmsh create ltm snatpool CeShiYingYong_192.168.20.100_80_snat members add { 192.168.20.101 192.168.20.102 }
tmsh create ltm virtual CeShiYingYong_192.168.20.100_80_vs destination 192.168.20.100:80 pool CeShiYingYong_192.168.20.100_80_pool ip-protocol tcp profiles add { fastL4 { } } source-address-translation { type snat pool CeShiYingYong_192.168.20.100_80_snat } persist none
tmsh save sys config
---- 变更回退配置 ----
tmsh delete ltm virtual CeShiYingYong_192.168.20.100_80_vs
tmsh delete ltm snatpool CeShiYingYong_192.168.20.100_80_snat
tmsh delete ltm pool CeShiYingYong_192.168.20.100_80_pool
tmsh save sys config
Current source_addr persistent timeout are hard code 300s
Change if persistent name contains 1800 then set 1800 as timeout.