要使用 IP 伪装功能,您的 Kernel 必须在编译时启用伪装支持。在配置 2.2 系列 Kernel 时,您必须选择以下选项
Networking options ---> [*] Network firewalls [*] TCP/IP networking [*] IP: firewalling [*] IP: masquerading --- Protocol-specific masquerading support will be built as modules. [*] IP: ipautofw masq support [*] IP: ICMP masquerading |
2.4 系列 Kernel 不再提供 IP 伪装支持作为 Kernel 编译时选项。相反,您应该选择网络数据包过滤选项
Networking options ---> [M] Network packet filtering (replaces ipchains) |
在 2.2 系列 Kernel 中,在 Kernel 编译期间创建了许多特定于协议的辅助模块。某些协议开始于一个端口上的传出请求,然后期望在另一个端口上建立传入连接。通常,这些无法被伪装,因为如果不深入了解协议本身,就无法将第二个连接与第一个连接关联起来。辅助模块正是这样做的;它们实际上查看数据报内部,并允许伪装功能适用于支持的协议,否则这些协议将无法被伪装。支持的协议包括
模块 | 协议 |
---|---|
ip_masq_ftp | FTP |
ip_masq_irc | IRC |
ip_masq_raudio | RealAudio |
ip_masq_cuseeme | CU-See-Me |
ip_masq_vdolive | 对于 VDO Live |
ip_masq_quake | IdSoftware 的 Quake |
# insmod ip_masq_raudio.o ports=7070,7071,7072 |
netfilter 软件包包含执行类似功能的模块。例如,要提供 FTP 会话的连接跟踪,您需要加载并使用ip_conntrack_ ftp和ip_nat_ ftp.o模块。
[1] | RealAudio 是 Progressive Networks Corporation 的商标。 |
[2] | 您可以联系 Ambrose,地址为 ambrose@writeme.com。 |