osmode
Port mode:
The osmode
tool creates a virtual network adapter on top of the Napatech NTAPI. This enables a port to be used as a standard Ethernet device. The virtual network device is named ntxs<port>
where <port>
is the port number chosen. By default, port 0 and port 0 MAC address are used. When osmode terminates, the device will be deleted.
Stream ID mode:
When using a stream ID, data will be received using the filter defined by the stream ID. A port number must also be specified in order to define where to transmit data
The stream ID must be created and deleted using the "ntpl" tool.
- Note
- When using stream ID mode and using a more advanced filter other than a single port filter like "assign[streamid=0]=port==0" the OS might not be able to use the the virtual network adapter as a network device. A more advanced filter might filter out some essential packets needed for the OS to establish a link and communicate on the link.
Though the purpose for osmode is to use the Napatech adapters as an OS network adapter, osmode can be used other ways. For example if only ARP packets are wanted. Then a filter only allowing ARP packets can be used.
Syntax
osmode [ --help ] [ --port <port number> ] [ --streamid <stream ID> ] [ --mac <MAC address> ]
Command | Description |
---|---|
--help -h | Display help and exit |
--port <port number> | Port number used for osmode — default is port 0 |
--streamid <stream ID> | Stream ID to used for osmode |
--mac <MAC address> | Specify the MAC address in the format xx:xx:xx:xx:xx:xx — default is the port specific MAC address |
Examples
- Use port 3 for osmode, and the MAC address
00:FF:11:22:33:44
for the virtual adapter — this creates the devicentxs3:
osmode --port 3 --mac 00:FF:11:22:33:44
- Use port 3 for osmode, streamid 0, and the MAC address
00:FF:11:22:33:44
for the virtual adapter — this creates the devicentxs3:
Setup filter:
ntpl -e "assign[streamid=0]=port==3"
Start osmode:
osmode --port 3 --streamid 0 --mac 00:FF:11:22:33:44
Examples on how to setup an IP address in Linux for the ntxs0 interface:
Note: This may differ between various distributions.
Ubuntu/Debian:
edit
/etc/network/interfaces
and add:
iface ntxs0 inet static
address <static ip adress>
netmask <netmask>
gateway <gw ip address>
# sudo ifup ntxs0
CentOS/Fedora/Red Hat:
create
/etc/sysconfig/network-scripts/ifcfg-napa
and add:
TYPE=Ethernet
BOOTPROTO=static
NM_CONTROLLED=no
IPADDR=<static ip address>
GATEWAY=<gw ip address>
NETMASK=<netmask>
IPV4_FAILURE_FATAL=no
NAME=napa
DEVICE=ntxs0
ONBOOT=yes
# service network restart