欢迎登陆真网站,您的到来是我们的荣幸。 登陆 注册 忘记密码? ☆设为首页 △加入收藏
欢迎加入真幸福QQ群
电脑知识: 基础知识 网络技术 操作系统 办公软件 电脑维修 电脑安全 windows7 windows8 windows10 服务器教程 平板电脑 视频播放教程 网络应用 互联网 工具软件 浏览器教程 QQ技巧 输入法教程 影视制作 YY教程 wps教程 word教程 Excel教程 PowerPoint
云南西双版纳特产小花糯玉米真空包装


Linux下架构日志服务器
什么是智能dns解析
Windows 2003 server R2 的IIS上配置Webdav
Windows系统环境下安装Apache并配置虚拟目录的方法介绍
win2003添加自定义用户设置具体步骤
windows下Apache配置SSL安全连接
Windows 环境下安装Apache与虚拟目录的配置
APACHE开启SSL服务教程
选择云服务不可轻视的三大细节
网吧网络管理软件漏洞查找方法
Ubuntu10.10网卡配置文件重启失效
【 来源:网络 】【 点击:1 】 【 发布时间:2017_03_03 08:59:59 】

   环境: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

本网站由川南居提供技术支持,fkzxf版权所有 浙ICP备12031891号
淳安分站 淳安分站