RTK.0> port set port all state enable
RTK.0> vlan set pvid-mode inner port all untag-only
RTK.0> vlan create vlan-table vid 20
RTK.0> vlan create vlan-table vid 30
RTK.0> vlan set vlan-table vid 20 member 48
RTK.0> vlan set vlan-table vid 30 member 50
RTK.0> vlan set vlan-table vid 1 member 48,50
RTK.0> vlan set pvid outer port 48 20
RTK.0> vlan set pvid outer port 50 30
RTK.0> l3 set ipuc routing state enable
RTK.0> l3 create intf vid 20 mac-addr 00:09:09:15:8A:59
Interface : 3
vrf_id : 0
vid : 20
mac : 00:00:00:01:01:01
mtu : 1500
ipv6_mtu : 1500
ttl : 0
RTK.0>
RTK.0> l3 create intf vid 30 mac-addr 00:09:09:15:8A:59
Interface : 4
vrf_id : 0
vid : 30
mac : 00:00:00:01:01:01
mtu : 1500
ipv6_mtu : 1500
ttl : 0
RTK.0> l3 set intf 3 ipuc routing state enable
RTK.0> l3 set intf 3 vrf-id 0
RTK.0> l3 set intf 4 ipuc routing state enable
RTK.0> l3 set intf 4 vrf-id 0
RTK.0> l3 create next-hop intf 3 mac-addr 00:00:00:02:02:02
NextHop ID : 3
Interface ID : 1
MAC address : 00:00:00:02:02:02
L3 action : Forward
RTK.0>
RTK.0> l3 create next-hop intf 4 mac-addr 00:00:00:03:03:03
NextHop ID : 4
Interface ID : 2
MAC address : 00:00:00:03:03:03
L3 action : Forward
RTK.0> l3 add host vrf-id 0 ip 2.2.2.4 path-id 3 fwd-action forward
Route Entry :
Flag : 0x0
VRF ID : 0
IPv4 Addr : 2.2.2.4
Path ID : 1
Intf ID : 0
Mac : 00:00:00:00:00:00
Forward Action : Forward
QoS Priority : 0
RTK.0>
RTK.0> l3 add host vrf-id 0 ip 3.3.3.4 path-id 4 fwd-action forward
Route Entry :
Flag : 0x0
VRF ID : 0
IPv4 Addr : 3.3.3.4
Path ID : 2
Intf ID : 0
Mac : 00:00:00:00:00:00
Forward Action : Forward
QoS Priority : 0
RTK.0>
RTK.0> l2-table add mac-ucast 20 00:00:0:02:02:02 port 48 static
RTK.0>
RTK.0> l2-table add mac-ucast 30 00:00:0:03:03:03 port 50 static
RTK.0>
RTK.0> l3 add route vrf-id 0 ip 2.2.2.0 prefix-length 24 path-id 2 fwd-action trap-to-cpu (送cpu,path-id为2的设备下了默认的)
RTK.0>
RTK.0> l3 add route vrf-id 0 ip 3.3.3.0 prefix-length 24 path-id 2 fwd-action trap-to-cpu
RTK.0>
RTK.0>
查看芯片表项
RTK.0> vlan get pvid-mode inner port 48
Inner port-based VLAN mode configuration
Port 48 : Untag only
RTK.0>
RTK.0> vlan get pvid-mode inner port 50
Inner port-based VLAN mode configuration
Port 50 : Untag only
RTK.0>
RTK.0> vlan get pvid-mode outer port 48
Outer port-based VLAN mode configuration
Port 48 : Untag only
RTK.0>
RTK.0> vlan get pvid-mode outer port 50
Outer port-based VLAN mode configuration
Port 50 : Untag only
RTK.0>
RTK.0> vlan get vlan-table vid 20
Vlan 20
Member Ports : 48
Untag Ports :
Tag Ports : 48
mcast group : 0x0
Stg : 0
UBCAST hkey : UC_LOOKUP_ON_VID
MCAST hkey : MC_LOOKUP_ON_VID
VLAN GroupMask : 0
Profile index : 0
RTK.0>
RTK.0> vlan get vlan-table vid 30
Vlan 30
Member Ports : 50
Untag Ports :
Tag Ports : 50
mcast group : 0x0
Stg : 0
UBCAST hkey : UC_LOOKUP_ON_VID
MCAST hkey : MC_LOOKUP_ON_VID
VLAN GroupMask : 0
Profile index : 0
RTK.0>
RTK.0> vlan get pvid outer port 48
Outer tag port based vlan configuration
Port 48 : 20
RTK.0>
RTK.0> vlan get pvid outer port 50
Outer tag port based vlan configuration
Port 50 : 30
RTK.0>
RTK.0> l3 get ipuc routing state
ipuc routing state: Enabled
RTK.0>
RTK.0> l3 dump intf from 0 to 10
Intf ID | VRF ID | VLAN | MAC |IPv4 MTU|IPv6 MTU| TTL
---------+--------+--------+------------------+--------+--------+----
1 | 0 | 4095 |00:09:09:15:8A:59 | 1500 | 1500 | 0
2 | 0 | 1 |00:09:09:15:8A:59 | 1500 | 1500 | 0
3 | 0 | 20 |00:09:09:15:8A:59 | 1500 | 1500 | 0
4 | 0 | 30 |00:09:09:15:8A:59 | 1500 | 1500 | 0
Total entry number : 4
RTK.0>
RTK.0> l3 dump next-hop from 0 to 10
NextHop ID | Intf ID | MAC | Action
------------+---------+-------------------+--------
1 | 0 | 00:00:00:00:00:00 | Drop
2 | 0 | 00:00:00:00:00:00 | Drop
3 | 3 | 00:00:00:02:02:02 | Forward
4 | 4 | 00:00:00:03:03:03 | Forward
Total entry number : 4
RTK.0>
RTK.0> l3 dump route ip from 0 to 10
Index |VRF ID| IPv4 Address |Pre-len|Suf-len|Path|Pri | Forward Action | Flag
------+------+----------------+-------+-------+----+----+--------------------+----------------------
0 | 0 | 192.168.1.0| 24 | 0 | 2| 0| Trap to CPU |
Total entry number : 1
RTK.0>
RTK.0> l3 dump route ip from 0 to 10
Index |VRF ID| IPv4 Address |Pre-len|Suf-len|Path|Pri | Forward Action | Flag
------+------+----------------+-------+-------+----+----+--------------------+----------------------
0 | 0 | 192.168.1.0| 24 | 0 | 2| 0| Trap to CPU |
1 | 0 | 2.2.2.0| 24 | 0 | 2| 0| Trap to CPU |
2 | 0 | 3.3.3.0| 24 | 0 | 2| 0| Trap to CPU |
Total entry number : 3
RTK.0>
RTK.0> l3 dump host ip from 0 to 10
Index |VRF ID| IPv4 Address |Path|Pri | Forward Action | Flag
------+------+----------------+----+----+--------------------+----------------------
Total entry number : 0
RTK.0>
RTK.0> l3 get host vrf-id 0 ip 2.2.2.4
Route Entry :
Flag : 0x80 ( hit |)
VRF ID : 0
IPv4 Addr : 2.2.2.4
Path ID : 3
Intf ID : 0
Mac : 00:00:00:00:00:00
Forward Action : Forward
QoS Priority : 0
RTK.0>
RTK.0> l3 get host vrf-id 0 ip 3.3.3.4
Route Entry :
Flag : 0x80 ( hit |)
VRF ID : 0
IPv4 Addr : 3.3.3.4
Path ID : 4
Intf ID : 0
Mac : 00:00:00:00:00:00
Forward Action : Forward
QoS Priority : 0
RTK.0>