All Products
Search
Document Center

:How to back up iptables rules for an Ubuntu instance

Last Updated:Dec 24, 2020

Overview

For network troubleshooting of Ubuntu instances, you need to back up iptables rules. Then, you must clear the iptables rules to exclude iptables from being affected.

Detail

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted sensitive information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.

iptables operations in Ubuntu are different from those in CentOS. Ubuntu does not support iptables, so the operations are different. Ubuntu does not have the rules File /etc/sysconfig/iptables. Perform the operation according to the following method:

  • Run the following command to back up data:
    iptables-save > /etc/iptables.rules
  • Run the following command to restore the database:
    iptables-restore < /etc/iptables.rules

Application scope

  • Elastic Compute Service