Visible to Intel only — GUID: wgw1634262474749
Ixiasoft
3.5.2.6.3. Test Procedure by Using Name Space Environment
Use the following script to create name spaces and execute the commands.
- Stop the network manager by using following command:
systemctl stop NetworkManager.service
- Create the name spaces:
ip netns add <VM name>
For example:ip netns add vm0 ip netns add vm1 ip netns add vm2 ip netns add vm3
- Assign the interface to name space:
Command:
ip link set <interface> netns <namespace> ip link set ifc_mcdma0 netns vm0 ip link set ifc_mcdma1 netns vm1 ip link set ifc_mcdma2 netns vm2 ip link set ifc_mcdma3 netns vm3
- Bring up the interface:
Command: ip netns exec vm0 ifconfig <interface> up
Example:ip netns exec vm0 ifconfig ifc_mcdma0 up ip netns exec vm1 ifconfig ifc_mcdma1 up ip netns exec vm2 ifconfig ifc_mcdma2 up ip netns exec vm3 ifconfig ifc_mcdma3 up
- Assigning the IP address:
Command: ip netns exec <namespace> ip addr add <ipaddr> dev <interfacename>
Example:ip netns exec vm1 ip addr add 1.1.1.11/24 dev ifc_mcdma1 ip netns exec vm0 ip addr add 1.1.1.10/24 dev ifc_mcdma0 ip netns exec vm2 ip addr add 1.1.1.12/24 dev ifc_mcdma2 ip netns exec vm3 ip addr add 1.1.1.13/24 dev ifc_mcdma3
- Ping from one interface to another interface:
Command: ip netns exec <namespace> ping <ip address>Example:
ip netns exec ifc_mcdma0 ping 1.1.1.11
- Use iperf and netperf applications to test the TCP and UDP traffic.
- Execute the following command from the host:
Execute the following command to run iperf server:
$ip netns exec vm1 bash $iperf -s
Execute the following command to run iperf client:
$ip netns exec vm0 bash $iperf -c 1.1.1.10 -i 10 -l 64