How to configure VyOS to create a switch
Table of Contents
BIOS configuration....................................................................................................................................2
CPU.......................................................................................................................................................2
PCIe configuration................................................................................................................................2
Installation..................................................................................................................................................2
Boot VyOS install..................................................................................................................................2
Getting started...................................................................................................................................3
After boot.....................................................................................................................................3
Commands...................................................................................................................................3
Example how to assign an IP to an interface and enable ssh................................................................3
How to order the interfaces...................................................................................................................4
Changing/assigning interfaces names to a mac.....................................................................................5
Changing configuration..............................................................................................................................6
Show running config.............................................................................................................................6
Changing host name..............................................................................................................................6
Changing gateway.................................................................................................................................6
Changing DNS......................................................................................................................................6
Changing time zone...............................................................................................................................6
Checking with compare.........................................................................................................................6
Commit and Save..................................................................................................................................7
The bridge................................................................................................................................................10
Creating the bridge..............................................................................................................................10
Assign interfaces to the bridge............................................................................................................10
Add description to interface................................................................................................................11
Setting MTU on 10gb interfaces.........................................................................................................11
Compare/review/commit/save.............................................................................................................11
1
How to configure VyOS to create a switch
BIOS configuration
CPU
- Enable Direct Cache Access (DCA)
- Under chipset/North bridge check for IOAT and VT-d setting
– IOAT enable
Try No Snoop and Relaxed Ordering if present
- VT-d enable VT-d
enable Interrupt remapping
PCIe configuration
- Set Above 4G Decoding Enable
- Set Maximun Payload Set to max available
- Set Maximun Read Request Set to max available
Installation
Boot VyOS install
• user = vyos
• pass = vyos
(*) System boots in Operational Mode
2
How to configure VyOS to create a switch
Getting started
After boot
• Run install image
• When finished, remove CD and type reboot
(*) For Help Type ?
Commands
• view interfaces: show interfaces
• Blink interface LED: show interfaces ethernet <interface> identify
• Enter Configuration Mode: configure
• Set IP address: set interfaces ethernet <interface> address <x.x.x.x/yy>
• Set interface description: set interfaces ethernet <interface> description ‘name’
• Allow ssh on interface: set service ssh listen-address <x.x.x.x>
• Show commands in buffer for
execution: compare
• Save changes in buffer:
commit
save
Example how to assign an IP to an interface and enable ssh
configure
show interfaces
show interfaces ethernet eth0 identify
set interfaces ethernet eth0 address 10.10.10.245/24
set interfaces ethernet eth0 description ‘management’
set service ssh listen-address 10.10.10.245
commit
save
– ssh is set on interface eth1
3
How to configure VyOS to create a switch
How to order the interfaces
• List interfaces with ifconfig: sudo ifconfig
• List sorting by MAC: sudo ifconfig | grep -i hwaddr | sort -u -k5
i.e.:
vyos@vyos:~$ sudo ifconfig | grep -i hwaddr | sort -u -k5
eth2 Link encap:Ethernet HWaddr 00:15:17:d2:d8:e0
eth1 Link encap:Ethernet HWaddr 00:15:17:d2:d8:e1
eth4 Link encap:Ethernet HWaddr 00:15:17:d2:d8:e2
eth3 Link encap:Ethernet HWaddr 00:15:17:d2:d8:e3
eth0 Link encap:Ethernet HWaddr 94:de:80:ba:35:60
Interfaces are out of order by mac address. Eth0 should be (your choice) 00:15:17:d2:d8:e0
Config is kept on /config/config.boot. Good practice to save it before major changes.
i.e.:
vyos@vyos:~$ cd /config/
vyos@vyos:/config$ cp config.boot config.boot-old
4
How to configure VyOS to create a switch
Changing/assigning interfaces names to a mac
Enter configure mode configure
Assign interface to mac set interfaces eth <interface> <mac>
Commit changes commit
Save save
i.e.:
vyos@vyos# set interfaces eth eth0 hw-id 00:15:17:d2:d8:e0
Compare will show changes waiting to be committed:
vyos@vyos# compare
[edit interfaces ethernet eth0]
>hw-id 00:15:17:d2:d8:e0
[edit interfaces ethernet eth2]
>hw-id 00:15:17:d2:d8:e2
[edit interfaces ethernet eth4]
>hw-id 94:de:80:ba:35:60
[edit]
After the changes you might need to reassign the management interface IP address.
• Enter configure mode: configure
• Delete old interface IP: delete interfaces ethernet <interface> address x.x.x.x/yy
• Delete old interface name: delete interfaces ethernet <interface> description <name>
• Set IP to new interface: set interfaces ethernet <interface> address <x.x.x.x/yy>
• Set name to new interface: set interfaces ethernet <interface> description ‘name’
5
How to configure VyOS to create a switch
Changing configuration
Show running config
vyos@vyos:~$ configure
[edit]
vyos@vyos# show system
Changing host name
vyos@vyos# set system host-name melloswitch
Changing gateway
vyos@vyos# set system gateway-address 10.10.10.1
Changing DNS
vyos@vyos# set system name-server 10.10.10.1
Changing time zone
vyos@vyos# set system time-zone US/Eastern
Checking with compare
vyos@vyos# compare
[edit system]
+gateway-address 10.10.10.1
>host-name melloswitch
+name-server 10.10.10.1
>time-zone America/New_York
[edit]
vyos@vyos# set system time-zone US/Ea
US/East-Indiana US/Eastern
6
How to configure VyOS to create a switch
[edit]
vyos@vyos# set system time-zone US/Eastern
[edit]
vyos@vyos# compare
[edit system]
+gateway-address 10.10.10.1
>host-name melloswitch
+name-server 10.10.10.1
>time-zone US/Eastern
[edit]
Commit and Save
vyos@vyos# commit
[ system host-name melloswitch ]
Stopping enhanced syslogd: rsyslogd.
Starting enhanced syslogd: rsyslogd.
[ system time-zone US/Eastern ]
Stopping enhanced syslogd: rsyslogd.
Starting enhanced syslogd: rsyslogd.
[edit]
vyos@vyos# save
Saving configuration to '/config/config.boot'...
Done
[edit]
7
How to configure VyOS to create a switch
Verifying configuration
vyos@vyos# ping yahoo.com
PING yahoo.com (98.138.219.231) 56(84) bytes of data.
64 bytes from media-router-fp1.prod1.media.vip.ne1.yahoo.com (98.138.219.231): icmp_req=1 ttl=47
time=50.7 ms
vyos@vyos# ntpq -p
remote refid st t when poll reach delay offset jitter
=========================================================================
=====
+ord1.m-d.net 142.66.101.13 2u 3 64 1 40.592 2.306 2.130
+nms.switch.ca 206.108.0.134 2u - 64 3 89.506 3.708 8.144
*europa.ellipse. 204.9.54.119 2 u 31 64 1 56.702 1.555 0.116
Note:
Tried setting time zone using Americas/New_York. System didn’t show any errors.
vyos@vyos# set system time-zone America/New_York
[edit]
vyos@vyos# commit
[ system time-zone America/New_York ]
Stopping enhanced syslogd: rsyslogd.
Starting enhanced syslogd: rsyslogd.
[edit]
vyos@vyos# save
Saving configuration to '/config/config.boot'...
Done
[edit]
vyos@vyos# ntpq -p
8
How to configure VyOS to create a switch
remote refid st t when poll reach delay offset jitter
=========================================================================
=====
+ord1.m-d.net 142.66.101.13 2u 9 64 3 40.261 3.259 2.833
+nms.switch.ca 206.108.0.134 2u 4 64 7 89.208 5.387 9.108
*europa.ellipse. 204.9.54.119 2 u 41 64 3 56.755 2.818 1.353
9
How to configure VyOS to create a switch
The bridge
Note: Work from console as management IP will be removed (notice new switch name)
Creating the bridge
vyos@melloswitch:~$ configure
vyos@melloswitch# delete interfaces eth eth4 address
vyos@melloswitch# delete interfaces eth eth4 description
vyos@melloswitch:~$ compare
vyos@melloswitch:~$ commit
vyos@melloswitch:~$ save
vyos@melloswitch# set interfaces bridge br0
vyos@melloswitch# set interfaces bridge br0 address 10.10.10.245/24
vyos@melloswitch# set interfaces bridge br0 description 'bridge 1'
vyos@melloswitch# compare
vyos@melloswitch# commit
vyos@melloswitch# save
vyos@melloswitch# exit
vyos@melloswitch# show interfaces
Verify br0 was created and has an IP address
Assign interfaces to the bridge
vyos@melloswitch# configure
vyos@melloswitch# set interfaces ethernet eth1 bridge-group bridge br0
10
How to configure VyOS to create a switch
Add description to interface
vyos@melloswitch# set interfaces eth eth1 description 'br0 1gb member'
vyos@melloswitch# set interfaces eth eth2 description 'br0 10gb member'
Setting MTU on 10gb interfaces
vyos@melloswitch# set interfaces eth eth2 mtu 9000
Compare/review/commit/save
vyos@melloswitch# compare
vyos@melloswitch# commit
vyos@melloswitch# save
11