华为USG防火墙双机,但ISP只给了1个IP, 怎么办?

发布于:2025-08-09 ⋅ 阅读:(20) ⋅ 点赞:(0)

华为USG防火墙双机,但ISP只给了1个IP, 怎么办?
华为USG双机使用VRRP,需要3个Ip

本次联通只给了 100.1.1.0/30 这一个互联段
联通侧用了100.1.1.1, 我们这一侧只有100.1.1.2

怎么办?

找联通多要几个Ip, 让他们给/29的地址段。但联通不给
在这里插入图片描述

与华为厂家沟通得知,可以使用另1种方法:虚假实IP, 虚拟真IP
一句话:接口下配置内网IP,或随意的Ip,Vrrp VIP使用那1个联通的公网IP

实地址我们用 169.254.1.1 和 169.254.1.2

1 配置方法

1.1 USG -1

interface GE0/0/1
 description ChinaUnicom
 ip address 169.254.1.1 255.255.255.0
 vrrp vrid 10 virtual-ip 100.1.1.2 255.255.255.252 active

1.2 USG -2

interface GE0/0/1
 description ChinaUnicom
 ip address 169.254.1.2 255.255.255.0
 vrrp vrid 10 virtual-ip 100.1.1.2 255.255.255.252 Standby

2 测试

配置完成,测试,从USG上ping联通IP
ping 100.1.1.1 ,失败
为何?
因为带的源Ip是 169.254.1.1,这个地址到对端根本不理

那怎么实现? 带source Ip ping, 即带上vrrp vip为源

USG-1>ping -a 100.1.1.2  100.1.1.1
Warning: The specified source address is not a local address, the ping command will not check the network connection.
  PING 100.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 100.1.1.1: bytes=56 Sequence=1 ttl=255 time=22 ms
    Reply from 100.1.1.1: bytes=56 Sequence=2 ttl=255 time=21 ms
    Reply from 100.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 100.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 100.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 100.1.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/20/22 ms

3 检查2台墙的VRRP状态

3.1 USG-1

HRP_M<USG-1> display vrrp
2025-08-08 10:59:39.339 
Type:
  N: Normal
  A: Administrator
  M: Member
  L: Load-Balance
  LM: Load-Balance-Member
  V: Vgmp
Total:3     Master:2    Backup:0    Non-active:1    
VRID State       Interface               Type    Virtual IP
----------------------------------------------------------------
  10 Master      GE0/0/1                 V       100.1.1.1

3.2 USG-2

HRP_B<USG-2> display vrrp
2025-08-08 18:32:11.393 
Type:
  N: Normal
  A: Administrator
  M: Member
  L: Load-Balance
  LM: Load-Balance-Member
  H: Hrp
Total:3     Master:0    Backup:3    Non-active:0    
VRID State       Interface               Type    Virtual IP
----------------------------------------------------------------
  10 Backup      GE0/0/1                 H       100.1.1.1
 

到这里并没有真正结束,还存在1个问题,内部上网怎么办?
SNAT的转换后IP,又不能是接口IP, 这nat怎么配置?
方法:转换后的Ip调用address-group实现
配置:

ip address-set 10.0.0.0_8 type object
 address 0 10.0.0.0 mask 8
#
ip address-set obj-100.1.1.1 type object
 address 0 100.1.1.1 mask 32
#

rule name inside-to-Internet
  description  inside-to-Internet
  source-zone trust
  source-address address-set 10.0.0.0_8
  destination-address any
  action source-nat address-group obj-100.1.1.1
#

网站公告

今日签到

点亮在社区的每一天
去签到