AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[vyatta](server)

Martin Hope
aastefanov
Asked: 2016-12-30 10:40:50 +0800 CST

VyOS NAT 不起作用

  • 0

我们正在将我们的 Internet 网关从 Cisco 迁移到 VyOS 路由器。

我们的 ISP从他们的路由器(其中 ABC113 是他们的路由器和我们流量的网关)为我们提供了/29VLAN 2715 上的网络。A.B.C.114/29

我们有一个执行 VLAN 间路由的第 3 层交换机,它的 IP 172.16.255.255 用于到网关的流量。流量在 VLAN 255 中进行标记。

尝试提交 NAT 设置时,我们收到警告,显示除一个之外,路由器上未配置所有 IP 地址。该 IP 是interfaces eth1 vif 2715 address(中指定的 IP A.B.C.114,尽管它是整个A.B.C.114/29子网 - 目前只有动态 NAT(源规则 100)在工作),这很奇怪。

我们应该为多个服务器进行 1 对 1 的 NAT(在示例配置中 - A.B.C.117to 172.16.10.10)

注意:有时 NAT 开始工作几分钟后又停止。

路由器配置如下(去掉敏感信息;只漏掉了一个不正常工作的NAT规则):

interfaces {
ethernet eth0 {
    description Inside
    duplex auto
    smp_affinity auto
    speed auto
    vif 255 {
        address 172.16.255.254/31
    }
}
ethernet eth1 {
    description Outside
    duplex auto
    smp_affinity auto
    speed auto
    vif 2715 {
        address A.B.C.114/29
    }
}
loopback lo {
}
}

nat {
destination {
    rule 20 {
        destination {
            address A.B.C.117
        }
        inbound-interface eth1.2715
        translation {
            address 172.16.10.10
        }
    }
}
source {
    rule 20 {
        outbound-interface eth1.2715
        source {
            address 172.16.10.10
        }
        translation {
            address A.B.C.117
        }
    }
    rule 100 {
        description Dynamic
        destination {
        }
        outbound-interface eth1.2715
        source {
            address 172.16.0.0/12
        }
        translation {
            address A.B.C.114
        }
    }
}
}
protocols {
static {
    route 0.0.0.0/0 {
        next-hop A.B.C.113 {
            distance 1
        }
    }
    route 172.16.0.0/12 {
        next-hop 172.16.255.255 {
            distance 1
        }
    }
}
}
nat vyos vyatta
  • 1 个回答
  • 1941 Views
Martin Hope
tweeks200
Asked: 2016-07-07 11:25:37 +0800 CST

Vyatta 目标 NAT 不工作

  • 0

在超过我们的第一个 VRRP 组中的 IP 限制后,我们遇到了向 vyatta 设备添加新 IP 的问题。工作中列出的所有 IPvrrp-group 1都很好,但我添加的任何IPvrrp-group 2都没有。

我们可以看到流量进入,但我们想要工作的流量 (443) 永远不会到达 NAT。但是,ping 流量进来并返回(这应该不起作用)。NAT 位于防火墙之前,但我们已经检查过它以确保我们没有遗漏任何东西并且它有 0 次命中。任何想法将不胜感激。

流量从端口 443 进入但不退出

tcpdump: listening on bond1, link-type EN10MB (Ethernet), capture size 65535 bytes
12:07:50.003063 IP (tos 0x0, ttl 52, id 63499, offset 0, flags [DF], proto TCP (6), length 64)
2.2.2.2.62111 > 1.1.1.1.443: Flags [S], cksum 0xd629 (correct), seq 237589496, win 65535, options [mss 1380,nop,wscale 5,nop,nop,TS val 1539048232 ecr 0,sackOK,eol], length 0
12:07:50.709156 IP (tos 0x0, ttl 52, id 37525, offset 0, flags [DF], proto TCP (6), length 64)
2.2.2.2.62113 > 1.1.1.1.443: Flags [S], cksum 0x412b (correct), seq 2830126052, win 65535, options [mss 1380,nop,wscale 5,nop,nop,TS val 1539048881 ecr 0,sackOK,eol], length 0
12:07:57.131533 IP (tos 0x0, ttl 52, id 34718, offset 0, flags [DF], proto TCP (6), length 64)
2.2.2.2.62137 > 1.1.1.1.443: Flags [S], cksum 0xc2c7 (correct), seq 3549136583, win 65535, options [mss 1380,nop,wscale 5,nop,nop,TS val 1539055166 ecr 0,sackOK,eol], length 0

防火墙命中的 NAT 表中没有任何内容

