0x00 环境
软件:vmware workstation pro 15, ubuntu 14.04.6 LTS,quagga-rtrlib,rtrlib
0x01 准备
1、安装网络工具(ubuntu14.04已预装)
$ sudo apt install net-tools
2、添加虚拟网卡
在虚拟机设置硬件一栏中增加一个网络适配器,并把两个网络适配器均更改为“桥接模式(自动)”。
3、启用ip转发
切换至root模式,修改/etc/sysctl.conf中的内容:将net.ipv4.ip_forward=1前的#去掉,并执行sysctl -p,出现net.ipv4.ip_forward = 1即为成功。
4、克隆虚拟机
克隆得到两个虚拟机,分别命名为router0、router1。
0x02 配置
1、ip设置
router0:在root模式下,将/etc/network/interfaces文件修改为:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.200
netmask 255.255.255.0
gateway 192.168.1.254
auto eth1
iface eth1 inet static
address 192.168.200.254
netmask 255.255.255.0
gate