Ubuntu10.10 NIC configuration file reboot failed

Source: Internet
Author: User
Tags iptables

Environment: Ubuntu 10.10

Goal: Configure the load iptables rule when the NIC starts

The various operations found on the network:

Sh-c "Iptables-save >/etc/iptables.rules"

Vi/etc/network/interfaces

# # Add a command under the target card

# # pre-up Iptables-restore </etc/iptables.rules

However, it was found by test. These configurations will be lost after the reboot, and you will see this file header.

# This configuration the file is auto-generated.

# Warning:do Not edit this file, your changes would be lost.

# please create/edit/etc/network/interfaces.head And/etc/network/interfaces.tail instead,

# their contents'll be inserted at the beginning

# of this file, respectively.

#

# Note:it is isn't guaranteed that the contents Of/etc/network/interfaces.tail

# would be in the very end of this file.

The file is written very clearly and the/etc/network/interfaces is automatically generated. If we need a custom configuration, create/etc/network/interfaces.head or/etc/network/interfaces.tail. Which/etc/network/interfaces.tail is not recommended.

Here's an example:

Auto venet0:0

Iface venet0:0 inet Static

Address 184.22.224.125

Netmask 255.255.255.0

Pre-up Iptables-restore </etc/iptables.rules

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.