unissoft-bj / ihostsvc

system services & data services on ihost
0 stars 0 forks source link

wms listen interface问题 #38

Closed unissoft-bj closed 9 years ago

unissoft-bj commented 9 years ago

wms部署到ihost上时,read stream time out.

ihost上的interfaces:

(15:48 root@ihost ~) > ifconfig eth0 Link encap:Ethernet HWaddr 00:c0:08:88:9e:d6
inet addr:192.168.100.200 Bcast:192.168.100.255 Mask:255.255.255.0 inet6 addr: fe80::2c0:8ff:fe88:9ed6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:390523 errors:0 dropped:0 overruns:0 frame:0 TX packets:407346 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:209364253 (209.3 MB) TX bytes:90455406 (90.4 MB)

eth0:9 Link encap:Ethernet HWaddr 00:c0:08:88:9e:d6
inet addr:192.168.254.254 Bcast:192.168.254.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1067 errors:0 dropped:0 overruns:0 frame:0 TX packets:1067 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:168160 (168.1 KB) TX bytes:168160 (168.1 KB)

tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:172.16.0.1 P-t-P:172.16.0.1 Mask:255.255.0.0 UP POINTOPOINT RUNNING MTU:1500 Metric:1 RX packets:51632 errors:0 dropped:0 overruns:0 frame:0 TX packets:67272 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:5215515 (5.2 MB) TX bytes:43889788 (43.8 MB)

其中的eth0/tun0分别相当于wan口和lan口。但是因为ihost上只有一个物理网口,所以实际上tun0是虚拟出来的,与eth0是一个物理网口

在eth0上抓包,能抓到语音udp包 在tun0上抓包,抓不到语音udp包(即使接通client端的internet,也抓不到udp包)。如果wms listen tun0的话,得不到udp包。

wms需要从eth0上获取udp包,而不是tun0

unissoft-bj commented 9 years ago

对比:不启动chilli

ihost上的interface

(16:28 root@ihost ~) > ifconfig eth0 Link encap:Ethernet HWaddr 00:c0:08:88:9e:d6
inet addr:192.168.100.200 Bcast:192.168.100.255 Mask:255.255.255.0 inet6 addr: fe80::2c0:8ff:fe88:9ed6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:17039 errors:0 dropped:0 overruns:0 frame:0 TX packets:11807 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:14174590 (14.1 MB) TX bytes:2985542 (2.9 MB)

eth0:9 Link encap:Ethernet HWaddr 00:c0:08:88:9e:d6
inet addr:192.168.254.254 Bcast:192.168.254.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth0:10 Link encap:Ethernet HWaddr 00:c0:08:88:9e:d6
inet addr:172.16.0.1 Bcast:172.16.255.255 Mask:255.255.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:748 errors:0 dropped:0 overruns:0 frame:0 TX packets:748 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:175986 (175.9 KB) TX bytes:175986 (175.9 KB)

usb0 Link encap:Ethernet HWaddr da:9c:4d:57:c0:07
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

eth0:10对应的是上面的tun0,但二者的工作模式有区别。tun0仅允许流控的包 此时在eth0上抓包,和在eth0:10上抓包,效果是一样的。wms能正常保存语音文件到/wms/audio

unissoft-bj commented 9 years ago

sed -i 's|up iptables-restore < /etc/iptables.ipv4.nat||g' /etc/network/interfaces

cat >> /etc/network/interfaces <<EOF auto eth0:20 iface eth0:20 inet static name Ethernet alias LAN card1 address 172.16.0.2 netmask 255.255.0.0 network 172.16.0.0 broadcast 172.16.255.255

EOF

echo 'up iptables-restore < /etc/iptables.ipv4.nat' >> /etc/network/interfaces