Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- PATH=/mnt/host/src/redhat/ovs/utilities:$PATH
- sysctl -qw net.ipv6.conf.all.disable_ipv6=1
- ovs-dpctl add-dp dp
- ip -b - <<'EOF'
- netns add ns
- netns exec ns sysctl -qw net.ipv6.conf.all.disable_ipv6=1
- link add type veth
- link add type veth peer name veth0 netns ns
- link set veth0 up
- link set veth1 up
- link set veth2 up
- addr add 192.168.0.1/24 dev veth0
- link set veth0 up
- EOF
- ip -b - -n ns <<'EOF'
- addr add 192.168.0.2/24 dev veth0
- link set veth0 up
- EOF
- ovs-dpctl add-if dp veth1
- ovs-dpctl add-if dp veth2
- ovs-dpctl add-flow 'in_port(1),eth(),eth_type(0x806),arp()' 2
- ovs-dpctl add-flow 'in_port(2),eth(),eth_type(0x806),arp()' 1
- ovs-dpctl add-flow 'in_port(1),eth(),eth_type(0x800),ipv4()' dec_ttl,2
- ovs-dpctl add-flow 'in_port(2),eth(),eth_type(0x800),ipv4()' dec_ttl,1
- ip netns exec ns tcpdump -tvnni veth0 ip &
- ping -qc1 -w1 -t 42 192.168.0.2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement