You copied the Doc URL to your clipboard.

TAP/TUN networking

This section describes TAP/TUN networking.

TAP/TUN networking - limitations

This section describes general limitations of TAP/TUN networking for models.

DHCP

If the host uses Dynamic DNS, it inserts records into DNS. If you manage this host with DHCP, then installing TAP networking can cause failure to register in the DNS. After the physical device attaches to the bridge device, the DHCP client reruns, but the DHCP request does not have the correct hostname.

WiFi

Most WiFi adaptors do not implement the required support for TAP networking to work.

Setting up a network connection for Microsoft Windows

This section describes how to set up a network connection.

Prerequisites

The Fast Models networking environment needs the Third Party IP add-on for the Fast Model Portfolio.

Procedure

  1. Close all non-essential applications.
  2. Install the TAP driver and configure it:
    1. Locate Fast Model Portfolio, default C:\Program Files\ARM\FastModelPortfolio_X.Y.
    2. Execute the ModelNetworking\add_adapter_64.bat file.
  3. Select Start > Control Panel > Network Connections and locate the newly installed TAP device.
  4. Select at least one real Ethernet adapter connection. Press the Ctrl key to multi-select.
  5. Right-click and select Bridge Connections.

Configuring the networking environment for Microsoft Windows

This section describes how to set the parameters to make a network connection.

Note

  • This procedure has not been tested with wireless network adapters.
  • Firewall software might block network traffic in the network bridge, and might result in a networking failure in the model. If the model does not work after configuration, check the firewall settings.

Prerequisites

Use System Canvas or a related Fast Models tool to load a project and build a model, or use Model Shell or Model Debugger to start a prebuilt model.

Procedure

  1. Set the appropriate parameters on the HostBridge and SMSC_91C111 components.
    hostbridge.interfaceName="ARM<x>"
    smsc_91c111.enabled=1

    ARM<x> is an adapter that is built into the network bridge, and is 0 by default. Use x+1 if ARM<x> exists.

  2. Optional: Set another parameter on the device, if you have to enable promiscuous mode for the TAP device.
    1. Select Start > Run > cmd.exe.
    2. Enter the following commands.
      netsh bridge show adapter
      netsh bridge set adapter <N> forcecompatmode=enable

      <N> is the id number of the TAP adapter that the first command lists.

Commands for tap_setup_32.exe or tap_setup_64.exe for Microsoft Windows

This section lists the commands for use with tap_setup_32.exe or tap_setup_64.exe. These files are located in the ModelNetworking directory.

help
Print help information.
set_media
Configure the TAP devices to Always Connected.
set_perm
Configure the TAP devices to Non-admin Accessible.
restart
Restart the TAP devices.
list_dev
List available TAP devices and output to a file.
rename
Rename the device to ARMx.
install <inffile> <id>
Install a TAP Win32 or Win64 adapter.
remove <dev>
Remove TAP Win32 or Win64 adapters. Set <dev> to All to remove all tap devices.
setup <inffile> <id>
Automated setup process.

Uninstalling networking for Microsoft Windows

This section describes how to uninstall TAP adapters from the base location of the Fast Models Portfolio, by default C:\Program Files\ARM\FastModelPortfolio_X.Y.

Procedure

  1. Run the remove_all_adapters_32.bat or remove_all_adapters_64.bat file. These files are located in the ModelNetworking directory.
  2. If the uninstallation does not delete the bridge, delete it manually.
    1. Close all non-essential applications.
    2. Select Network Connections.
    3. Right-click on the bridge and select Delete.

Setting up a network connection for Red Hat Enterprise Linux

This section describes how to set up a network connection.

Note

Perform this procedure once for each host machine.

Restriction:

The set-up and configuration instructions assume that your network provides IP addresses by DHCP. Otherwise, consult your network administrator.

Prerequisites

Ensure that the brctl utility is on your system. This utility is in the installation package, but ARM recommends that you use the standard Linux bridge utilities, which are in the Linux distribution.

Procedure

  1. In a shell, change to the FastModelsPortfolio_X.Y/ModelNetworking directory.
  2. Run the following script from this directory, because it does not work correctly if run from any other location:
    32-bit operating system
    Run add_adapter_32.sh as root. For example, sudo ./add_adapter_32.sh.
    64-bit operating system
    Run add_adapter_64.sh as root. For example, sudo ./add_adapter_64.sh.
  3. The prompt appears: Specify the TAP device prefix:(ARM). Select Enter to accept the default.
  4. The prompt appears: Specify the user list. Enter a space-separated list of all users who are to use the model on the network, then select Enter. All entries in the list must be the names of existing user accounts on the host.
  5. The prompt appears: Enter the network adapter which connects to the network:(eth0). Select Enter to accept the default, or input the name of a network adapter that connects to your network.
  6. The prompt appears: Enter a name for the network bridge to create:(armbr0). Select Enter to accept the default, or input a name for the network bridge. You must not have an existing network interface on your system with the selected name.
  7. The prompt appears: Enter the location to write the init script to:(/etc/init.d/FMNetwork). Select Enter to accept the default, or input another path with a new filename in an existing directory.
  8. The prompt appears: WARNING: the script creates a bridge which includes the local network adapter and tap devices. You may suffer temporary network loss. Do you want to proceed? (Yes or No). Verify all values input so far, and enter Yesif you want to proceed. If you enter No, no changes are made to your system.
  9. A prompt appears to inform you of the changes that the script is to make to your system. Input Yes if you are happy to accept these changes, or input No to leave your system unchanged.

    Note

    After entering Yes, you might temporarily lose network connectivity. Also, the IP address of the system might change.

Postrequisites

The network bridge is disabled after the host system is reset. To configure the host system to support bridged networking, you might have to create links to the init script (FMNetwork). The script suggests some appropriate links for Red Hat Enterprise Linux 6.

The default firewall configuration on Red Hat Enterprise Linux 6 blocks packet transmission across the TAP networking bridge device. You can disable the firewall. If the context makes this unwise, then add firewall rules to allow transmission. These iptables commands configure the firewall to allow packets across the bridge device:

iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT
service iptables save
service iptables restart

Setting up a network connection for Ubuntu Linux

This section describes how to set up a network connection.

To use TAP networking with Fast Models on Ubuntu, set up a TAP device manually by following these steps. This guide uses a network interface eth0 and a username fmuser. Replace these values as appropriate.

Note

Typographic errors when modifying network configuration can cause the computer to fail to connect to the network. ARM recommends performing these steps on a machine that you have physical access to.

Procedure

  1. Note

    Edit the interfaces file with root privileges.
    Add eth0 to /etc/network/interfaces if it is not there.
    This step stops network-manager from managing eth0. It can result in network-manager indicating there is no network connection even if there is.
    Option Description
    For an interface using DHCP Add:
    auto eth0
    iface eth0 inet dhcp
    Configure a static IP address Add the static information, for example:
    auto eth0
    iface eth0 inet static
    address 192.168.0.2
    netmask 255.255.255.0
    gateway 192.168.0.1
    The network notifier applet launches the GUI tool network-manager. It automatically configures network devices that /etc/network/interfaces does not manage, and sets up devices in a way that is incompatible with bridging. This step makes sure that network-manager does not manage the network interface that you want to bridge to. If you are unsure how to configure your network interface, ask your network administrator.
  2. Install the bridge-utils package.
    Run:
    sudo apt-get install bridge-utils
    This step provides the brctl command, for creating and managing the network bridge.
  3. Create a bridge device by adding an entry to /etc/network/interfaces.
    auto armbr0
    iface armbr0 inet dhcp
    pre-up ifconfig eth0 0.0.0.0 promisc
    post-down ifconfig eth0 0.0.0.0 -promisc
    The pre-up and post-down lines give commands to execute before bringing up armbr0 and after bringing it down. These commands put eth0 into promiscuous mode at pre-up and take it out of promiscuous mode at post-down. Promiscuous mode makes sure that the hardware does not filter out packets for the virtual ethernet device.
    This step creates a bridge device that is called armbr0 from Fast Models TAP devices to the physical network.
  4. Create the TAP devices.
    TAP devices need permission for specific users, so create one for each user who is to run the model with the virtual ethernet device. For example, to create a TAP device that is called ARMfmuser for the user fmuser, add the following lines to the armbr0 section of /etc/network/interfaces.
    pre-up ip tuntap add dev ARMfmuser mode tap user fmuser
    pre-up ifconfig ARMfmuser 0.0.0.0 promisc
    post-down ip tuntap del dev ARMfmuser mode tap
    This step creates a TAP device for each user.
  5. Create a bridge between the TAP devices and the network interface eth0 by adding a bridge_ports line to the armbr0 section of /etc/network/interfaces. For example, for a TAP device that is named ARMfmuser, add the following line:
    bridge_ports eth0 ARMfmuser
  6. The added /etc/network/interfaces code now looks like the following:
    auto armbr0
    iface armbr0 inet dhcp
    pre-up ifconfig eth0 0.0.0.0 promisc
    post-down ifconfig eth0 0.0.0.0 -promisc
    pre-up ip tuntap add dev ARMfmuser mode tap user fmuser
    pre-up ifconfig ARMfmuser 0.0.0.0 promisc
    post-down ip tuntap del dev ARMfmuser mode tap
    bridge_ports eth0 ARMfmuser
  7. Restart network services with one of the following options:
    • Run the following commands:
      sudo ifdown eth0 && sudo ifup eth0
      sudo ifup armbr0
      sudo service network-manager restart

      Note

      armbr0 must be explicitly started.
    • Restart the computer.
    Both choices disconnect and reconnect all network interfaces.

Configuring the networking environment for Linux

This section describes how to set the parameters to make a network connection.

Note

Firewall software might block network traffic in the network bridge, and result in a networking failure. If the model does not work after configuration, check the firewall settings.

Prerequisites

Use System Canvas or a related Fast Models tool to load a project or model, and then select a component.

Procedure

  1. Set the parameters on the HostBridge and SMSC_91C111 components.
    hostbridge.interfaceName=ARM<username>
    smsc_91c111.enabled=1

    ARM<username> is an adapter that is built into the network bridge.

Solutions to networking issues on Linux

This section describes how to solve networking issues.

The model networking works after initial setup, but stops working after reboot
Set the correct access permissions for the /dev/net/tun device, by executing chmod 666 /dev/net/tun as root. To preserve the change across reboots, modify the udev rules of the TAP device: open /etc/udev/rules.d/50-udev.rules as root, and find the line:
KERNEL=="tun", NAME="net/%k"
If it does not have MODE="0666" at the end of the line, append MODE="0666":
KERNEL=="tun", NAME="net/%k", MODE="0666"
Model networking installs correctly, but when a model starts up, the model cannot receive packets
Disable the firewall on the host machine, or add the TAP device to trusted devices.

Note

Refer to the vendor documentation manual.

Disabling and re-enabling networking for Linux

This section describes how to disable and re-enable networking with an init script.

Warning

These operations remove/restore TAP devices and the network bridge. There is a temporary loss of network connectivity and your IP address might change.
  • To disable networking without uninstalling it, invoke the installed init script (by default, /etc/init.d/FMNetwork) as root with the parameter stop.
    sudo /etc/init.d/FMNetwork stop
  • To re-enable networking, invoke the init script as root with the parameter start.
    sudo /etc/init.d/FMNetwork start

Uninstalling networking for Linux

This section describes the steps to uninstall a network.

Procedure

  1. In a shell, change to the /FastModelsPortfolio_X.Y/ModelNetworking directory.
  2. Run uninstall.sh as root, passing the location of the init script (FMNetwork):
    sudo ./uninstall.sh /etc/init.d/FMNetwork

    You must run this script from the directory in which it is installed, because it does not work correctly if run from any other location.

    Warning

    There is a temporary loss of network connectivity and your IP address might change.

Postrequisites

The uninstall script removes everything that can be safely removed. It does not remove:

  • symlinks to the init script.
  • /sbin/brctl.

You must remove any symlinks that you have created. Removing brctl is optional.

Was this page helpful? Yes No