Home
last modified time | relevance | path

Searched full:ns2 (Results 1 – 25 of 105) sorted by relevance

12345

/linux-6.12.1/tools/testing/selftests/net/mptcp/
Dmptcp_join.sh28 ns2=""
98 mptcp_lib_ns_init ns1 ns2
101 for netns in "$ns1" "$ns2"; do
111 # ns1 ns2
119 ip link add ns1eth$i netns "$ns1" type veth peer name ns2eth$i netns "$ns2"
124 ip -net "$ns2" addr add 10.0.$i.2/24 dev ns2eth$i
125 ip -net "$ns2" addr add dead:beef:$i::2/64 dev ns2eth$i nodad
126 ip -net "$ns2" link set ns2eth$i up
128 # let $ns2 reach any $ns1 address from any interface
129 ip -net "$ns2" route add default via 10.0.$i.1 dev ns2eth$i metric 10$i
[all …]
Duserspace_pm.sh54 ns2=""
110 mptcp_lib_ns_exit "${ns1}" "${ns2}"
120 mptcp_lib_ns_init ns1 ns2
121 for i in "$ns1" "$ns2" ;do
125 # "$ns1" ns2
128 ip link add ns1eth2 netns "$ns1" type veth peer name ns2eth1 netns "$ns2"
137 ip -net "$ns2" addr add 10.0.1.2/24 dev ns2eth1
138 ip -net "$ns2" addr add 10.0.2.2/24 dev ns2eth1
139 ip -net "$ns2" addr add dead:beef:1::2/64 dev ns2eth1 nodad
140 ip -net "$ns2" addr add dead:beef:2::2/64 dev ns2eth1 nodad
[all …]
Dsimult_flows.sh12 ns2=""
45 mptcp_lib_ns_exit "${ns1}" "${ns2}" "${ns3}"
51 # "$ns1" ns2 ns3
71 mptcp_lib_ns_init ns1 ns2 ns3
73 ip link add ns1eth1 netns "$ns1" type veth peer name ns2eth1 netns "$ns2"
74 ip link add ns1eth2 netns "$ns1" type veth peer name ns2eth2 netns "$ns2"
75 ip link add ns2eth3 netns "$ns2" type veth peer name ns3eth1 netns "$ns3"
92 ip -net "$ns2" addr add 10.0.1.2/24 dev ns2eth1
93 ip -net "$ns2" addr add dead:beef:1::2/64 dev ns2eth1 nodad
94 ip -net "$ns2" link set ns2eth1 up mtu 1500
[all …]
/linux-6.12.1/tools/testing/selftests/net/netfilter/
Drpath.sh37 ns2="ns2-$sfx"
38 trap "ip netns del $ns1; ip netns del $ns2" EXIT
40 # create two netns, disable rp_filter in ns2 and
43 ip netns add "$ns2"
44 ip netns exec "$ns2" sysctl -q net.ipv4.conf.all.rp_filter=0
45 ip netns exec "$ns2" sysctl -q net.ipv4.conf.default.rp_filter=0
46 ip netns exec "$ns2" sysctl -q net.ipv6.conf.all.keep_addr_on_down=1
49 ip -net "$ns1" link add v0 type veth peer name v0 netns "$ns2"
50 ip -net "$ns1" link set v0 up; ip -net "$ns2" link set v0 up
52 ip -net "$ns2" a a 192.168.23.1/24 dev v0
[all …]
Dnft_nat.sh18 ip netns pids "$ns2" | xargs kill 2>/dev/null
30 setup_ns ns0 ns1 ns2
36 ip link add veth1 netns "$ns0" type veth peer name eth0 netns "$ns2"
59 do_config "$ns2" 2
143 for i in "$ns0" "$ns1" "$ns2" ;do
188 if ! ip netns exec "$ns0" nft list counter inet filter "ns2${dir}" | grep -q "$expect";then
189 bad_counter "$ns0" ns2$dir "$expect" "test_local_dnat6 2"
203 # expect 1 packet in ns2
206 if ! ip netns exec "$ns2" nft list counter inet filter "ns0${dir}" | grep -q "$expect";then
207 bad_counter "$ns2" ns0$dir "$expect" "test_local_dnat6 4"
[all …]
Dconntrack_tcp_unreplied.sh23 ip netns pids "$ns2" | xargs kill 2>/dev/null
39 if ! ip netns exec "$ns2" nft list counter inet filter "$name" | grep -q "$expect"; then
40 echo "ERROR: counter $name in $ns2 has unexpected value (expected $expect)" 1>&2
41 ip netns exec "$ns2" nft list counter inet filter "$name" 1>&2
51 setup_ns ns1 ns2
55 ip -net "$ns1" link set netns "$ns2" dev veth2
58 ip -net "$ns2" link set up dev lo
60 ip -net "$ns2" link set up dev veth2
62 ip -net "$ns2" addr add 10.11.11.2/24 dev veth2
63 ip -net "$ns2" route add default via 10.11.11.1
[all …]
Dnft_conntrack_helper.sh24 ip netns del "$ns2"
29 setup_ns ns1 ns2
31 if ! ip link add veth0 netns "$ns1" type veth peer name veth0 netns "$ns2" > /dev/null 2>&1;then
37 ip -net "$ns2" link set veth0 up
42 ip -net "$ns2" addr add 10.0.1.2/24 dev veth0
43 ip -net "$ns2" addr add dead:1::2/64 dev veth0 nodad
117 ip netns exec "$ns2" socat -t 3 -u -4 TCP-LISTEN:"$port",reuseaddr STDOUT > /dev/null &
118 busywait "$BUSYWAIT_TIMEOUT" listener_ready "$ns2" "$port" "-4"
123 check_for_helper "$ns2" "ip $msg" "$port" "$autoassign"
130 ip netns exec "$ns2" conntrack -F 2> /dev/null
[all …]
Dnft_flowtable.sh31 setup_ns ns1 ns2 nsr1 nsr2
35 ip netns pids "$ns2" | xargs kill 2>/dev/null
51 ip link add veth1 netns "$nsr2" type veth peer name eth0 netns "$ns2"
65 # to ns2 (smaller MTU) to stack either to perform fragmentation (ip_no_pmtu_disc=1),
67 # ns2 is going via nsr2 with a smaller mtu, so that TCPMSS announced by both peers
115 ip -net "$ns2" link set eth0 mtu "$rmtu"
130 for ns in "$ns1" "$ns2";do
142 ip -net "$ns2" addr add 10.0.2.99/24 dev eth0
144 ip -net "$ns2" route add default via 10.0.2.1
146 ip -net "$ns2" addr add dead:2::99/64 dev eth0 nodad
[all …]
Dipvs.sh20 # | ns2 |
59 setup_ns ns0 ns1 ns2
62 ip link add veth02 netns "${ns0}" type veth peer name veth20 netns "${ns2}"
63 ip link add veth12 netns "${ns1}" type veth peer name veth21 netns "${ns2}"
78 ip netns exec "${ns2}" ip link set veth21 up
79 ip netns exec "${ns2}" ip addr add "${rip_v4}/24" dev veth21
80 ip netns exec "${ns2}" ip link set veth20 up
81 ip netns exec "${ns2}" ip addr add "${sip_v4}/24" dev veth20
100 ip netns exec "$ns2" timeout 5 socat -u -4 TCP-LISTEN:8080,reuseaddr STDOUT > "${outfile}" &
130 ip netns exec "${ns2}" sysctl -qw net.ipv4.conf.all.arp_ignore=1
[all …]
Dnft_synproxy.sh11 setup_ns nsr ns1 ns2
17 ip netns pids "$ns2" | xargs kill 2>/dev/null
25 ip link add veth1 netns "$nsr" type veth peer name eth0 netns "$ns2"
38 for n in $ns1 $ns2; do
42 ip -net "$ns2" addr add 10.0.2.99/24 dev eth0
44 ip -net "$ns2" route add default via 10.0.2.1
48 echo "ERROR: $ns1 cannot reach $ns2" 1>&2
52 if ! ip netns exec "$ns2" ping -c 1 -q 10.0.1.99 > /dev/null; then
53 echo "ERROR: $ns2 cannot reach $ns1" 1>&2
57 ip netns exec "$ns2" iperf3 -s > /dev/null 2>&1 &
[all …]
Dnf_nat_edemux.sh23 setup_ns ns1 ns2
28 ip link set netns "$ns2" dev veth2
34 ip netns exec "$ns2" ip link set up dev lo
35 ip netns exec "$ns2" ip link set up dev veth2
36 ip netns exec "$ns2" ip addr add 192.168.1.2/24 dev veth2
44 ip netns exec "$ns2" sysctl -q net.ipv4.ip_local_port_range="10000 10000"
47 ip netns exec "$ns2" iptables -t nat -A OUTPUT -d 10.96.0.1/32 -p tcp --dport 443 -j DNAT --to-dest…
50 ip netns exec "$ns2" ip route add 10.96.0.1 via 192.168.1.1
53 ip netns exec "$ns2" socat -t 10 - TCP:192.168.1.1:5201 > /dev/null &
60 echo test | ip netns exec "$ns2" socat -t 3 -u STDIN TCP:10.96.0.1:443,connect-timeout=3 >/dev/null
[all …]
Dbridge_brouter.sh8 # setup is: ns1 <-> nsbr <-> ns2
23 setup_ns nsbr ns1 ns2
31 ip link add veth1 netns "$nsbr" type veth peer name eth0 netns "$ns2"
46 # place both in same subnet, ${ns1} and ${ns2} connected via ${nsbr}:br0
48 ip -net "$ns2" link set eth0 up
50 ip -net "$ns2" addr add 10.0.0.12/24 dev eth0
71 # an ip address in same network segment as ${ns1} and ${ns2} (${nsbr}
81 echo "PASS: ${ns1}/${ns2} connectivity with active broute rule"
101 if ! ip netns exec "$ns2" ping -q -c 1 10.0.0.11 > /dev/null; then
106 echo "PASS: ${ns1}/${ns2} connectivity with active broute rule and bridge forward drop"
[all …]
Dnft_tproxy_udp.sh7 # |ns1 |.99 .1| |.1 .99| ns2|
35 ip netns pids "$ns2" | xargs kill 2>/dev/null
46 setup_ns ns1 ns2 ns3 nsrouter
52 ip link add veth1 netns "$nsrouter" type veth peer name eth0 netns "$ns2"
68 ip -net "$ns2" link set eth0 up
76 ip -net "$ns2" addr add 10.0.2.99/24 dev eth0
77 ip -net "$ns2" addr add dead:2::99/64 dev eth0 nodad
78 ip -net "$ns2" route add default via 10.0.2.1
79 ip -net "$ns2" route add default via dead:2::1
196 …timeout "$timeout" ip netns exec "$ns2" socat "$socat_ipproto" udp-listen:8080,fork SYSTEM:"echo P…
[all …]
Dnft_tproxy_tcp.sh7 # |ns1 |.99 .1| |.1 .99| ns2|
35 ip netns pids "$ns2" | xargs kill 2>/dev/null
46 setup_ns ns1 ns2 ns3 nsrouter
52 ip link add veth1 netns "$nsrouter" type veth peer name eth0 netns "$ns2"
68 ip -net "$ns2" link set eth0 up
76 ip -net "$ns2" addr add 10.0.2.99/24 dev eth0
77 ip -net "$ns2" addr add dead:2::99/64 dev eth0 nodad
78 ip -net "$ns2" route add default via 10.0.2.1
79 ip -net "$ns2" route add default via dead:2::1
222 …timeout "$timeout" ip netns exec "$ns2" socat "$socat_ipproto" tcp-listen:8080,fork SYSTEM:"echo P…
[all …]
/linux-6.12.1/tools/testing/selftests/bpf/
Dtest_lwt_ip_encap.sh6 # NS1 NS2 NS3
21 # NS1/NS2 are configured to route packets to IPv*_GRE via IP*_8
26 # 1. routes NS2->IPv*_DST are brought down, so the only way a ping
49 readonly NS2="ns2-$(mktemp -u XXXXXX)"
113 ip netns add "${NS2}"
118 ip netns exec ${NS2} sysctl -wq net.ipv4.conf.all.rp_filter=0
121 ip netns exec ${NS2} sysctl -wq net.ipv4.conf.default.rp_filter=0
126 ip netns exec ${NS2} sysctl -wq net.ipv6.conf.all.accept_dad=0
129 ip netns exec ${NS2} sysctl -wq net.ipv6.conf.default.accept_dad=0
137 ip netns exec ${NS2} sysctl -wq net.ipv4.ip_forward=1
[all …]
Dtest_tc_tunnel.sh12 readonly ns2="${ns_prefix}2"
30 ip netns add "${ns2}"
33 peer name veth2 mtu 1500 netns "${ns2}"
38 ip -netns "${ns2}" link set veth2 up
41 ip -netns "${ns2}" -4 addr add "${ns2_v4}/24" dev veth2
43 ip -netns "${ns2}" -6 addr add "${ns2_v6}/64" dev veth2 nodad
57 ip netns del "${ns2}"
73 ip netns exec "${ns2}" nc "${netcat_opt}" -l "${port}" > "${outfile}" &
97 if ip netns exec "${ns2}" ss ${2:--4}OHntl | grep -q "$1"; then
234 ip netns exec "${ns2}" ip fou add port $dport ipproto ${dproto}
[all …]
Dtest_xdp_meta.sh7 readonly NS2="ns2-$(mktemp -u XXXXXX)"
20 ip netns del ${NS2} 2> /dev/null
31 ip netns add ${NS2}
38 ip link set veth2 netns ${NS2}
41 ip netns exec ${NS2} ip addr add 10.1.1.22/24 dev veth2
44 ip netns exec ${NS2} tc qdisc add dev veth2 clsact
47 ip netns exec ${NS2} tc filter add dev veth2 ingress bpf da obj ${BPF_FILE} sec t
50 ip netns exec ${NS2} ip link set dev veth2 xdp obj ${BPF_FILE} sec x
53 ip netns exec ${NS2} ip link set dev veth2 up
56 ip netns exec ${NS2} ping -c 1 10.1.1.11
Dtest_xdp_vlan.sh8 readonly NS2="ns2-$(mktemp -u XXXXXX)"
55 echo " ip netns exec ${NS2} bash"
62 ip netns del ${NS2} 2> /dev/null
132 ip netns del ${NS2} 2> /dev/null
150 ip netns add ${NS2}
160 ip link set veth2 netns ${NS2}
168 ip netns exec ${NS2} ethtool -K veth2 rxvlan off
170 # Disable tx-vlan-offload (mostly needed on ns2)
171 ip netns exec ${NS2} ethtool -K veth2 txvlan off
181 # In ns2/veth2 create VLAN device
[all …]
Dtest_xdp_redirect.sh5 # NS1(veth11) NS2(veth22)
14 readonly NS2="ns2-$(mktemp -u XXXXXX)"
23 ip netns add ${NS2}
26 ip link add veth2 index 222 type veth peer name veth22 netns ${NS2}
31 ip -n ${NS2} link set dev veth22 up
34 ip -n ${NS2} addr add 10.1.1.22/24 dev veth22
42 ip netns del ${NS2} 2> /dev/null
58 ip -n ${NS2} link set veth22 $xdpmode obj xdp_dummy.bpf.o sec xdp &> /dev/null
63 ip netns exec ${NS2} ping -c 1 10.1.1.11 &> /dev/null; then
/linux-6.12.1/tools/testing/selftests/net/hsr/
Dhsr_ping.sh35 do_ping "$ns2" 100.64.0.1
40 do_ping "$ns2" 100.64.0.3
45 do_ping "$ns2" dead:beef:1::1
46 do_ping "$ns2" dead:beef:1::2
78 do_ping_long "$ns2" 100.64.0.1
79 do_ping_long "$ns2" dead:beef:1::1
80 do_ping_long "$ns2" 100.64.0.3
81 do_ping_long "$ns2" dead:beef:1::2
103 tc -net "$ns2" qdisc add dev ns2eth1 root netem delay 5ms loss 25%
110 do_ping_long "$ns2" 100.64.0.1
[all …]
Dhsr_redbox.sh13 do_ping "${ns2}" 100.64.0.1
67 # |NS2 (RedBOX) | |NS3 (BR) | | NS5 (SAN) |
75 ip link add ns1eth1 netns "${ns1}" type veth peer name ns2eth1 netns "${ns2}"
76 ip link add ns1eth2 netns "${ns1}" type veth peer name ns2eth2 netns "${ns2}"
77 ip link add ns2eth3 netns "${ns2}" type veth peer name ns3eth1 netns "${ns3}"
86 ip -n "${ns2}" link set ns2eth1 up
87 ip -n "${ns2}" link set ns2eth2 up
88 ip -n "${ns2}" link set ns2eth3 up
102 ip -net "$ns2" link set address 00:11:22:00:02:01 dev ns2eth1
103 ip -net "$ns2" link set address 00:11:22:00:02:02 dev ns2eth2
[all …]
/linux-6.12.1/samples/bpf/
Dtc_l2_redirect.sh18 $IP netns add ns2
26 $IP link set dev vens2 netns ns2
35 $IP -n ns2 link set dev lo up
36 $IP -n ns2 link set dev vens2 up
37 $IP -n ns2 addr add 10.2.1.102/24 dev vens2
38 $IP -n ns2 addr add 2401:db02::66/64 dev vens2 nodad
39 $IP -n ns2 addr add 10.10.1.102 dev lo
40 $IP -n ns2 addr add 2401:face::66/64 dev lo nodad
41 $IP -n ns2 link add ipt2 type ipip local 10.2.1.102 remote 10.2.1.1
42 $IP -n ns2 link add ip6t2 type ip6tnl mode any local 2401:db02::66 remote 2401:db02::1
[all …]
/linux-6.12.1/tools/testing/selftests/net/
Dtest_vxlan_mdb.sh259 local ns2=$1; shift
265 ip link set dev veth1 netns $ns2 name veth0
268 setup_common_ns $ns2 $local_addr2
1174 local ns2=$1; shift
1189 run_cmd "tc -n $ns2 qdisc replace dev veth0 clsact"
1190 run_cmd "tc -n $ns2 qdisc replace dev vx0 clsact"
1191 run_cmd "ip -n $ns2 address replace $vtep1_ip/$plen dev lo"
1192 run_cmd "ip -n $ns2 address replace $vtep2_ip/$plen dev lo"
1198 …run_cmd "tc -n $ns2 filter replace dev vx0 ingress pref 1 handle 101 proto all flower enc_dst_ip $…
1200 tc_check_packets "$ns2" "dev vx0 ingress" 101 1
[all …]
Dbareudp.sh24 # * NS1 and NS2 are the intermediate namespaces. They use a bareudp device to
70 # | | NS2 |
115 readonly NS2=$(mktemp -u ns2-XXXXXXXX)
137 # Create the four network namespaces used by the script (NS0, NS1, NS2 and NS3)
145 ip netns add "${NS2}" || exit_cleanup "${NS0}" "${NS1}"
146 ip netns add "${NS3}" || exit_cleanup "${NS0}" "${NS1}" "${NS2}"
153 exit_cleanup "${NS0}" "${NS1}" "${NS2}" "${NS3}"
185 # NS1 with NS2, etc.),
191 for ns in "${NS0}" "${NS1}" "${NS2}" "${NS3}"; do
196 ip link add name veth12 netns "${NS1}" type veth peer name veth21 netns "${NS2}"
[all …]
Dicmp.sh7 # | ns1 | v4-via-v6 routes: | ns2 |
17 # unreachable" message being sent from ns2, but there is no IPv4 address set in
35 cleanup_ns $NS1 $NS2
41 setup_ns NS1 NS2
44 ip -netns $NS1 link add veth0 type veth peer name veth0 netns $NS2
46 ip -netns $NS2 link set dev veth0 up
49 ip -netns $NS2 addr add $H2_IP6/64 dev veth0 nodad
51 ip -netns $NS2 route add $RT2 via inet6 $H1_IP6
53 # Make sure ns2 will respond with ICMP unreachable
54 ip netns exec $NS2 sysctl -qw net.ipv4.icmp_ratelimit=0 net.ipv4.ip_forward=1

12345