zephyr/samples/net/vlan
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
..
src
CMakeLists.txt cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts 2018-08-15 04:06:50 -07:00
Kconfig Kconfig: Include Kconfig.zephyr last in sample Kconfig files 2018-08-10 12:38:28 -07:00
README.rst
prj.conf net: config: Rename Kconfig options to correspond to library name 2018-08-13 18:42:31 -07:00
sample.yaml
vlan-setup-linux.sh

README.rst

.. _vlan-sample:

Virtual LAN Sample Application
##############################

Overview
********

The VLAN sample application for Zephyr will setup two virtual LAN networks.
The application sample enables net-shell and allows users to view VLAN settings.

The source code for this sample application can be found at:
:file:`samples/net/vlan`.

Requirements
************

- :ref:`networking_with_qemu`

Building and Running
********************

A good way to run this VLAN application is with QEMU as described in
:ref:`networking_with_qemu`.
Currently only one VLAN network (tag) is supported when Zephyr is run inside
QEMU. If you're using a FRDM-K64F board, then multiple VLAN networks can be
configured. Note that VLAN is only supported for boards that have an ethernet
port or that support USB networking.

Follow these steps to build the VLAN sample application:

.. zephyr-app-commands::
   :zephyr-app: samples/net/vlan
   :board: <board to use>
   :conf: prj.conf
   :goals: build
   :compact:

The default configuration file prj.conf creates two virtual LAN networks
with these settings:

- VLAN tag 100: IPv4 198.51.100.1 and IPv6 2001:db8:100::1
- VLAN tag 200: IPv4 203.0.113.1 and IPv6 2001:db8:200::1

Setting up Linux Host
=====================

The :file:`samples/net/vlan/vlan-setup-linux.sh` provides a script that can be
executed on the Linux host. It creates two VLANs on the Linux host and creates
routes to Zephyr.

If everything is configured correctly, you will be able to successfully execute
the following commands on the Linux host.

.. code-block:: console

    ping -c 1 2001:db8:100::1
    ping -c 1 198.51.100.1
    ping -c 1 2001:db8:200::1
    ping -c 1 203.0.113.1