sh nat destination translations | match 1.1.1.1

sh firewall name out2in rule 100

-----------------------------
Rulesets Information
-----------------------------

IPv4 Firewall "out2in":

Active on traffic to -
zone [inside] from zone [outside]

rule action proto packets bytes
---- ------ ----- ------- -----
100 accept tcp 0 0
condition - saddr 0.0.0.0/0 daddr 10.0.0.100

Ping 有效(但不翻译)

15:11:31.052571 IP (tos 0x0, ttl 52, id 65344, offset 0, flags [none], proto ICMP (1), length 84)
    2.2.2.2 > 1.1.1.1: ICMP echo request, id 28473, seq 117, length 64
15:11:31.052585 IP (tos 0x0, ttl 64, id 9409, offset 0, flags [none], proto ICMP (1), length 84)
    1.1.1.1 > 2.2.2.2: ICMP echo reply, id 28473, seq 117, length 64
15:11:32.055675 IP (tos 0x0, ttl 52, id 32001, offset 0, flags [none], proto ICMP (1), length 84)
    2.2.2.2 > 1.1.1.1: ICMP echo request, id 28473, seq 118, length 64

NAT

set nat destination rule 100 destination address '1.1.1.1'
set nat destination rule 100 destination port 'https'
set nat destination rule 100 inbound-interface 'bond1'
set nat destination rule 100 protocol 'tcp'
set nat destination rule 100 translation address '10.0.0.100'

防火墙

set firewall name out2in rule 100 action 'accept'
set firewall name out2in rule 100 destination address '10.0.0.100'
set firewall name out2in rule 100 destination port '443'
set firewall name out2in rule 100 protocol 'tcp'

VRRP 配置

set interfaces bonding bond1 address '1.1.1.4/28'
set interfaces bonding bond1 hash-policy 'layer3+4'
set interfaces bonding bond1 mode '802.3ad'
set interfaces bonding bond1 vrrp vrrp-group 1 advertise-interval '1'
set interfaces bonding bond1 vrrp vrrp-group 1 preempt 'false'
set interfaces bonding bond1 vrrp vrrp-group 1 priority '253'
set interfaces bonding bond1 vrrp vrrp-group 1 'rfc3768-compatibility'
set interfaces bonding bond1 vrrp vrrp-group 1 sync-group 'vgroup1'
set interfaces bonding bond1 vrrp vrrp-group 1 virtual-address '1.1.1.230/28'
set interfaces bonding bond1 vrrp vrrp-group 1 virtual-address '1.1.2.80/28'
set interfaces bonding bond1 vrrp vrrp-group 1 virtual-address '1.1.3.172/29'
...
set interfaces bonding bond1 vrrp vrrp-group 2 advertise-interval '1'
set interfaces bonding bond1 vrrp vrrp-group 2 preempt 'false'
set interfaces bonding bond1 vrrp vrrp-group 2 priority '253'
set interfaces bonding bond1 vrrp vrrp-group 2 'rfc3768-compatibility'
set interfaces bonding bond1 vrrp vrrp-group 2 sync-group 'vgroup1'
set interfaces bonding bond1 vrrp vrrp-group 2 virtual-address '1.1.1.1/28'

为 zone-policy 添加了新的子接口

set zone-policy zone outside interface 'bond1'
set zone-policy zone outside interface 'bond1v1'
set zone-policy zone outside interface 'bond1v2'

路由匹配bond1v1中的相似路由

1.1.3.172/28 is directly connected, bond1v1
1.1.1.1/28 is directly connected, bond1v2
networking nat vyatta
  • 1 个回答
  • 1395 Views
Martin Hope
Shoaibi
Asked: 2010-03-26 01:13:03 +0800 CST

使用 Cisco VPN 3000 系列以廉价且开放的方式替代基于 Cisco 隧道的 EasyVPN

  • 1

我有一个场景,我必须为供应商建立基于对等预共享密钥的 VPN。该供应商使用带有 Cisco VPN 3000 的 Cisco EasyVPN 作为访问集中器。我从http://www.cisco.com/en/US/prod/collat ​​eral/iosswrel/ps6537/ps6586/ps6635/ps7180/prod_brochure0900aecd80582078.pdf 检查了 VPN 类型的兼容性,它似乎只适用于思科硬件。

我正在寻找一种更便宜且可能且开放的替代品,以节省我的成本并向他们推荐。我尝试过 OpenVPN 并考虑过vyatta。

vpn openvpn cisco tunneling vyatta
  • 4 个回答
  • 1326 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve