Lines Matching +full:eth +full:- +full:mac
2 # SPDX-License-Identifier: GPL-2.0
4 # In-place tunneling
10 readonly ns_prefix="ns-$$-"
35 ip netns exec "${ns1}" ethtool -K veth1 tso off
37 ip -netns "${ns1}" link set veth1 up
38 ip -netns "${ns2}" link set veth2 up
40 ip -netns "${ns1}" -4 addr add "${ns1_v4}/24" dev veth1
41 ip -netns "${ns2}" -4 addr add "${ns2_v4}/24" dev veth2
42 ip -netns "${ns1}" -6 addr add "${ns1_v6}/64" dev veth1 nodad
43 ip -netns "${ns2}" -6 addr add "${ns2_v6}/64" dev veth2 nodad
46 ip -netns "${ns1}" -4 route flush table main
47 ip -netns "${ns1}" -6 route flush table main
48 ip -netns "${ns1}" -4 route add "${ns2_v4}" mtu 1450 dev veth1
49 ip -netns "${ns1}" -6 route add "${ns2_v6}" mtu 1430 dev veth1
60 if [[ -f "${outfile}" ]]; then
63 if [[ -f "${infile}" ]]; then
67 if [[ -n $server_pid ]]; then
73 ip netns exec "${ns2}" nc "${netcat_opt}" -l "${port}" > "${outfile}" &
78 ip netns exec "${ns1}" timeout 2 nc "${netcat_opt}" -w 1 "${addr2}" "${port}" < "${infile}"
97 if ip netns exec "${ns2}" ss ${2:--4}OHntl | grep -q "$1"; then
105 set -e
108 if [[ "$#" -eq "0" ]]; then
122 $0 ipv4 vxlan eth 2000
125 $0 ipv6 ip6vxlan eth 2000
127 for mac in none mpls eth ; do
128 echo "ip gre $mac"
129 $0 ipv4 gre $mac 100
131 echo "ip6 gre $mac"
132 $0 ipv6 ip6gre $mac 100
134 echo "ip gre $mac gso"
135 $0 ipv4 gre $mac 2000
137 echo "ip6 gre $mac gso"
138 $0 ipv6 ip6gre $mac 2000
140 echo "ip udp $mac"
141 $0 ipv4 udp $mac 100
143 echo "ip6 udp $mac"
144 $0 ipv6 ip6udp $mac 100
146 echo "ip udp $mac gso"
147 $0 ipv4 udp $mac 2000
149 echo "ip6 udp $mac gso"
150 $0 ipv6 ip6udp $mac 2000
157 if [[ "$#" -ne "4" ]]; then
159 echo " or: $0 <ipv4|ipv6> <tuntype> <none|mpls|eth> <data_len>"
168 readonly netcat_opt=-${ipproto}
179 readonly netcat_opt=-${ipproto}
182 readonly fouproto="41 -6"
183 readonly fouproto_mpls="${mplsproto} -6"
193 readonly mac=$3
196 echo "encap ${addr1} to ${addr2}, type ${tuntype}, mac ${mac} len ${datalen}"
213 bpf direct-action object-file ${BPF_FILE} \
214 section "encap_${tuntype}_${mac}"
223 targs="encap fou encap-sport auto encap-dport $udpport"
226 if [[ "$mac" == "mpls" ]]; then
235 targs="encap fou encap-sport auto encap-dport $dport"
236 elif [[ "$tuntype" =~ "gre" && "$mac" == "eth" ]]; then
238 elif [[ "$tuntype" =~ "vxlan" && "$mac" == "eth" ]]; then
269 if [[ "$tuntype" == "ip6udp" && "$mac" == "mpls" ]]; then
272 elif [[ "$tuntype" =~ "udp" && "$mac" == "eth" ]]; then
275 elif [[ "$tuntype" =~ (gre|vxlan) && "$mac" == "eth" ]]; then
280 elif [[ "$mac" == "mpls" ]]; then
283 ip netns exec "${ns2}" sysctl -qw net.mpls.platform_labels=65536
284 ip netns exec "${ns2}" ip -f mpls route add 1000 dev lo
286 ip netns exec "${ns2}" sysctl -qw net.mpls.conf.testtun0.input=1
287 ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.lo.rp_filter=0
294 ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.all.rp_filter=0
296 # selected as the max of the "all" and device-specific values.
297 ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.testtun0.rp_filter=0
315 bpf direct-action object-file ${BPF_FILE} section decap