免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2220 | 回复: 1
打印 上一主题 下一主题

iptables能配置ping由哪个网络设备出去吗 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-01-21 13:35 |只看该作者 |倒序浏览
问题是这样的,我们的设备上有个eth0的设备和ppp10的ppp拨号的网络设备。

~ >: ifconfig
eth0      Link encap:Ethernet  HWaddr 00:33:55:11:11:33  
          inet addr:10.78.28.113  Bcast:10.78.28.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26067 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4818 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2507307 (2.3 MiB)  TX bytes:642471 (627.4 KiB)
          Interrupt:111 Base address:0x6000

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  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:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ppp10     Link encapoint-to-Point Protocol  
          inet addr:10.215.99.171  P-t-P:10.64.64.74  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:56 (56.0 B)  TX bytes:44 (44.0 B)

~ >: route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.64.64.74     *               255.255.255.255 UH    0      0        0 ppp10
10.78.28.0      *               255.255.255.0   U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         10.78.28.1      0.0.0.0         UG    0      0        0 eth0
default         10.64.64.74     0.0.0.0         UG    10     0        0 ppp10

系统默认的网关是10.78.28.1(eth0上的),但eth0所在的网络防火墙封了ping.这样ping不出去。
若使用ppp0上的网关10.64.64.74,ping是可以出去的。

执行命令route del default删除10.78.28.1这个默认网关,或者添加一条静态路由route add 4.2.2.2 dev ppp10这样都可以ping通了。但这样的话,所有的数据也从ppp0这条备份链路出去了。

有什么方法能够做到所有的icmp数据从ppp10出,而其他TCP/IP数据都从eth0出?

论坛徽章:
0
2 [报告]
发表于 2011-01-27 16:12 |只看该作者
等高手解决!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP