ON THIS PAGE
Example: Configuring Virtual Channels
This example shows how to create virtual channels between a headquarters and its branch office.
Requirements
Before you begin, ensure that your headquarters and branch office have a network connection where the expected aggregate bandwidth is higher for your headquarters than for your branch office. The devices at your headquarters will then be set up to limit the traffic sent to the branch office to avoid oversubscribing the link.
Overview
In this example, you create the virtual channels as branch1–vc, branch2–vc, branch3–vc, and default-vc. You then define the virtual channel group as wan-vc-group to include the four virtual channels and assign the scheduler map as bestscheduler to each virtual channel. Three of the virtual channels are shaped to 1.5 Mbps. The fourth virtual channel is default-vc, and it is not shaped so it can use the full interface bandwidth.
Then you apply them in the firewall filter as choose-vc to the device's interface t3-1/0/0. The output filter on the interface sends all traffic with a destination address matching 192.168.10.0/24 to branch1-vc, and similar configurations are set for branch2-vc and branch3-vc. Traffic not matching any of the addresses goes to the default, unshaped virtual channel.
Configuration
Procedure
CLI Quick Configuration
To quickly configure this example, copy the
following commands, paste them into a text file, remove any line breaks,
change any details necessary to match your network configuration,
copy and paste the commands into the CLI at the [edit]
hierarchy
level, and then enter commit
from the configuration mode.
set class-of-service virtual-channels branch1-vc set class-of-service virtual-channels branch2-vc set class-of-service virtual-channels branch3-vc set class-of-service virtual-channels default-vc set class-of-service virtual-channel-groups wan-vc-group branch1-vc scheduler-map bestscheduler set class-of-service virtual-channel-groups wan-vc-group branch2-vc scheduler-map bestscheduler set class-of-service virtual-channel-groups wan-vc-group branch3-vc scheduler-map bestscheduler set class-of-service virtual-channel-groups wan-vc-group default-vc scheduler-map bestscheduler set class-of-service virtual-channel-groups wan-vc-group default-vc default set class-of-service virtual-channel-groups wan-vc-group branch1-vc shaping-rate 1500000 set class-of-service virtual-channel-groups wan-vc-group branch2-vc shaping-rate 1500000 set class-of-service virtual-channel-groups wan-vc-group branch3-vc shaping-rate 1500000 set class-of-service interfaces t3-1/0/0 unit 0 virtual-channel-group wan-vc-group set firewall family inet filter choose-vc term branch1 from destination-address 192.168.10.0/24 set firewall family inet filter choose-vc term branch1 then virtual-channel branch1-vc set firewall family inet filter choose-vc term branch1 then accept set firewall family inet filter choose-vc term branch2 from destination-address 192.168.20.0/24 set firewall family inet filter choose-vc term branch2 then virtual-channel branch2-vc set firewall family inet filter choose-vc term branch2 then accept set firewall family inet filter choose-vc term branch3 from destination-address 192.168.30.0/24 set firewall family inet filter choose-vc term branch3 then virtual-channel branch3-vc set firewall family inet filter choose-vc term branch3 then accept set firewall family inet filter choose-vc term default then virtual-channel default-vc set firewall family inet filter choose-vc term default then accept set interfaces t3-1/0/0 unit 0 family inet filter output choose-vc
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.
To configure virtual channels:
Define the virtual channels and the default virtual channel.
[edit] user@host# edit class-of-service user@host# set virtual-channels branch1-vc user@host# set virtual-channels branch2-vc user@host# set virtual-channels branch3-vc user@host# set virtual-channels default-vc
Define the virtual channel group and assign each virtual channel a scheduler map.
[edit class-of-service] user@host# set virtual-channel-groups wan-vc-group branch1-vc scheduler-map bestscheduler user@host# set virtual-channel-groups wan-vc-group branch2-vc scheduler-map bestscheduler user@host# set virtual-channel-groups wan-vc-group branch3-vc scheduler-map bestscheduler user@host# set virtual-channel-groups wan-vc-group default-vc scheduler-map bestscheduler user@host# set virtual-channel-groups wan-vc-group default-vc default
Specify a shaping rate.
[edit class-of-service] user@host# set virtual-channel-groups wan-vc-group branch1-vc shaping-rate 1.5m user@host# set virtual-channel-groups wan-vc-group branch2-vc shaping-rate 1.5m user@host# set virtual-channel-groups wan-vc-group branch3-vc shaping-rate 1.5m
Apply the virtual channel group to the logical interface.
[edit class-of-service] user@host# set interfaces t3–1/0/0 unit 0 virtual-channel-group wan-vc-group
Create the firewall filter to select the traffic.
[edit firewall] user@host# set firewall family inet filter choose-vc term branch1 from destination-address 192.168.10.0/24 user@host# set firewall family inet filter choose-vc term branch1 then virtual-channel branch1-vc user@host# set firewall family inet filter choose-vc term branch1 then accept user@host# set firewall family inet filter choose-vc term branch2 from destination-address 192.168.20.0/24 user@host# set firewall family inet filter choose-vc term branch2 then virtual-channel branch2-vc user@host# set firewall family inet filter choose-vc term branch2 then accept user@host# set firewall family inet filter choose-vc term branch3 from destination-address 192.168.30.0/24 user@host# set firewall family inet filter choose-vc term branch3 then virtual-channel branch3-vc user@host# set firewall family inet filter choose-vc term branch3 then accept user@host# set firewall family inet filter choose-vc term default then virtual-channel default-vc user@host# set firewall family inet filter choose-vc term default then accept
Apply the firewall filter to output traffic.
[edit interfaces] user@host# set t3–1/0/0 unit 0 family inet filter output choose-vc
Results
From configuration mode, confirm your configuration
by entering the show class-of-service
, show firewall
, and show interfaces t3-1/0/0
commands. If the output
does not display the intended configuration, repeat the configuration
instructions in this example to correct it.
user@host#show class-of-service
virtual-channels { branch1-vc; branch2-vc; branch3-vc; default-vc; } virtual-channel-groups { wan-vc-group { branch1-vc { scheduler-map bestscheduler; shaping-rate 1500000; } branch2-vc { scheduler-map bestscheduler; shaping-rate 1500000; } branch3-vc { scheduler-map bestscheduler; shaping-rate 1500000; } default-vc { scheduler-map bestscheduler; default; } } } interfaces { t3-1/0/0 { unit 0 { virtual-channel-group wan-vc-group; } } } [edit] user@host#show firewall
family inet { filter choose-vc { term branch1 { from { destination-address { 192.168.10.0/24; } } then { virtual-channel branch1-vc; accept; } } term branch2 { from { destination-address { 192.168.20.0/24; } } then { virtual-channel branch2-vc; accept; } } term branch3 { from { destination-address { 192.168.30.0/24; } } then { virtual-channel branch1-vc; accept; } } term branch2 { from { destination-address { 192.168.20.0/24; } } then { virtual-channel branch2-vc; accept; } } term branch3 { from { destination-address { 192.168.30.0/24; } } then { virtual-channel branch3-vc; accept; } } term default { then { virtual-channel default-vc; accept; } } } } [edit] user@host#show interfaces t3-1/0/0
unit 0 { family inet { filter { output choose-vc; } } }
If you are done configuring the device, enter commit
from configuration mode.