红联Linux门户
Linux帮助

在FreeBSD中安装双网卡实例

发布时间:2006-10-26 01:26:33来源:红联作者:fengmayi1
当我们使用FreeBSD作网关或防火墙时,会要求在系统中安装两块网卡,分别跨越两个网络,
一块卡用于外部网络,而另一块用于内部网络。好了,就象大家知道的那样,现在需要让系
统支持这些新设备,而对于网络适配器,FreeBSD是通过定制内核来支持的。当然,首先要让
内核了解设备所用的硬件资源,对于使用PCI接口的网卡,我只能说,拥有高科技真是幸福,
因为这类网卡在PCI PnP BOIS的支持下,只要在内核中多添一个设备配置就可在新内核引导
时自动检测并启动;而对于ISA的卡,就没有这样简单了,不过只要去PnP用jumpless模式,
用卡所带的设置程序设好适当的资源,就可以在内核中用相应的配置来通知系统在引导时按
这样的资源来启动设备。我们来看看具体步骤:
1、定制新内核以适应新设备
这里有一个问题需要注意一下,众所周知,定制内核至少需要在系统上安装原代码中的"内
核原代码"(FreeBSD Kernel Sources)部分,先前没有安装的可以用 /stand/sysinstall添
加这部分。
对于PCI网卡,例如你用的是Realtek 8139,可以在内核配置文件中添加一行:
device de0 <---- 你原有的DC21040 Ethernet adapters
device rl0 <---- 新加入的Realtek 8139,因为是PCI卡,系统会自动检测
卡资源
对于ISA网卡,例如你用的是NE2000兼容卡,同样在内核配置文件中添加与已设定资源相符
合的描述行:
device de0 <---- 你原有的DC21040 Ethernet adapters
device ed0 at isa? port 0x300 net irq 3 iomem 0xd8000 vector edintr
上面第二行是新加入的NE2000兼容网卡,因为是ISA卡,所以一定要指定卡所用的资源以便
系统可以在引导时检测到。可能你会问,如果用的都是同样芯片类型的卡,该如何配置呢?
可以这样做:
device ed0 at isa? port 0x300 net irq 3 iomem 0xd8000 vector edintr
device ed1 at isa? port 0x320 net irq 10 iomem 0xd8000 vector edintr
可以看到,有多个同样类型的设备时,按照UNIX的编号习惯依次就是ed0、ed1……。不过,
在上面的配置中两块卡的BOOTROM资源会发生冲突,但不影响启动,你可以根据情况用卡所
带设置程序把它们适当设开即可。
此时已经按要求定制好了新的内核配置,现在就可以按FreeBSD handbook中的描述把新内核
编译并安装好。编译工作一切顺利的话我们的系统就已经支持了新的网卡设备,接下来就是
为新网卡配置相应的网络接口。
2、添加新网络接口
比较简单直观的方法是用/stand/sysinstall来对新设备配置新接口的一系列参数,当然BSD
network_interfaces="ed0 ed1 lo0"
~~~在这里加入新的网络接口以便在引导时用后面ifconfig配置的
参数进行初始化
ifconfig_ed0="inet 192.168.0.1 netmask 255.255.255.0" #原有的网络接口参数
ifconfig_ed1="inet 192.168.1.1 netmask 255.255.255.0" #新网络接口参数
defaultroute="xxx.xxx.xxx.xxx" #原有的网络默认路由
好了,安装双网卡的工作就完成了,以后可以根据具体使用情况自行配置NAT、GATEWAY等东东
了。
文章评论

共有 1436 条评论

  1. 203.121.67.* 于 2007-09-06 08:54:04发表:

    Thanks boys :
    free mp3 downloads = FREE MUSIC DOWNLOADS = free limewire = FREE MUSIC DOWNLOADS = LIMEWIRE = limewire = Free Music Downloads = music download = free limewire =
    http://www.nativeecosystems.org/portal_memberdata/portraits/ge3ei3 free music downloads :: http://musicdownloadsmp3.tripod.com/music_downloads.html music download :: http://www.geocities.com/musicdowmoads4f/limewire.htm free limewire :: http://musicdownloadsmp3.tripod.com/ Free Music Downloads :: http://www.fixgrout.com/cgi/musicpage31.html limewire :: http://musicdownloadsmp3.tripod.com/ limewire :: http://musicdownloads4free.angelfire.com/free-music.html free music downloads :: http://musicdownloadsmp3.tripod.com/ mp3 music downloads :: http://www.freewebs.com/1fmusic/limewire.html limewire :: http://www.geocities.com/musicdowmoads4f/music-downloads.htm free music :: http://www.freewebs.com/1fmusic/music-downloads.html free mp3 ::
    free mp3 music downloads .. free music downloads .. limewire .. music downloads .. free limewire .. limewire .. mp3 music downloads ..

  2. 81.95.154.* 于 2007-09-05 07:49:37发表:

    Thanks boys :
    free music = Free Music Downloads = free music downloads = music downloads = limewire = limewire = free music downloads = free mp3 music downloads = free music download =
    http://musicdownloads4free.angelfire.com/free-music.html FREE MUSIC DOWNLOADS :: http://www.fixgrout.com/cgi/musicpage31.html free mp3 :: http://idisk.mac.com/fmp3musicdownloads/Public/index.html FREE MUSIC DOWNLOADS :: http://www.fixgrout.com/cgi/ music downloads :: http://homepage.mac.com/fmp3musicdownloads/limewire.htm limewire :: http://www.fixgrout.com/cgi/musicpage31.html LIMEWIRE :: http://homepage.mac.com/fmp3musicdownloads/music-downloads-pc.htm music downloads pc :: http://www.fixgrout.com/cgi/musicpage31.html free music :: http://www.freewebs.com/1fmusic/limewire.html free music downloads :: http://idisk.mac.com/fmp3musicdownloads/Public/free-limewire.html LIMEWIRE :: http://musicdownloadsmp3.tripod.com/music_downloads.html free music ::
    music downloads .. free music downloads .. music download .. free mp3 downloads .. limewire .. LIMEWIRE .. music downloads pc ..

  3. 203.121.71.* 于 2007-09-05 07:45:27发表:

    Great boys :
    FREE MUSIC DOWNLOADS = FREE MUSIC DOWNLOADS = FREE MUSIC DOWNLOADS = free music downloads = limewire = limewire = free music downloads = music downloads = legal music downloads =
    http://musicdownloads4free.angelfire.com/free-music.html free music downloads :: http://www.fixgrout.com/cgi/musicpage31.html MUSIC DOWNLOADS :: http://idisk.mac.com/fmp3musicdownloads/Public/index.html free music download :: http://www.fixgrout.com/cgi/ free mp3 downloads :: http://homepage.mac.com/fmp3musicdownloads/limewire.htm limewire :: http://www.fixgrout.com/cgi/musicpage31.html free limewire :: http://homepage.mac.com/fmp3musicdownloads/music-downloads-pc.htm free music downloads :: http://www.fixgrout.com/cgi/musicpage31.html free mp3 downloads :: http://www.freewebs.com/1fmusic/limewire.html free mp3 downloads :: http://idisk.mac.com/fmp3musicdownloads/Public/free-limewire.html LIMEWIRE :: http://musicdownloadsmp3.tripod.com/music_downloads.html free music downloads ::
    music .. free mp3 downloads .. mp3 music downloads .. FREE MUSIC DOWNLOADS .. limewire .. free limewire .. music downloads ..

  4. 203.121.67.* 于 2007-09-05 07:28:54发表:

    Yhanks you :
    FREE MUSIC DOWNLOADS = music = free limewire = free music downloads = limewire = free limewire = mp3 music downloads = free music downloads = free limewire =
    http://www.nativeecosystems.org/portal_memberdata/portraits/ge3ei3 free music download :: http://musicdownloadsmp3.tripod.com/music_downloads.html free music downloads :: http://www.geocities.com/musicdowmoads4f/limewire.htm limewire :: http://musicdownloadsmp3.tripod.com/ free music download :: http://www.fixgrout.com/cgi/musicpage31.html limewire :: http://musicdownloadsmp3.tripod.com/ free limewire :: http://musicdownloads4free.angelfire.com/free-music.html music downloads :: http://musicdownloadsmp3.tripod.com/ music downloads :: http://www.freewebs.com/1fmusic/limewire.html free limewire :: http://www.geocities.com/musicdowmoads4f/music-downloads.htm free music downloads :: http://www.freewebs.com/1fmusic/music-downloads.html music ::
    free music .. Free Music Downloads .. limewire .. mp3 music downloads .. LIMEWIRE .. LIMEWIRE .. music downloads ..

  5. 81.95.154.* 于 2007-09-04 10:24:45发表:

    Hi, my sites: :
    free music download = free music = legal music downloads = free mp3 music downloads = limewire = LIMEWIRE = free music downloads = music download = free music downloads =
    http://musicdownloads4free.angelfire.com/free-music.html music :: http://www.fixgrout.com/cgi/musicpage31.html free music downloads :: http://idisk.mac.com/fmp3musicdownloads/Public/index.html legal music downloads :: http://www.fixgrout.com/cgi/ free music download :: http://homepage.mac.com/fmp3musicdownloads/limewire.htm limewire :: http://www.fixgrout.com/cgi/musicpage31.html free limewire :: http://homepage.mac.com/fmp3musicdownloads/music-downloads-pc.htm music downloads :: http://www.fixgrout.com/cgi/musicpage31.html music :: http://www.freewebs.com/1fmusic/limewire.html Free Music Downloads :: http://idisk.mac.com/fmp3musicdownloads/Public/free-limewire.html LIMEWIRE :: http://musicdownloadsmp3.tripod.com/music_downloads.html music downloads ::
    free music downloads .. music .. free music download .. music downloads .. limewire .. free limewire .. FREE MUSIC DOWNLOADS ..

  6. 72.232.63.* 于 2007-09-03 18:40:46发表:

    Good design!
    guide casino virtuel | play free casino flash gratuit | jouer casino francais | jouer a la roulette | slots belgique

  7. 203.121.67.* 于 2007-09-02 23:26:07发表:

    Yhanks you :
    Free Music Downloads = free music downloads = free limewire = music = limewire = LIMEWIRE = free mp3 downloads = music downloads = limewire =
    http://www.nativeecosystems.org/portal_memberdata/portraits/ge3ei3 music download :: http://musicdownloadsmp3.tripod.com/music_downloads.html free mp3 :: http://www.geocities.com/musicdowmoads4f/limewire.htm limewire :: http://musicdownloadsmp3.tripod.com/ mp3 music downloads :: http://www.fixgrout.com/cgi/musicpage31.html free limewire :: http://musicdownloadsmp3.tripod.com/ limewire :: http://musicdownloads4free.angelfire.com/free-music.html mp3 music downloads :: http://musicdownloadsmp3.tripod.com/ legal music downloads :: http://www.freewebs.com/1fmusic/limewire.html LIMEWIRE :: http://www.geocities.com/musicdowmoads4f/music-downloads.htm free music :: http://www.freewebs.com/1fmusic/music-downloads.html Free Music Downloads ::
    free music downloads .. music download .. LIMEWIRE .. free music downloads .. free limewire .. LIMEWIRE .. free music ..

  8. 203.121.71.* 于 2007-09-02 23:25:47发表:

    Thanks boys :
    free music downloads = free music downloads = free mp3 music downloads = legal music downloads = limewire = limewire = free music downloads = free music download = free music downloads =
    http://musicdownloads4free.angelfire.com/free-music.html FREE MUSIC DOWNLOADS :: http://www.fixgrout.com/cgi/musicpage31.html FREE MUSIC DOWNLOADS :: http://idisk.mac.com/fmp3musicdownloads/Public/index.html free music downloads :: http://www.fixgrout.com/cgi/ free music :: http://homepage.mac.com/fmp3musicdownloads/limewire.htm limewire :: http://www.fixgrout.com/cgi/musicpage31.html limewire :: http://homepage.mac.com/fmp3musicdownloads/music-downloads-pc.htm free music downloads :: http://www.fixgrout.com/cgi/musicpage31.html Free Music Downloads :: http://www.freewebs.com/1fmusic/limewire.html music downloads :: http://idisk.mac.com/fmp3musicdownloads/Public/free-limewire.html LIMEWIRE :: http://musicdownloadsmp3.tripod.com/music_downloads.html Free Music Downloads ::
    free music download .. free mp3 .. music downloads .. free music download .. limewire .. limewire .. music downloads pc ..

  9. 81.95.154.* 于 2007-09-02 23:12:31发表:

    Hi boys! :
    legal music downloads = mp3 music downloads = free mp3 music downloads = Free Music Downloads = limewire = free limewire = music downloads = free music downloads = MUSIC DOWNLOADS =
    http://musicdownloads4free.angelfire.com/free-music.html Free Music Downloads :: http://www.fixgrout.com/cgi/musicpage31.html music :: http://idisk.mac.com/fmp3musicdownloads/Public/index.html free mp3 downloads :: http://www.fixgrout.com/cgi/ MUSIC DOWNLOADS :: http://homepage.mac.com/fmp3musicdownloads/limewire.htm limewire :: http://www.fixgrout.com/cgi/musicpage31.html LIMEWIRE :: http://homepage.mac.com/fmp3musicdownloads/music-downloads-pc.htm music downloads :: http://www.fixgrout.com/cgi/musicpage31.html music :: http://www.freewebs.com/1fmusic/limewire.html free music downloads :: http://idisk.mac.com/fmp3musicdownloads/Public/free-limewire.html limewire :: http://musicdownloadsmp3.tripod.com/music_downloads.html music download ::
    music downloads .. free mp3 music downloads .. legal music downloads .. free music .. limewire .. limewire .. music downloads pc ..

  10. 203.121.67.* 于 2007-09-01 23:06:35发表:

    Hi, my sites: :
    music = music downloads = LIMEWIRE = free mp3 music downloads = limewire = LIMEWIRE = free music = mp3 music downloads = LIMEWIRE =
    http://www.nativeecosystems.org/portal_memberdata/portraits/ge3ei3 free music :: http://musicdownloadsmp3.tripod.com/music_downloads.html free music downloads :: http://www.geocities.com/musicdowmoads4f/limewire.htm LIMEWIRE :: http://musicdownloadsmp3.tripod.com/ music downloads :: http://www.fixgrout.com/cgi/musicpage31.html free limewire :: http://musicdownloadsmp3.tripod.com/ limewire :: http://musicdownloads4free.angelfire.com/free-music.html Free Music Downloads :: http://musicdownloadsmp3.tripod.com/ music :: http://www.freewebs.com/1fmusic/limewire.html LIMEWIRE :: http://www.geocities.com/musicdowmoads4f/music-downloads.htm free music downloads :: http://www.freewebs.com/1fmusic/music-downloads.html free music download ::
    music downloads .. Free Music Downloads .. LIMEWIRE .. legal music downloads .. limewire .. free limewire .. MUSIC DOWNLOADS ..

  11. 203.121.71.* 于 2007-09-01 23:04:45发表:

    Great boys :
    music = free music downloads = free music downloads = music downloads = limewire = free limewire = FREE MUSIC DOWNLOADS = free music downloads = music =
    http://musicdownloads4free.angelfire.com/free-music.html free music :: http://www.fixgrout.com/cgi/musicpage31.html free music :: http://idisk.mac.com/fmp3musicdownloads/Public/index.html MUSIC DOWNLOADS :: http://www.fixgrout.com/cgi/ Free Music Downloads :: http://homepage.mac.com/fmp3musicdownloads/limewire.htm limewire :: http://www.fixgrout.com/cgi/musicpage31.html limewire :: http://homepage.mac.com/fmp3musicdownloads/music-downloads-pc.htm music downloads :: http://www.fixgrout.com/cgi/musicpage31.html music download :: http://www.freewebs.com/1fmusic/limewire.html FREE MUSIC DOWNLOADS :: http://idisk.mac.com/fmp3musicdownloads/Public/free-limewire.html free limewire :: http://musicdownloadsmp3.tripod.com/music_downloads.html free music downloads ::
    music .. music .. free mp3 .. MUSIC DOWNLOADS .. limewire .. LIMEWIRE .. music downloads pc ..

  12. 81.95.154.* 于 2007-09-01 23:01:52发表:

    Thanks boys :
    free mp3 = Free Music Downloads = music downloads = free mp3 downloads = limewire = LIMEWIRE = music downloads = free mp3 = Free Music Downloads =
    http://musicdownloads4free.angelfire.com/free-music.html free music :: http://www.fixgrout.com/cgi/musicpage31.html free music downloads :: http://idisk.mac.com/fmp3musicdownloads/Public/index.html free mp3 :: http://www.fixgrout.com/cgi/ free music downloads :: http://homepage.mac.com/fmp3musicdownloads/limewire.htm limewire :: http://www.fixgrout.com/cgi/musicpage31.html limewire :: http://homepage.mac.com/fmp3musicdownloads/music-downloads-pc.htm free music downloads :: http://www.fixgrout.com/cgi/musicpage31.html free music downloads :: http://www.freewebs.com/1fmusic/limewire.html FREE MUSIC DOWNLOADS :: http://idisk.mac.com/fmp3musicdownloads/Public/free-limewire.html limewire :: http://musicdownloadsmp3.tripod.com/music_downloads.html music ::
    free music downloads .. FREE MUSIC DOWNLOADS .. free music .. free mp3 downloads .. limewire .. limewire .. FREE MUSIC DOWNLOADS ..

  13. 81.95.154.* 于 2007-09-01 00:57:49发表:

    Thanks boys :
    legal music downloads = legal music downloads = mp3 music downloads = music = limewire = free limewire = FREE MUSIC DOWNLOADS = free mp3 downloads = music download =
    http://musicdownloads4free.angelfire.com/free-music.html MUSIC DOWNLOADS :: http://www.fixgrout.com/cgi/musicpage31.html music downloads :: http://idisk.mac.com/fmp3musicdownloads/Public/index.html free mp3 :: http://www.fixgrout.com/cgi/ Free Music Downloads :: http://homepage.mac.com/fmp3musicdownloads/limewire.htm limewire :: http://www.fixgrout.com/cgi/musicpage31.html LIMEWIRE :: http://homepage.mac.com/fmp3musicdownloads/music-downloads-pc.htm FREE MUSIC DOWNLOADS :: http://www.fixgrout.com/cgi/musicpage31.html FREE MUSIC DOWNLOADS :: http://www.freewebs.com/1fmusic/limewire.html free music downloads :: http://idisk.mac.com/fmp3musicdownloads/Public/free-limewire.html LIMEWIRE :: http://musicdownloadsmp3.tripod.com/music_downloads.html music downloads ::
    free mp3 .. free mp3 downloads .. music .. music .. limewire .. LIMEWIRE .. FREE MUSIC DOWNLOADS ..

  14. 203.121.67.* 于 2007-09-01 00:26:45发表:

    Great boys :
    free music = Free Music Downloads = free limewire = music downloads = LIMEWIRE = LIMEWIRE = free mp3 downloads = Free Music Downloads = LIMEWIRE =
    http://www.nativeecosystems.org/portal_memberdata/portraits/ge3ei3 free mp3 music downloads :: http://musicdownloadsmp3.tripod.com/music_downloads.html free music downloads :: http://www.geocities.com/musicdowmoads4f/limewire.htm limewire :: http://musicdownloadsmp3.tripod.com/ mp3 music downloads :: http://www.fixgrout.com/cgi/musicpage31.html free limewire :: http://musicdownloadsmp3.tripod.com/ limewire :: http://musicdownloads4free.angelfire.com/free-music.html free music downloads :: http://musicdownloadsmp3.tripod.com/ free music downloads :: http://www.freewebs.com/1fmusic/limewire.html free limewire :: http://www.geocities.com/musicdowmoads4f/music-downloads.htm free music downloads :: http://www.freewebs.com/1fmusic/music-downloads.html free music download ::
    free music downloads .. free mp3 downloads .. free limewire .. free music download .. free limewire .. LIMEWIRE .. music downloads ..

  15. 72.232.63.* 于 2007-08-31 18:46:06发表:

    Nice site!
    jouer casino online son blackjack | slots gratuit | casino royale | slots machine gratuit | casino web et roulette