IOS to Junos (I2J) Tips
IOS to Junos (I2J) Tips

Monitor session vs. Port Mirroring

‎04-30-2012 08:24 AM

 

  Hi All.

 

  This time how to configure a monitor session. This is the way to configure span or monitor sessions under mid to high end platforms, both routers and switches.

 

 

   The following JunOS configuration is larger than the IOS configuration, but this way JunOS could apply some features Cisco don't have.

   . 

 

-----------------------------------------------------------------------------------------------------

IOS Configuration

-----------------------------------------------------------------------------------------------------

 

!

! Only have to declare the source, vlan, interfaces, and traffic direction, input, output, both.

! And then the destination interface, or vlan or RSPAN vlan (this will be other good exercise).

!

monitor session 1 source interface GigabitEthernet 0/0 both

monitor session 1 destination interface GigabitEthernet 0/1

monitor session 1 destination interface GigabitEthernet 0/2

 

! Other configuration option.

monitor session 2 source vlan 100 both

monitor session 2 destination interface GigabitEthernet 0/1

monitor session 2 destination interface GigabitEthernet 0/2

 

 

-----------------------------------------------------------------------------------------------------

JunOS Configuration

-----------------------------------------------------------------------------------------------------

 

/* Will use the bridge configuration from my previous post, irb. */

 

/* This is the way to apply the por mirroring, or redirect filter to the interface, have to apply for both, input and output as i did

   in the IOS configuration. */
set interfaces ge-1/0/0 unit 0 family bridge filter input Monitor-Sess

set interfaces ge-1/0/0 unit 0 family bridge filter output Monitor-Sess

 

/* We don't need to mirror every packet, rate is the 1/X packets rate that will mirrored, this way we could only sample a packet capture. */

set forwarding-options port-mirroring input rate 1
set forwarding-options port-mirroring input run-length 1

 

/* Under this scenario, with bridge interfaces, for vpls family will set the destination interface. In our case, will use two

   destination interfaces. This will not work on all JunOS platforms. This is from a MX router. */
set forwarding-options port-mirroring family vpls output next-hop-group Two-Interfaces

 

/* Have to declare the port mirror type for next hop group. In this case, layer-2. For compatible box like MX. */
set forwarding-options next-hop-group Two-Interfaces group-type layer-2
set forwarding-options next-hop-group Two-Interfaces interface ge-1/0/1.0
set forwarding-options next-hop-group Two-Interfaces interface ge-1/0/2.0

 

/* This is the filter that will mirror traffic.

    We could filter and mirror only some traffic under a from hierarchy. Under IOS we have to use vlan filters and acl. */
set firewall family bridge filter Monitor-Sess term accept-all then accept
set firewall family bridge filter Monitor-Sess term accept-all then port-mirror

 

 

 

 

Br
Alex

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want to say thanks, the word is Kudos!!.

Thx.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

JNCIA-JUNOS, JNCIS-ENT, JNCIS-SP, JNCIP-SP.
CCNA, CCNP, Written CCIE.