comment { test ipv4 port/vlan/qinq rewrites by generating arps }

set int state tuntap-0 down

set int ip address GigabitEthernet2/2/0 1.2.5.4/24

cre sub GigabitEthernet2/2/0 1 dot1q 6 exact-match
set int ip address GigabitEthernet2/2/0.1 1.2.6.4/24

cre sub GigabitEthernet2/2/0 2 dot1ad 7 inner-dot1q 8 exact-match
set int ip address GigabitEthernet2/2/0.2 1.2.7.4/24

set int state GigabitEthernet2/1/0 up 
set int state GigabitEthernet2/2/0 up
set int state GigabitEthernet2/2/0.1 up
set int state GigabitEthernet2/2/0.2 up

trace add pg-input 2

cle er
cle int
cle run

packet-generator new {
  name toport
  limit 2
  node ethernet-input
  interface GigabitEthernet2/1/0
  data {
      IP4: 0050.56b7.7c83 -> 0050.56b7.296d 
      GRE: 8.0.0.1 -> 1.2.5.6 mpls_unicast 
  }
}

packet-generator new {
  name tovlan
  limit 2
  node ethernet-input
  interface GigabitEthernet2/1/0
  data {
      IP4: 0050.56b7.7c83 -> 0050.56b7.296d 
      GRE: 8.0.0.1 -> 1.2.6.6 mpls_unicast 
  }
}

packet-generator new {
  name toqinq
  limit 2
  node ethernet-input
  interface GigabitEthernet2/1/0
  data {
      IP4: 0050.56b7.7c83 -> 0050.56b7.296d 
      GRE: 8.0.0.1 -> 1.2.7.6 mpls_unicast 
  }
}