当前位置: 首页 >> Tag标签为 'iptables'

OpenVZ的VPS里不支持nat表?

在vps里执行:

iptables -t nat -L

提示:

iptables v1.2.11: can’t initialize iptables table `nat’: Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Read the rest of this entry »

Linux NAT之LOG问题

NAT在现实生活中解决了不少问题,随之而来的事件追踪也是一件麻烦事,由于NAT修改数据包的源地址(或端口),因此,只能通过记录NAT前后的IP地址来解决。

Read the rest of this entry »

单IP做NAT支持的最大连接数问题

和一些做NAT的老师接触,谈起NAT的问题,大多数都是自己用Linux使用iptables来搞定的,在具体谈到地址池的时候,发现很多老师都习惯将1个C网络NAT到一个单独的IP地址上,如果有N个C类地址,那就需要写N条iptables规则,当然这样做的好处是用户的源地址永远不会变,便于事件的追查等,当问到为什么非要把1个C映射到一个IP地址上时,大家的回答都是:怕一个地址的端口数量不够,导致连接数不够。

Read the rest of this entry »

用iptables做NAT地址池问题

用Linux做路由相信大家都不陌生,其实做路由,只需要把系统的转发功能打开即可,但是我们常说的做路由,往往都是路由+NAT(网络地址转换),因为我们IPv4地址在紧缺了,相信大家也看过不少文章,关于如何那Linux做路由,如何配置,这里简单介绍一下:

最简单的方法:

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

这样,从eth1出去的报文,如果在conntrack表中不存在,则系统会自动用eth1的某个可用地址替换,这样配置的好处是,无论eth1的地址怎么修改,只要配置正确下面的用户都可以访问互联网。

Read the rest of this entry »

CentOS 5.6安装程序的小Bug

由于没有在其他版本下测试过,所以不知道其他版本是否有同样的问题,之前安装的所有系统都是直接启用IPv6的。

Read the rest of this entry »

IPv6 NAT-期待了好久

A simple NAT(network address translation) for IPv6 (Linux only). Make sure if you really need it before using it. Functions: 1. IPv6 auto configuration; 2. TCP, UDP and ICMP-Echo port forwarding; 3. static port mapping for TCP and UDP.

http://sourceforge.net/projects/ipv6nat/

Asterisk通过SIP注册Pennytel及Gizmo5时通话故障

最近几天突然有个想法,想让Asterisk通过SIP注册到Gizmo5及Pennytel上,通过简单的设置很快就注册上去了,但是在通话的时候却发现有问题,振铃可以正常传送过来,接听过程可以可以感知到,但是就是没法听到对方的声音,这说明:SIP协议已经工作正常了,只是语音通话的通道出现了故障。

Read the rest of this entry »

Balancing Connections Over Multiple Links

General Idea

Say you have access to multiple links to the Internet, such as several wireless networks in range. Wouldn’t it be nice to combine all that bandwidth into one big fat pipe?

Read the rest of this entry »

Links Load balancing

Prerequisites :

Netfilter :

  • CONNMARK
  • nth (or statistic module)
  • condition (for failover)
  • Iproute2

Read the rest of this entry »

Netfilter Connmark

Introduction

CONNMARK is a cool feature of Netfilter. It provides a way to have a mark which is linked to the a connection tracking entry. Once a connmark is set, it also apply for RELATED connection entry. So, if you add a connmark to an FTP connection, the same connmark will be put of connections from ftp-data.

Read the rest of this entry »