问题原文
原帖链接 · Maverick · CC BY-SA 3.0
I'm working on something in the transport layer and after i ran our custom policies for securing the policies i'm not able to do traceroute from the linux machine.
root@keystone-evm:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere 10.222.4.212 udp dpt:echo
ACCEPT udp -- anywhere 10.222.4.212 udp dpt:isakmp
ACCEPT udp -- anywhere 10.222.4.212 udp dpt:radius
ACCEPT udp -- anywhere 10.222.4.212 udp dpt:ntp
ACCEPT icmp -- anywhere 10.222.4.212
ACCEPT udp -- anywhere 10.222.4.212 udp dpt:domain
ACCEPT udp -- anywhere 10.222.4.212 udp dpt:bootpc
ACCEPT udp -- anywhere 10.222.4.212 udp dpt:bootps
ACCEPT 123 -- anywhere 10.222.4.212
DROP all -- anywhere anywhere
ACCEPT udp -- anywhere anywhere udp spts:33434:33524 state NEW,RELATED,ESTABLISHED
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- 10.222.4.212 anywhere udp dpt:echo
ACCEPT udp -- 10.222.4.212 anywhere udp dpt:isakmp
ACCEPT udp -- 10.222.4.212 anywhere udp dpt:radius
ACCEPT udp -- 10.222.4.212 anywhere udp dpt:ntp
ACCEPT icmp -- 10.222.4.212 anywhere
ACCEPT udp -- 10.222.4.212 anywhere udp dpt:domain
ACCEPT udp -- 10.222.4.212 anywhere udp dpt:bootpc
ACCEPT udp -- 10.222.4.212 anywhere udp dpt:bootps
ACCEPT 123 -- 10.222.4.212 anywhere
DROP all -- anywhere anywhere
ACCEPT udp -- anywhere anywhere udp dpts:33434:33524 state NEW
root@keystone-evm:~# traceroute 10.222.4.100
traceroute to 10.222.4.100 (10.222.4.100), 30 hops max, 38 byte packets
1traceroute: sendto: Operation not permitted
The given below is the command I issued to enable traceroute:
iptables -A OUTPUT -o eth0 -p udp --dport 33434:33524 -m state --state NEW -j ACCEPTiptables -A INPUT -p udp --sport 33434:33524 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
已采纳解答
原帖链接 · Maverick · CC BY-SA 3.0
Thanks for all the inputs.
I came up with a shell script to do the job for me. I believe this would be helpful for other users also to perform the task. Please note that the local machine IP. Please do the necessary changes accordingly.
#!/bin/sh
echo "Enabling Traceroute..."
#Outbound UDP traffic Policy
iptables -I OUTPUT -o eth0 -p udp --dport 33434:33524 -m state --state NEW -j ACCEPT
iptables -I INPUT -p udp --sport 33434:33524 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
#Inbound ICMP traffic Policy
iptables -I INPUT -p icmp --icmp-type 3/3 -d 10.222.4.212 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -I INPUT -p icmp --icmp-type 11 -d 10.222.4.212 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
