在OpenStack

时间:2018-01-24 10:43:10

标签: networking openstack ethernet tunnel openvpn

我试图为OpenStack中的VM中的L2隧道设置OpenVPN服务器。为此,我有一个具有以下网络接口的VM:

- ens3 -> 192.168.1.1/24 -> Management network for SSH
- ens8 -> 10.1.1.1/24 -> Bridged network for VPN

我使用brctl创建了一个桥接器,并使用命令ip tuntap add mode tap tap0创建了一个tap接口,并使用ens8桥接这些桥接器。结果如下:

$ brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.322e8b731919       yes             ens8
                                                    tap0

还在10.1.1.1/24网络中为网桥分配了一个IP

$ ifconfig
br0   Link encap:Ethernet  HWaddr 32:2e:8b:73:19:19
      inet addr:10.1.1.5  Bcast:10.1.1.255  Mask:255.255.255.0
      inet6 addr: fe80::f816:3eff:fe3b:f580/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1454  Metric:1
      RX packets:813 errors:0 dropped:0 overruns:0 frame:0
      TX packets:1833 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:51891 (51.8 KB)  TX bytes:147062 (147.0 KB)

ens3  Link encap:Ethernet  HWaddr fa:16:3e:20:47:bf
      inet addr:192.168.45.9  Bcast:192.168.45.255  Mask:255.255.255.0
      inet6 addr: fe80::f816:3eff:fe20:47bf/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1454  Metric:1
      RX packets:3099003 errors:0 dropped:0 overruns:0 frame:0
      TX packets:3086646 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:272510540 (272.5 MB)  TX bytes:250832632 (250.8 MB)

ens8  Link encap:Ethernet  HWaddr fa:16:3e:3b:f5:80
      inet6 addr: fe80::f816:3eff:fe3b:f580/64 Scope:Link
      UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1454  Metric:1
      RX packets:3276694 errors:0 dropped:0 overruns:0 frame:0
      TX packets:3020598 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:255802571 (255.8 MB)  TX bytes:245085174 (245.0 MB)

lo    Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:180 errors:0 dropped:0 overruns:0 frame:0
      TX packets:180 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1
      RX bytes:13920 (13.9 KB)  TX bytes:13920 (13.9 KB)

tap0  Link encap:Ethernet  HWaddr 32:2e:8b:73:19:19
      UP BROADCAST PROMISC MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

但是我无法从网桥ping 10.1.1.1/24网络中的任何其他计算机。这在ens8界面的早期工作。我的想法是首先设置桥接tap接口并在此上运行OpenVPN服务器。但是,如果没有与外界的联系,我甚至不确定它是否会起作用。像以太网桥这样的L2设备是否可以在OpenStack VM中运行?在这里设置L2隧道的最佳方法是什么?

1 个答案:

答案 0 :(得分:0)

修复是为桥和物理接口使用相同的MAC地址。出于某种原因,OpenStack基于MAC过滤数据包。要更改MAC,请使用以下命令。

try this   
 return response()->stream(function() use ($zip){
                $zip->finish()->with('message','Your zip download has started');
            });


    view file add this
     @if(Session::has('message'))
                <div class="alert alert-success">{{Session::get('message')}}</div>
            @endif