目录

多网卡的情况下,如何配置?

例子:

如果eth0是外部网卡地址, eth1是内部网卡地址。

{项目资产库}/res/server/kbengine.xml中修改或新增如下内容:

<root>
    ...
    <!-- 会有对外情况的服务器,内部interface设置内部网卡、外部interface设置外部网卡 -->
    <baseapp>
        <internalInterface> eth1 </internalInterface>
        <externalInterface> eth0 </externalInterface>	
    </baseapp>
    ...
    <loginapp>
        <internalInterface> eth1 </internalInterface>
        <externalInterface> eth0 </externalInterface>	
    </loginapp>
    ...
    <interfaces>
        <internalInterface> eth1 </internalInterface>
        <externalInterface> eth0 </externalInterface>	
    </interfaces>
    ...
    <!-- 内部服务器需要把内部和外部internalInterface都设置成内部网卡eth1 -->
    <cellapp>
        <internalInterface> eth1 </internalInterface>
        <externalInterface> eth1 </externalInterface>
    </cellapp>
    <dbmgr>
        <internalInterface> eth1 </internalInterface>
        <externalInterface> eth1 </externalInterface>
    </dbmgr>
    <cellappmgr>
        <internalInterface> eth1 </internalInterface>
        <externalInterface> eth1 </externalInterface>
    </cellappmgr>
    <baseappmgr>
        <internalInterface> eth1 </internalInterface>
        <externalInterface> eth1 </externalInterface>
    </baseappmgr>
    <bots>
        <internalInterface> eth1 </internalInterface>
        <externalInterface> eth1 </externalInterface>
    </bots>
    <logger>
        <internalInterface> eth1 </internalInterface>
        <externalInterface> eth1 </externalInterface>
    </logger>
</root>

注意:eth0、eth1为网卡名称,也可以直接配置对应的IP地址或MAC地址

Linux下需额外执行如下命令:

/sbin/ip route del broadcast 255.255.255.255 dev eth0
/sbin/ip route add broadcast 255.255.255.255 dev eth1

Copyright © 2018 Yolo Technologies. Publication: 2.0-025. Built: 2018-12-07.