Netenv: 开机时选择你的网络环境

Netenv 适合于网络环境经常变动的情况,比如带着笔记本在家和公司切换,网络环境又还不一样。这个工具思路很简单,启动的时候,弹出一个对话框,让你选择一个环境,然后网络就按特定的参数设置。

Netenv

在 Debian/Ubuntu 上,就是简单的把 /etc/network/inetfaces 文件做符号链接到不同的配置文件上(不同的环境不同的配置文件)。

因为选择不同的环境,可以执行不同的脚本,这样可以在脚本里面做一个时间判定,比如在工作时间把网络配置成公司网络环境,在非工作时间,配置成在家的环境。当然这个方法不适合经常加班的同学 :D

Netenv

Read More:

  • No related posts

22 Comments

  1. 1 Iven Commented @ 2009-04-24 17:22Reply to this comment

    呵呵,跟 nm 那个位置功能差不多……

  2. 2 oldherl Commented @ 2009-04-24 17:22Reply to this comment

    arch不是早就这样了么……

  3. 3 hmy Commented @ 2009-04-24 17:23Reply to this comment

    @oldherl 也是用的这个工具?

  4. 4 kevin.c Commented @ 2009-04-24 17:29Reply to this comment

    wicd

  5. 5 ebird Commented @ 2009-04-24 17:31Reply to this comment

    用NetManager的飘过...

  6. 6 hmy Commented @ 2009-04-24 17:32Reply to this comment

    wicd 和netmanager一样,应该是系统启动到了桌面,再进行网络连接的选择。 netenv是在系统启动的时候,在启动网络服务之前,提供一个手段来选择(也可以自动选择)启动什么样的网络

  7. 7 Iven Commented @ 2009-04-24 17:38Reply to this comment

    @hmy: 那会不会耽误系统的启动啊?

  8. 8 hmy Commented @ 2009-04-24 17:46Reply to this comment

    @Iven 不会,可以设置超时。 现在我是这样使用的,在启动network服务之前,判断当前时间是否是工作时间,如果是工作时间,就把/etc/network/interfaces.office 链接成 /etc/network/interfaces ;如果是非工作时间,就把/etc/network/interfaces.home 链接成 /etc/network/interfaces

    说白了,这个软件就是在启动network之前,执行一个特定的脚本而已。

  9. 9 maxint Commented @ 2009-04-24 18:28Reply to this comment

    netcfg和dialog也可以实现这个功能,几乎一样的,这个工具还是第一次听说,呵呵~不错,多个选择

  10. 10 RRG Commented @ 2009-04-24 19:13Reply to this comment

    我是Debian 记得当时用netenv的时候,网络配置文件的链接已经被更改了,但是并没有使用新配置,没明白 后来想自己写个脚本在开机时读入一个数字进行配置,但是脚本里的read xxx不起作用(虚拟机里却没问题) 所以现在改成在关机时设置下次的启动环境的方式

  11. 11 hmy Commented @ 2009-04-24 19:25Reply to this comment

    @RRG

    network服务在/etc/rcS.0里面的启动顺序是40 保证netenv在network之前执行应该就行了。 改成S39的启动词序应该就行。

    ps: 我的netenv现在正常工作,已经验证

  12. 12 lh Commented @ 2009-04-24 19:27Reply to this comment

    确实,archlinux的netcfg早可以如此了,如果使用X,networkmananger也很方便,如果不依赖一点点gnome就好。嘿嘿

  13. 13 山猫 Commented @ 2009-04-24 20:00Reply to this comment

    还是 NetworkManager 人道啊

  14. 14 shellex Commented @ 2009-04-24 21:30Reply to this comment

    wicd简洁哈

  15. 15 RRG Commented @ 2009-04-24 22:19Reply to this comment

    @hmy: 可能是这个原因,啥时候再试试 似乎都是S40就可能有问题,我的那个脚本也设的S39来着

  16. 16 charbin Commented @ 2009-04-24 22:31Reply to this comment

    不得不说net workmanager就是一坨屎。

  17. 17 liangsuilong Commented @ 2009-04-24 22:55Reply to this comment

    @charbin: networkmanager设计的本意是好的,可是有点搞砸了的样子。如果你用过fedora的nm就更加痛苦了!不过ubuntu上面的那个貌似很不错!

  18. 18 黑日白月 Commented @ 2009-04-25 9:41Reply to this comment

    @liangsuilong: 我一直在用 Fedora 下的 NM,感觉挺好的啊……

  19. 19 山猫 Commented @ 2009-04-25 13:27Reply to this comment

    @黑日白月: 那,这些骂 NM 的是怎么回事啊? 我只感觉 Ubuntu 8.04、8.10、9.04 的 NetworkManager 一路进步好大

  20. 20 山猫 Commented @ 2009-04-25 13:30Reply to this comment

    @黑日白月: 如果说 Ubuntu 8.04 时候 NM 还要依赖 gnome-network-admin, 对静态 IP 和 ADSL 拨号有些麻烦(但是也能用),

    那 Ubuntu 8.10 的 NM 7.0、7.1 开始就已经将静态 IP 和 ADSL 拨号改善很多了,

  21. 21 黑日白月 Commented @ 2009-04-25 20:32Reply to this comment

    @山猫: 前段时间 Fedora 的 NM 出过一些乱子,一个 svn 未经充分测试就 Push 到 Update 源了,导致一些朋友出现问题(不包括本人)。幸好第二天就修复了。

    这个软件有些 cute,一般桌面用户用 NM 足矣…… 相比用 XP 的同学切换 wifi 那个麻烦,个人感觉 NM 还是很方便的,只需要点两下。

  22. 22 hantsy Commented @ 2009-04-26 13:15Reply to this comment

    KDE 中的NM 界面很酷啊,为什么gnome 没有引进呢。