对LVS DR模式的理解

 

Client向vip发请求,lvs接收

Src mac

Dst mac

type

Src ip

Src port

Dst ip

Dst port

CRC

Mac1

Mac2

192.168.1.168

192.168.1.169

80

Lvs根据算法选择一台realserver,将rip所在的网卡mac作为目标mac

Src mac

Dst mac

type

Src ip

Src port

Dst ip

Dst port

CRC

Mac2

Mac3

192.168.1.168

192.168.1.169

80

Realserver收到这个帧,拆开后发现目标ip(vip)与本地匹配,于是处理这个报文。然后重新封装报文,发送到局域网。

Src mac

Dst mac

type

Src ip

Src port

Dst ip

Dst port

CRC

Mac3

Mac1

192.168.1.169

80

192.168.1.168

如果client与LVS同一网段,则client将收到这个回复报文。如果跨网段,则报文通过gateway经由internet返回给用户。

 参考:http://os.51cto.com/art/201105/264303.htm

原文地址:https://www.cnblogs.com/no314/p/3668217.html