赞
踩
备注:本文中所有的配置均符合NSX-T管理与配置系列博文中T0网关的设置。
默认选项,按回车 Enter
进入系统加载界面。
用户名和密码均为:vyos
在 CLI 中输入 install image
具体填写信息,参考如下图所示:
①: yes
②: 直接按 Enter 回车。
③: 直接按 Enter 回车。
④: yes
⑤: 直接按 Enter 回车。
⑥: 直接按 Enter 回车。
⑦: 自定义vyos密码。
⑧: 确认yvos密码。
⑨: 直接按 Enter 回车。
vyos@vyos:~$ install image Welcome to the VyOS install program. This script will walk you through the process of installing the VyOS image to a local hard drive. Would you like to continue? (Yes/No) [Yes]: Yes Probing drives: OK Looking for pre-existing RAID groups...none found. The VyOS image will require a minimum 2000MB root. Would you like me to try to partition a drive automatically or would you rather partition it manually with parted? If you have already setup your partitions, you may skip this step Partition (Auto/Parted/Skip) [Auto]: I found the following drives on your system: sda 4294MB Install the image on? [sda]: This will destroy all data on /dev/sda. Continue? (Yes/No) [No]: Yes How big of a root partition should I create? (2000MB - 4294MB) [4294]MB: Creating filesystem on /dev/sda1: OK Done! Mounting /dev/sda1... What would you like to name this image? [1.2.0-rolling+201809210337]: OK. This image will be named: 1.2.0-rolling+201809210337 Copying squashfs image... Copying kernel and initrd images... Done! I found the following configuration files: /opt/vyatta/etc/config.boot.default Which one should I copy to sda? [/opt/vyatta/etc/config.boot.default]: Copying /opt/vyatta/etc/config.boot.default to sda. Enter password for administrator account Enter password for user 'vyos': Retype password for user 'vyos': I need to install the GRUB boot loader. I found the following drives on your system: sda 4294MB Which drive should GRUB modify the boot partition on? [sda]: Setting up grub: OK Done!
重启后VyOS系统已经安装和初始化完成。
VyOS系统类似于Cisco的路由操作系统,但又不完全相同。
IP地址拓扑:
网络接口 | IP地址 |
---|---|
eth0 | 192.168.1.10/24 |
eth1 | 1.1.1.1/24 |
eth2 | 2.2.2.1/24 |
vyos@vyos:~$ configure [edit] vyos@vyos# set interface ethernet eth0 address 192.168.1.10/24 [edit] vyos@vyos# commit [edit] vyos@vyos# set interface ethernet eth0 address 1.1.1.1/24 [edit] vyos@vyos# commit [edit] vyos@vyos# set interfaces ethernet eth2 address 2.2.2.1/24 [edit] vyos@vyos# commit [edit] vyos@vyos# save Saving configuration to '/config/config.boot'... Done
vyos@vyos# set service ssh port '22'
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# save
Saving configuration to '/config/config.boot'...
Done
现象:vyos的eth0网卡存在多个IP地址,需要将多余或错误配置的IP删除
vyos@vyos# delete interfaces ethernet eth0 address [按Tab] Possible completions: 192.168.1.10/24 192.168.1.11/24 192.168.10.60/24 [edit] vyos@vyos# delete interfaces ethernet eth0 address 192.168.1.11/24 [edit] vyos@vyos# delete interfaces ethernet eth0 address 192.168.10.60/24 [edit] vyos@vyos# commit [edit] vyos@vyos# save Saving configuration to '/config/config.boot'... Done [edit] vyos@vyos#
验证
vyos@vyos# set protocols static route 0.0.0.0/0 next-hop 192.168.1.21
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# save
Saving configuration to '/config/config.boot'...
Done
[edit]
vyos@vyos# show protocols static
vyos@vyos# set protocols ospf area 0 network 1.1.1.1/32
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# save
Saving configuration to '/config/config.boot'...
Done
[edit]
vyos@vyos# show protocols ospf
show ip ospf neighbor
vyos@vyos# edit protocols ospf [edit protocols ospf] vyos@vyos# set redistribute connected [edit protocols ospf] vyos@vyos# show area 0 { network 1.1.1.1/32 } +redistribute { + connected { + } +} [edit protocols ospf] vyos@vyos# commit [edit protocols ospf] vyos@vyos# save Saving configuration to '/config/config.boot'... Done [edit] vyos@vyos#
vyos@vyos# edit protocols ospf [edit protocols ospf] vyos@vyos# set default-information originate always [edit protocols ospf] [edit protocols] vyos@vyos# show ospf { area 0 { network 1.1.1.1/32 } default-information { originate { always } } redistribute { connected { } static { } } } static { route 0.0.0.0/0 { next-hop 192.168.1.21 { } } } [edit protocols] vyos@vyos# commit [edit protocols ospf] vyos@vyos# save Saving configuration to '/config/config.boot'... Done [edit] vyos@vyos#
set protocols bgp system-as 200
set protocols bgp neighbor 2.2.2.2 address-family ipv4-unicast
set protocols bgp neighbor 2.2.2.2 remote-as 100
vyos@vyos# commit
[edit]
vyos@vyos# save
Saving configuration to '/config/config.boot'...
Done
[edit]
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。