Merge "NSB: fix port topology"
[yardstick.git] / samples / vnf_samples / nsut / acl / acl_config / acl_script
1 # Copyright (c) 2017 Intel Corporation
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License")#
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http:#www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 link 0 down
16 link 0 config {port0_local_ip} {port0_prefixlen}
17 link 0 up
18 link 1 down
19 link 1 config {port1_local_ip} {port1_prefixlen}
20 link 1 up
21
22 p action add 0 accept
23 p action add 0 fwd 0
24 p action add 0 count
25
26 p action add 1 accept
27 p action add 1 fwd 1
28 p action add 1 count
29
30 #p acl add 1 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 0 0 0
31 #p acl add 1 0.0.0.0 0 0.0.0.0 0 0 65535 0 65535 0 0 1
32
33 # action rule matches dest port
34 p acl add 1 {port1_local_network} {port1_prefix} 0.0.0.0 0 0 65535 0 65535 0 0 0
35 p acl add 1 0.0.0.0 0 {port1_local_network} {port1_prefix} 0 65535 0 65535 0 0 1
36
37 p acl add 1 {port0_local_network} {port0_prefix} 0.0.0.0 0 0 65535 0 65535 0 0 1
38 p acl add 1 0.0.0.0 0 {port0_local_network} {port0_prefix} 0 65535 0 65535 0 0 0
39
40 p acl add 1 {port0_local_network} {port0_prefix} {port1_local_network} {port1_prefix} 0 65535 0 65535 0 0 1
41 p acl add 1 {port1_local_network} {port1_prefix} {port0_local_network} {port0_prefix} 0 65535 0 65535 0 0 0
42
43 # gateway is the remote port
44 p 1 arpadd 0 {port0_gateway} {port0_local_mac}
45 p 1 arpadd 0 {port0_local_ip} {port0_local_mac}
46 p 1 arpadd 0 {port0_dst_ip} {port0_dst_mac}
47 p 1 arpadd 1 {port1_gateway} {port1_local_mac}
48 p 1 arpadd 1 {port1_local_ip} {port1_local_mac}
49 p 1 arpadd 1 {port1_dst_ip} {port1_dst_mac}
50
51 p acl applyruleset
52
53 #p acl dbg 1