Thursday, May 24, 2007

PPPoE client configure for IP phone----Writen by welv

当Server配置成功后,剩下的工作就是配置client了,么什么复杂,就是路由!
Client拨进去以后,得到的默认网关是PPPoE-Server的地址,所以如果你的一些上层服务的Server与pppoe-server不在同一个网段里,就很麻烦了。

举个例子:

Sip-phone--------- >PPPoE-Server sip-server
10.74.52.51 10.74.52.50 10.74.51.200

此时电话是以10.74.52.50为默认网关的,而10.74.52.50又不具备转发能力,故电话注册不上

解决方案:
为PPPoE-Server加装网卡,一块连51网段,另一块连52网段,然后做路由,就变成这个样子


Sip-phone<------------------->PPPoE-Server<--------------------------->Sip-server
10.74.52.51 10.74.52.50 10.74.51.250 10.74.51.200

然后使能两块网卡的IP转发能力,此时的路由表是这样的:

Destination Gateway Genmask Flags Metric Ref Use Iface
10.74.52.0 10.74.52.1 255.255.255.192 UG 0 0 0 eth0
10.74.51.0 10.74.51.1 255.255.255.0 UG 0 0 0 eth2
link-local * 255.255.0.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo

现在,电话发往Sip-server的包目的地址可达了,但是Sip-server却不知道回去的地址,你必须给它也加一条到目的地址10.74.52.50的路由,下一跳指向10.74.51.250:

route add -host 10.74.52.50 gw 10.74.51.250

然后路由表变成这样:

Destination Gateway Genmask Flags Metric Ref Use Iface
10.74.52.51 10.74.51.250 255.255.255.255 UGH 0 0 0 eth0
10.74.51.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 10.74.51.1 0.0.0.0 UG 0 0 0 eth0

得,成了!!!

No comments: