您的位置 首页 模拟

Ubuntu10.10网卡配置文件重启失效

环境:ubuntu 10.10目标:配置网卡启动时加载iptables规则网络上搜到的各种操作:sh -c iptables-save > /etc/iptables.rulesvi /etc/

环境:ubuntu 10.10

方针:装备网卡启动时加载iptables规矩

网络上搜到的各种操作:

sh -c iptables-save > /etc/iptables.rules

vi /etc/network/interfaces

## 方针网卡下添加一条指令

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

可是,经测验发现。重启后这些装备会丢掉,检查这个文件头会发现。

# This configuration file is auto-generated.

# WARNING: Do not edit this file, your changes will be lost.

# Please create/edit /etc/network/interfaces.head and /etc/network/interfaces.tail instead,

# their contents will be inserted at the beginning and at the end

# of this file, respectively.

#

# NOTE: it is NOT guaranteed that the contents of /etc/network/interfaces.tail

# will be at the very end of this file.

文件写得很清晰,/etc/network/interfaces是主动生成的。假如咱们需求自定义装备,那就创立/etc/network/interfaces.head或/etc/network/interfaces.tail。其间/etc/network/interfaces.tail并不引荐。

以下是一个示例:

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

声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/zhishi/moni/324257.html

为您推荐

联系我们

联系我们

在线咨询: QQ交谈

邮箱: kf@86ic.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

返回顶部