IPTables - CHAIN_ADD failed (Device or resource busy) Print

  • 0

You may receive the following errors when trying to add certain iptables rules:

root@test:~# sudo iptables -t nat -A PREROUTING -i venet0 -p tcp --dport 80 -j DNAT --to-destination 10.7.0.2
iptables v1.8.7 (nf_tables): CHAIN_ADD failed (Device or resource busy): chain PREROUTING
root@test:~#
root@test:~# sudo iptables -t nat -A PREROUTING -i venet0 -p tcp --dport 443 -j DNAT --to-destination 10.7.0.2
iptables v1.8.7 (nf_tables): CHAIN_ADD failed (Device or resource busy): chain PREROUTING
root@test:~#
root@test:~# sudo iptables -t nat -A POSTROUTING -o wg0 -p tcp --dport 80 -d 10.7.0.2 -j SNAT --to-source 10.7.0.1
iptables v1.8.7 (nf_tables): CHAIN_ADD failed (Device or resource busy): chain POSTROUTING
root@test:~#
root@test:~# sudo iptables -t nat -A POSTROUTING -o wg0 -p tcp --dport 443 -d 10.7.0.2 -j SNAT --to-source 10.7.0.1
iptables v1.8.7 (nf_tables): CHAIN_ADD failed (Device or resource busy): chain POSTROUTING
root@test:~#

To resolve this issue, please run the following command:

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy

The above command will persist between reboots.


Was this answer helpful?

« Back


Ethernet Servers Ltd
124 City Road
London
EC1V 2NX
United Kingdom


Registered Limited Company: #09114946

Telephone:
+44 330 043 1258

Email:
hello@ethernetservers.com

Copyright © 2014 - 2024 - Ethernet Servers Ltd - All Rights Reserved.

Proudly serving customers in 143 countries since July 2014!