Part 1
요약·해설
두 tag의 네 address, host interface와 route, packet tag mapping을 보존합니다.
100 · 200
IPv4 · IPv6
vlan.100 · vlan.200
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
32B4E8A75A2D86106AA238F4DD2E911C6A6D0364B23542C8D33BEB7AC4B730DE
.. zephyr:code-sample:: vlan
:name: Virtual LAN
:relevant-api: vlan_api net_l2 net_if
Setup two virtual LAN networks and use net-shell to view the networks' settings.
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:
:zephyr_file:`samples/net/vlan`.
Requirements
************
- :ref:`networking_with_host`
Building and Running
********************
A good way to run this VLAN application is with QEMU as described in
:ref:`networking_with_eth_qemu`. You can use :file:`zeth-vlan.conf` configuration
file when running :file:`net-setup.sh` script in Linux like this:
.. code-block:: console
./net-setup.sh -c zeth-vlan.conf
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 :zephyr_file:`samples/net/vlan/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 :zephyr_file:`samples/net/vlan/vlan-setup-linux.sh` provides a script that
can be executed on the Linux host. It creates two VLAN interfaces ``vlan.100``
and ``vlan.200`` 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
The network packets to ``2001:db8:100::1`` or ``198.51.100.1`` will have VLAN
tag 100 set to them. The vlan tag 200 will be set to network packets to
``2001:db8:200::1`` or ``203.0.113.1``.
Part 3
한국어 전문 번역
개요
Zephyr의 VLAN sample application은 virtual LAN network 두 개를 설정합니다. Sample은 net-shell을 활성화하여 사용자가 VLAN 설정을 볼 수 있게 합니다.
이 sample application의 source code는 samples/net/vlan에서 찾을 수 있습니다.
요구 사항
빌드 및 실행
이 VLAN application은 Networking with QEMU Ethernet에서 설명하는 방식으로 QEMU에서 실행하는 것이 좋습니다. Linux에서 net-setup.sh script를 실행할 때 zeth-vlan.conf configuration file을 사용할 수 있습니다.
./net-setup.sh -c zeth-vlan.conf
VLAN은 Ethernet port가 있거나 USB networking을 지원하는 board에서만 지원됩니다.
VLAN sample application은 다음과 같이 build합니다.
west build -b <board to use> samples/net/vlan -- -DCONF_FILE=prj.conf
Default configuration file samples/net/vlan/prj.conf는 다음 설정으로 virtual LAN network 두 개를 만듭니다.
- VLAN tag
100: IPv4198.51.100.1, IPv62001:db8:100::1 - VLAN tag
200: IPv4203.0.113.1, IPv62001:db8:200::1
Linux Host 설정
samples/net/vlan/vlan-setup-linux.sh는 Linux host에서 실행할 수 있는 script입니다. 이 script는 Linux host에 vlan.100과 vlan.200 VLAN interface 두 개를 만들고 Zephyr로 가는 route를 생성합니다.
모든 설정이 올바르면 Linux host에서 다음 명령을 성공적으로 실행할 수 있습니다.
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
2001:db8:100::1 또는 198.51.100.1로 가는 network packet에는 VLAN tag 100이 설정됩니다. 2001:db8:200::1 또는 203.0.113.1로 가는 packet에는 VLAN tag 200이 설정됩니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.