本文中我们来演示一下在新的6wind测试路由器和现有的一台RouterOS之间打一个隧道,然后做一个简单的BGP配置。
6wind一侧:
- 公网IP:1.1.1.1
- 隧道内IP:192.0.2.1/30和2001:db8::2/127
RouterOS一侧:
- 公网IP:2.2.2.2
- 隧道内IP:192.0.2.2/30和2001:db8::3/127
GRE隧道
6wind一侧,配置和iproute2非常类似,没有什么好说的。没有用过Linux上GRE的朋友们别忘了ttl 255
,不然一会儿配BGP的时候就得multihop了。
1 2 3 4 5 6 7 8 9 10 11 |
james-test-router0> edit running james-test-router0 running config# vrf main james-test-router0 running vrf main# interface gre tunnel1 james-test-router0 running gre tunnel1#! local 103.121.209.165 remote 45.77.27.154 james-test-router0 running gre tunnel1# ttl 255 james-test-router0 running gre tunnel1# ipv4 address 192.0.2.1/30 james-test-router0 running gre tunnel1# ipv6 address 2001:db8::2/127 james-test-router0 running gre tunnel1# commit Configuration committed. james-test-router0 running gre tunnel1# commit Configuration committed. |
RouterOS一侧, 也没有什么好说的。
1 2 3 4 5 6 |
/interface gre add !keepalive local-address=45.77.27.154 name=6wind-test remote-address=103.121.209.165 /ip address add address=192.0.2.2/30 interface=6wind-test network=192.0.2.0 /ipv6 address add address=2001:db8::3/127 advertise=no interface=6wind-test |
配置完成后ping一下看看隧道通不通。
1 2 3 4 5 6 7 8 9 10 |
james-test-router0> cmd ping 2001:db8::3 PING 2001:db8::3(2001:db8::3) 56 data bytes 64 bytes from 2001:db8::3: icmp_seq=1 ttl=64 time=3.64 ms 64 bytes from 2001:db8::3: icmp_seq=2 ttl=64 time=3.10 ms 64 bytes from 2001:db8::3: icmp_seq=3 ttl=64 time=3.33 ms 64 bytes from 2001:db8::3: icmp_seq=4 ttl=64 time=3.50 ms ^C --- 2001:db8::3 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 3.103/3.396/3.644/0.209 ms |
BGP配置
6wind一侧
1 2 3 4 5 6 7 8 9 10 11 12 |
james-test-router0> edit running james-test-router0 running config# vrf main routing bgp james-test-router0 running bgp#! router-id 103.121.209.165 james-test-router0 running bgp#! as 65500 james-test-router0 running bgp# neighbor 192.0.2.2 james-test-router0 running neighbor 192.0.2.2#! remote-as 205610 james-test-router0 running neighbor 192.0.2.2# .. james-test-router0 running bgp# neighbor 2001:db8::3 james-test-router0 running neighbor 2001:db8::3#! remote-as 205610 james-test-router0 running neighbor 2001:db8::3# address-family ipv6-unicast james-test-router0 running neighbor 2001:db8::3# commit Configuration committed. |
RouterOS一侧
1 2 3 |
/routing bgp peer add keepalive-time=10s name=6wind-test-v4 remote-address=192.0.2.1 remote-as=65500 ttl=default update-source=6wind-test add address-families=ipv6 keepalive-time=10s name=6wind-test-v6 remote-address=2001:db8::2 remote-as=65500 ttl=default update-source=6wind-test |
需要注意的是,6wind的BGP配置风格更像Cisco,因为其路由daemon是FRRouting。内存足够的前提下,收个全表肯定不是什么问题。内存压力:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
root@james-test-router0:~# ip route | wc -l 3 root@james-test-router0:~# ip -6 route | wc -l 5 root@james-test-router0:~# free -wh total used free shared buffers cache available Mem: 7.8G 550M 6.5G 82M 218M 564M 6.9G Swap: 0B 0B 0B # IPv6 full table root@james-test-router0:~# ip route | wc -l 28 root@james-test-router0:~# ip -6 route | wc -l 62028 root@james-test-router0:~# free -wh total used free shared buffers cache available Mem: 7.8G 551M 6.5G 82M 218M 601M 6.9G Swap: 0B 0B 0B |