Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INTERFACE STYLE:
- =========================
- root@gw2z0# show | compare
- [edit]
- + services {
- + service-set SSET1 {
- + nat-rules nat-rule-1;
- + interface-service {
- + service-interface ms-0/2/0.0;
- + }
- + }
- + nat {
- + pool napt {
- + address 10.10.10.2/32;
- + port {
- + automatic {
- + random-allocation;
- + }
- + }
- + address-allocation round-robin;
- + }
- + rule nat-rule-1 {
- + match-direction input;
- + term term1 {
- + from {
- + source-address {
- + 192.168.1.0/24;
- + }
- + destination-address {
- + 192.168.1.0/24 except;
- + }
- + }
- + then {
- + translated {
- + source-pool napt;
- + translation-type {
- + napt-44;
- + }
- + }
- + }
- + }
- + }
- + }
- + }
- [edit interfaces ms-0/2/0]
- + unit 0 {
- + family inet;
- + }
- [edit interfaces]
- + irb {
- + unit 10 {
- + family inet {
- + service {
- + input {
- + service-set SSET1 service-filter SFILTER-IN;
- + }
- + output {
- + service-set SSET1 service-filter SFILTER-OUT;
- + }
- + }
- + address 192.168.1.1/24;
- + }
- + }
- + }
- [edit firewall family inet]
- + service-filter SFILTER-IN {
- + term term1 {
- + from {
- + source-address {
- + 192.168.1.0/24;
- + }
- + destination-address {
- + 0.0.0.0/0;
- + 192.168.1.0/24 except;
- + }
- + }
- + then service;
- + }
- + term term2 {
- + then skip;
- + }
- + }
- + service-filter SFILTER-OUT {
- + term term1 {
- + from {
- + destination-address {
- + 10.10.10.2/32;
- + }
- + }
- + then service;
- + }
- + term term2 {
- + then skip;
- + }
- + }
- NEXT-HOP STYLE
- ==============================
- + services {
- + service-set SSET1 {
- + nat-rules nat-rule1;
- + next-hop-service {
- + inside-service-interface ms-0/2/0.15;
- + outside-service-interface ms-0/2/0.16;
- + }
- + }
- + nat {
- + pool napt-pool {
- + address 10.10.10.2/32;
- + port {
- + automatic;
- + }
- + }
- + rule nat-rule1 {
- + match-direction input;
- + term nat-term1 {
- + inactive: from {
- + source-address {
- + 192.168.0.0/24;
- + }
- + destination-address {
- + 0.0.0.0/0;
- + }
- + }
- + then {
- + translated {
- + source-pool napt-pool;
- + translation-type {
- + napt-44;
- + }
- + }
- + }
- + }
- + }
- + }
- + }
- + interfaces {
- + irb {
- + unit 10 {
- + family inet {
- + address 192.168.1.1/24;
- + }
- + }
- + }
- + ms-0/2/0 {
- + inactive: unit 0 {
- + family inet;
- + }
- + unit 15 {
- + family inet;
- + service-domain inside;
- + }
- + unit 16 {
- + family inet;
- + service-domain outside;
- + }
- + }
- + ge-1/1/2 {
- + unit 0 {
- + family bridge {
- + interface-mode access;
- + vlan-id 10;
- + }
- + }
- + }
- + }
- + forwarding-options {
- + family inet {
- + filter {
- + input redirect_to_nat_outside_vr;
- + }
- + }
- + }
- + firewall {
- + family inet {
- + filter redirect_to_nat_outside_vr {
- + term term1 {
- + from {
- + destination-address {
- + 10.10.10.2/32;
- + }
- + }
- + then {
- + routing-instance NAT-OUTSDE-VR;
- + }
- + }
- + term default {
- + then accept;
- + }
- + }
- + service-filter SFILTER-IN {
- + term term1 {
- + from {
- + source-address {
- + 192.168.1.0/24;
- + }
- + destination-address {
- + 0.0.0.0/0;
- + 192.168.1.0/24 except;
- + }
- + }
- + then service;
- + }
- + term term2 {
- + then skip;
- + }
- + }
- + service-filter SFILTER-OUT {
- + term term1 {
- + from {
- + destination-address {
- + 10.10.10.2/32;
- + }
- + }
- + then service;
- + }
- + term term2 {
- + then skip;
- + }
- + }
- + }
- + }
- + routing-instances {
- + NAT-INSIDE-VR {
- + instance-type virtual-router;
- + interface ms-0/2/0.15;
- + interface irb.10;
- + routing-options {
- + static {
- + route 0.0.0.0/0 next-hop ms-0/2/0.15;
- + }
- + }
- + }
- + NAT-OUTSDE-VR {
- + instance-type virtual-router;
- + interface ms-0/2/0.16;
- + routing-options {
- + static {
- + route 10.10.10.2/32 next-hop ms-0/2/0.16;
- + route 0.0.0.0/0 next-table inet.0;
- + }
- + }
- + }
- + }
- + bridge-domains {
- + BD10 {
- + vlan-id 10;
- + routing-interface irb.10;
- + }
- + }
Advertisement
Add Comment
Please, Sign In to add comment