zoukankan      html  css  js  c++  java
  • 今天学习到ROS的PCC的新的一种场景,用PCC不是为了带宽叠加而是为了换IP,PCC的标准做法

    之前有一个工作室的需求就是要求在一个浏览器窗口保持IP不变,新增一个窗口就变化IP。那就用src-address and port模式。

    很多需求是为了换IP,但是并不想实现带宽叠加的场景。

     这种用src address and port比用both-address and port更好 
    就比如你开游戏,开一个游戏,那么IP保持不变,再开 一个游戏IP才会变化。
    关于TCP的源目地址,以及源目端口,可以通过管理员模式下用命令netstat -anbp tcp来查看,或者通过资源监视器来查看都可以
    但是上述做法,访问网银会有问题,因为如果你IP老变化,银行的网银会出问题的。所以你用both address模式,可以避免这个问题。
    简单来说,就是源IP就是本地不同的主机有不同的IP,源端口就是本地每个窗口每个进程都有不同的IP;目的IP以及目的端口,只是更加细化的变化IP,主要在源IP和源端口上。
     
    PCC的标准做法

    1、新建地址列表:/ip firewall address-list add add
    address=192.168.120.0/24 list=LAN

    2、从哪进从哪出(便于ROS对外发布服务,比如VPN等等)

    add action=mark-connection chain=input comment=cnc-in connection-state=new
    in-interface=cnc-pppoe new-connection-mark=cnc-in passthrough=yes
    add action=mark-routing chain=output comment=cnc-in-route connection-mark=
    cnc-in new-routing-mark=cnc-in-route passthrough=yes
    add action=mark-connection chain=input comment=cnc2-in connection-state=new
    in-interface=cnc2-pppoe new-connection-mark=cnc2-in passthrough=yes
    add action=mark-routing chain=output comment=cnc2-in-route connection-mark=
    cnc2-in new-routing-mark=cnc2-in-route passthrough=yes

    3、mangle 标记:

    /ip firewall mangle
    add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local new-connection-mark=C1 passthrough=yes per-connection-classifier=src-port:2/0 src-address-list=LAN
    add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-type=!local new-connection-mark=C2 passthrough=yes per-connection-classifier=src-port:2/1 src-address-list=LAN
    add action=mark-routing chain=prerouting connection-mark=C1 new-routing-mark=R1 passthrough=yes src-address-list=LAN
    add action=mark-routing chain=prerouting connection-mark=C2 new-routing-mark=R2 passthrough=yes src-address-list=LAN
    4、路由策略:
    /ip route
    add distance=1 gateway=pppoe-out2 routing-mark=R1
    add distance=1 gateway=pppoe-out3 routing-mark=R2
    5、NAT 伪装
    /ip firewall nat
    add action=masquerade chain=srcnat src-address-list=LAN

  • 相关阅读:
    Linux文件编辑器 vi
    Sudo 和 Root 帐号
    Linux基本命令篇的习题解答
    Linux应用篇
    VMware中虚拟机网卡的四种模式
    Ubuntu游戏集合
    Linux与Window文件共享
    Linux知识点滴II
    [转载][翻译]jQuery Mobile教程创建一个订餐web应用(下)
    在WPF中创建带有刻度线的滑动条
  • 原文地址:https://www.cnblogs.com/itfat/p/12854781.html
Copyright © 2011-2022 走看看