#### Create the firewall filter
set firewall filter mirror term Mirror then port-mirror
set firewall filter mirror term Mirror then accept
#### Define interface for result port
set interfaces ge-7/0/0 unit 0 description "Result Port (TCPdump/Wireshark)"
set interfaces ge-7/0/0 unit 0 family inet address 192.168.0.1/30
#### Define port-mirroring options
set forwarding-options port-mirroring input rate 1
set forwarding-options port-mirroring family inet output interface ge-7/0/0.0 next-hop 192.168.0.2
set forwarding-options port-mirroring family inet output no-filter-check
#### Apply the filter to the interface
set interfaces ge-0/0/0 unit 0 description "Source Port"
set interfaces ge-0/0/0 unit 0 family inet filter input mirror
set interfaces ge-0/0/0 unit 0 family inet filter output mirror
set interfaces ge-0/0/0 unit 0 family inet address 172.16.20.1/30
#### show | compare
[edit]
user@JunOSRX# show | compare
[edit interfaces ge-0/0/0 unit 0]
+ description "Source Port";
+ family inet {
+ filter {
+ input mirror;
+ output mirror;
+ }
+ address 172.16.20.1/30;
+ }
[edit interfaces]
+ ge-7/0/0 {
+ unit 0 {
+ description "Result Port (TCPdump/Wireshark)";
+ family inet {
+ address 192.168.0.1/30;
+ }
+ }
+ }
[edit]
+ forwarding-options {
+ port-mirroring {
+ input {
+ rate 1;
+ }
+ family inet {
+ output {
+ interface ge-7/0/0.0 {
+ next-hop 192.168.0.2;
+ }
+ no-filter-check;
+ }
+ }
+ }
+ }
+ firewall {
+ filter mirror {
+ term Mirror {
+ then {
+ port-mirror;
+ accept;
+ }
+ }
+ }
+ }
[edit]
user@JunOSRX# commit check
configuration check succeeds
[edit]
user@JunOSRX#
ref.
JunOS router port-mirroring
JunOS EX switch port-mirroring
2 comments:
I completely enjoyed the post and hoping more post from you soon. Thanks for share!
juniper srx
Hi Jose Manuel, Thank you :-)
Post a Comment