关于iptables重定向

20 views
Skip to first unread message

muxueqz(张明源)

unread,
Jun 26, 2014, 2:59:00 AM6/26/14
to Scan, fuji...@googlegroups.com
你这样的话,是想针对所有协议吗?
-p可以加all或者干脆不加-p参数
PS: 还是在邮件列表里说吧!

Scan <allen1...@gmail.com>于2014年6月26日星期四写道:
昨天的问题已经解决了,现在我想把tcp和udp的数据包全部重定向,可是我下面这 么写好像语法是错的,不知道应该怎么写的,求指导下
iptables -t nat -A PREROUTING -p tcp,udp -s 192.168.43.0/24 -j DNAT --to-destination 192.168.43.1:8080
报了iptables v1.4.21: unknown protocol "tcp,udp" specified这样的错误

--

send by Scan
connect me with allen1...@gmail.com



--

Yi Li

unread,
Jun 26, 2014, 3:32:56 AM6/26/14
to fuji...@googlegroups.com, Scan
tcp和udp包都做dnat,你直接写成两条规则吧。
-p不支持指定多个协议。

On 06/26/2014 02:58 PM, muxueqz(张明源) wrote:
> 你这样的话,是想针对所有协议吗?
> -p可以加all或者干脆不加-p参数
> PS: 还是在邮件列表里说吧!
>
> Scan <allen1...@gmail.com
> <javascript:_e(%7B%7D,'cvml','allen1...@gmail.com');>>于2014年6月26日
> 星期四写道:
>
> 昨天的问题已经解决了,__现在我想把tcp和udp的数据包全部重定向,可是我
> 下面这 么写好像语法是错的,不知道应该怎么写的,求指导下
> iptables -t nat -A PREROUTING -p tcp,udp -s 192.168.43.0/24
> <http://192.168.43.0/24> -j DNAT --to-destination 192.168.43.1:8080
> <http://192.168.43.1:8080>
> 报了iptables v1.4.21: unknown protocol "tcp,udp" specified这样的错误
>
> --
>
> send by Scan
> connect me with allen1...@gmail.com
>
>
>
> --
> 明源
> http://muxueqz.gitcafe.com
> Twitter: @muxueqz <https://twitter.com/muxueqz>
>
> --
> 您收到此邮件是因为您订阅了Google网上论坛中的“福建Linux用户组”论坛。
> 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到
> fujianlug+...@googlegroups.com
> <mailto:fujianlug+...@googlegroups.com>。
> 要查看更多选项,请访问https://groups.google.com/d/optout

Scan

unread,
Jun 26, 2014, 3:47:32 AM6/26/14
to fuji...@googlegroups.com
soga,了解了,多谢各位大神耐心解答阿

On 06/26/2014 03:32 PM, Yi Li wrote:
> tcp和 udp包都做dnat,你直接写成两条规则吧。
Reply all
Reply to author
Forward
0 new messages