Dropping DNS connection via iptables for testing

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I am trying to monitor behaviour of simple TV set-top box while losing connection to one or other DNS. The box is behind simple linux machine with debian which is then connected to network with DHCP and such. I am trying to use the middle-machine as traffic filter, so I can see if the set-top box switch easily to second DNS after losing connection with current.
When I am trying to DROP connection via iptables on the linux machine, banning IP of DNS, which is then unpingable from the machine (proving iptables config takes effect], the set-top box is still able to use the DNS normally. Monitoring the traffic using tcpdump proves it. Set-top box itself is obtaining all the info from network. The purpose is to simulate possible full or partial DNS failure in real envirnoment.
Using variations of: (OUTPUT, -d)
iptables -A INPUT -s 212.X.X.X -j DROP
even (OUTPUT)
iptables -A INPUT -p udp --dport 53 -j DROP
iptables -A INPUT -p tcp --dport 53 -j DROP
I am not sure what I am missing here (and I certainly do). I was also specifying interface facing network and such
iptables
migrated from serverfault.com Jun 5 at 10:20
This question came from our site for system and network administrators.
add a comment |Â
up vote
0
down vote
favorite
I am trying to monitor behaviour of simple TV set-top box while losing connection to one or other DNS. The box is behind simple linux machine with debian which is then connected to network with DHCP and such. I am trying to use the middle-machine as traffic filter, so I can see if the set-top box switch easily to second DNS after losing connection with current.
When I am trying to DROP connection via iptables on the linux machine, banning IP of DNS, which is then unpingable from the machine (proving iptables config takes effect], the set-top box is still able to use the DNS normally. Monitoring the traffic using tcpdump proves it. Set-top box itself is obtaining all the info from network. The purpose is to simulate possible full or partial DNS failure in real envirnoment.
Using variations of: (OUTPUT, -d)
iptables -A INPUT -s 212.X.X.X -j DROP
even (OUTPUT)
iptables -A INPUT -p udp --dport 53 -j DROP
iptables -A INPUT -p tcp --dport 53 -j DROP
I am not sure what I am missing here (and I certainly do). I was also specifying interface facing network and such
iptables
migrated from serverfault.com Jun 5 at 10:20
This question came from our site for system and network administrators.
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to monitor behaviour of simple TV set-top box while losing connection to one or other DNS. The box is behind simple linux machine with debian which is then connected to network with DHCP and such. I am trying to use the middle-machine as traffic filter, so I can see if the set-top box switch easily to second DNS after losing connection with current.
When I am trying to DROP connection via iptables on the linux machine, banning IP of DNS, which is then unpingable from the machine (proving iptables config takes effect], the set-top box is still able to use the DNS normally. Monitoring the traffic using tcpdump proves it. Set-top box itself is obtaining all the info from network. The purpose is to simulate possible full or partial DNS failure in real envirnoment.
Using variations of: (OUTPUT, -d)
iptables -A INPUT -s 212.X.X.X -j DROP
even (OUTPUT)
iptables -A INPUT -p udp --dport 53 -j DROP
iptables -A INPUT -p tcp --dport 53 -j DROP
I am not sure what I am missing here (and I certainly do). I was also specifying interface facing network and such
iptables
I am trying to monitor behaviour of simple TV set-top box while losing connection to one or other DNS. The box is behind simple linux machine with debian which is then connected to network with DHCP and such. I am trying to use the middle-machine as traffic filter, so I can see if the set-top box switch easily to second DNS after losing connection with current.
When I am trying to DROP connection via iptables on the linux machine, banning IP of DNS, which is then unpingable from the machine (proving iptables config takes effect], the set-top box is still able to use the DNS normally. Monitoring the traffic using tcpdump proves it. Set-top box itself is obtaining all the info from network. The purpose is to simulate possible full or partial DNS failure in real envirnoment.
Using variations of: (OUTPUT, -d)
iptables -A INPUT -s 212.X.X.X -j DROP
even (OUTPUT)
iptables -A INPUT -p udp --dport 53 -j DROP
iptables -A INPUT -p tcp --dport 53 -j DROP
I am not sure what I am missing here (and I certainly do). I was also specifying interface facing network and such
iptables
asked May 4 at 6:12
J B
migrated from serverfault.com Jun 5 at 10:20
This question came from our site for system and network administrators.
migrated from serverfault.com Jun 5 at 10:20
This question came from our site for system and network administrators.
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
The INPUT chain in IPTables acts on traffic whose destination is the computer running IPTables. It does not affect forwarded traffic.
You need to use the FORWARD chain for packets that go through the computer and that are not directed to it.
For example:
iptables -I FORWARD 1 -s 192.168.0.0/24 -d <destinationIP> -p udp --dport 53 -j DROP
This rule drops all UDP packets from 192.168.0.0/24 network to port 53.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
The INPUT chain in IPTables acts on traffic whose destination is the computer running IPTables. It does not affect forwarded traffic.
You need to use the FORWARD chain for packets that go through the computer and that are not directed to it.
For example:
iptables -I FORWARD 1 -s 192.168.0.0/24 -d <destinationIP> -p udp --dport 53 -j DROP
This rule drops all UDP packets from 192.168.0.0/24 network to port 53.
add a comment |Â
up vote
3
down vote
The INPUT chain in IPTables acts on traffic whose destination is the computer running IPTables. It does not affect forwarded traffic.
You need to use the FORWARD chain for packets that go through the computer and that are not directed to it.
For example:
iptables -I FORWARD 1 -s 192.168.0.0/24 -d <destinationIP> -p udp --dport 53 -j DROP
This rule drops all UDP packets from 192.168.0.0/24 network to port 53.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
The INPUT chain in IPTables acts on traffic whose destination is the computer running IPTables. It does not affect forwarded traffic.
You need to use the FORWARD chain for packets that go through the computer and that are not directed to it.
For example:
iptables -I FORWARD 1 -s 192.168.0.0/24 -d <destinationIP> -p udp --dport 53 -j DROP
This rule drops all UDP packets from 192.168.0.0/24 network to port 53.
The INPUT chain in IPTables acts on traffic whose destination is the computer running IPTables. It does not affect forwarded traffic.
You need to use the FORWARD chain for packets that go through the computer and that are not directed to it.
For example:
iptables -I FORWARD 1 -s 192.168.0.0/24 -d <destinationIP> -p udp --dport 53 -j DROP
This rule drops all UDP packets from 192.168.0.0/24 network to port 53.
answered May 4 at 6:29
Tero Kilkanen
50126
50126
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f447955%2fdropping-dns-connection-via-iptables-for-testing%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password