红联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.223.159.* 于 2007-08-18 15:23:26发表:

    Great boys :
    free mp3 = free music downloads = free download music = limewire = music downloads = how to download music = free music video = free country music downloads = music downloads pc =
    http://www.fixgrout.com/cgi/musicpage15.html free mp3 :: http://www.fixgrout.com/cgi/musicpage47.html free music downloads :: http://mywebpage.netscape.com/music5site/download-music.htm free music downloads :: http://www.viktorschreckengost.org/portal_memberdata/portraits/bergds free music ipods :: http://musicdownloads4free.angelfire.com/free-music.html free music :: http://www.fixgrout.com/cgi/musicpage35.html free music download sites :: http://www.fixgrout.com/cgi/musicpage31.html limewire music downloads :: http://mywebpage.netscape.com/music5site/download-music.htm download music free :: http://www.fixgrout.com/cgi/musicpage17.html music downloads pc :: http://idisk.mac.com/fmp3musicdownloads/Public/music.html music downloads :: http://mywebpage.netscape.com/free5mp3/mp3music.html Free Music Downloads ::
    free mp3 .. free music ipods .. mp3 downloads .. free mp3 downloads .. Free Music Downloads .. Free Music Downloads .. free music ipods ..

  2. 203.121.67.* 于 2007-08-18 11:42:38发表:

    Yhanks you :
    free mp3 = free music video = free ipod music downloads sites = music = free music video = classical music downloads = free music downloads = free music for ipod = music downloads pc =
    http://www.fixgrout.com/cgi/musicpage15.html free mp3 :: http://www.fixgrout.com/cgi/musicpage47.html music download :: http://mywebpage.netscape.com/music5site/download-music.htm free ipod music downloads sites :: http://www.viktorschreckengost.org/portal_memberdata/portraits/bergds music downloads pc :: http://musicdownloads4free.angelfire.com/free-music.html classical music downloads :: http://www.fixgrout.com/cgi/musicpage35.html free ipod music downloads :: http://www.fixgrout.com/cgi/musicpage31.html free music :: http://mywebpage.netscape.com/music5site/download-music.htm music download :: http://www.fixgrout.com/cgi/musicpage17.html music downloads pc :: http://idisk.mac.com/fmp3musicdownloads/Public/music.html free mp3 downloads :: http://mywebpage.netscape.com/free5mp3/mp3music.html free music download ::
    free mp3 .. limewire music downloads .. download music video .. mp3 downloads .. FREE MUSIC DOWNLOADS .. free music video .. free music to download ..

  3. 203.121.67.* 于 2007-08-17 13:27:22发表:

    Hi, my sites: :
    free mp3 = free music downloads = download music free = music download free = free music video = music downloads = music downloads pc = free music ipods = music downloads pc =
    http://www.fixgrout.com/cgi/musicpage15.html free mp3 :: http://www.fixgrout.com/cgi/musicpage47.html music downloads :: http://mywebpage.netscape.com/music5site/download-music.htm free music downloads :: http://www.viktorschreckengost.org/portal_memberdata/portraits/bergds free country music downloads :: http://musicdownloads4free.angelfire.com/free-music.html how to download music :: http://www.fixgrout.com/cgi/musicpage35.html free mp3 music downloads :: http://www.fixgrout.com/cgi/musicpage31.html limewire :: http://mywebpage.netscape.com/music5site/download-music.htm how to download music :: http://www.fixgrout.com/cgi/musicpage17.html music downloads pc :: http://idisk.mac.com/fmp3musicdownloads/Public/music.html free music :: http://mywebpage.netscape.com/free5mp3/mp3music.html free mp3 music downloads ::
    free mp3 .. free music to download .. music download .. download music for free .. free limewire .. FREE MUSIC DOWNLOADS .. free music downloading ..

  4. 203.121.67.* 于 2007-08-16 15:41:43发表:

    Yhanks you :
    free mp3 = free music downloading = download music video = free mp3 music downloads = download music video = music downloads = mp3 downloads = music download free = music downloads pc =
    http://www.fixgrout.com/cgi/musicpage15.html free mp3 :: http://www.fixgrout.com/cgi/musicpage47.html music download free :: http://mywebpage.netscape.com/music5site/download-music.htm music download free :: http://www.viktorschreckengost.org/portal_memberdata/portraits/bergds classical music downloads :: http://musicdownloads4free.angelfire.com/free-music.html free music for ipod :: http://www.fixgrout.com/cgi/musicpage35.html free download music :: http://www.fixgrout.com/cgi/musicpage31.html free music video :: http://mywebpage.netscape.com/music5site/download-music.htm free country music downloads :: http://www.fixgrout.com/cgi/musicpage17.html music downloads pc :: http://idisk.mac.com/fmp3musicdownloads/Public/music.html music :: http://mywebpage.netscape.com/free5mp3/mp3music.html legal music downloads ::
    free mp3 .. music downloads pc .. download music for free .. music downloads .. FREE MUSIC DOWNLOADS .. music download .. free music ipods ..

  5. 203.121.67.* 于 2007-08-16 14:44:35发表:

    Great boys :
    free mp3 = free mp3 downloads = music downloads pc = download music for free = free ipod music downloads = music download free = music download free = download music free = music downloads pc =
    http://www.fixgrout.com/cgi/musicpage15.html free mp3 :: http://www.fixgrout.com/cgi/musicpage47.html free music :: http://mywebpage.netscape.com/music5site/download-music.htm download music for free :: http://www.viktorschreckengost.org/portal_memberdata/portraits/bergds mp3 downloads :: http://musicdownloads4free.angelfire.com/free-music.html download music for free :: http://www.fixgrout.com/cgi/musicpage35.html free ipod music downloads sites :: http://www.fixgrout.com/cgi/musicpage31.html download music free :: http://mywebpage.netscape.com/music5site/download-music.htm free country music downloads :: http://www.fixgrout.com/cgi/musicpage17.html music downloads pc :: http://idisk.mac.com/fmp3musicdownloads/Public/music.html music downloads :: http://mywebpage.netscape.com/free5mp3/mp3music.html free music download ::
    free mp3 .. download music for free .. free music downloads .. free music for ipod .. free music download .. free mp3 music downloads .. free music download sites ..

  6. 203.223.159.* 于 2007-08-15 18:16:49发表:

    Yhanks you :
    free mp3 = limewire music downloads = free limewire = classical music downloads = music = download music free = download music free = free ipod music downloads sites = music downloads pc =
    http://www.fixgrout.com/cgi/musicpage15.html free mp3 :: http://www.fixgrout.com/cgi/musicpage47.html free music downloads :: http://mywebpage.netscape.com/music5site/download-music.htm download music free :: http://www.viktorschreckengost.org/portal_memberdata/portraits/bergds free ipod music downloads :: http://musicdownloads4free.angelfire.com/free-music.html music download free :: http://www.fixgrout.com/cgi/musicpage35.html free music :: http://www.fixgrout.com/cgi/musicpage31.html limewire :: http://mywebpage.netscape.com/music5site/download-music.htm free mp3 downloads :: http://www.fixgrout.com/cgi/musicpage17.html music downloads pc :: http://idisk.mac.com/fmp3musicdownloads/Public/music.html music downloads :: http://mywebpage.netscape.com/free5mp3/mp3music.html free music downloading ::
    free mp3 .. free mp3 downloads .. mp3 downloads .. free limewire .. download music free .. music download .. download free music ..

  7. 203.121.67.* 于 2007-08-15 15:20:03发表:

    Yhanks you :
    free mp3 = free music ipods = free legal music downloads = free ipod music downloads sites = free legal music downloads = free music download = free legal music downloads = free music download = music downloads pc =
    http://www.fixgrout.com/cgi/musicpage15.html free mp3 :: http://www.fixgrout.com/cgi/musicpage47.html download music for free :: http://mywebpage.netscape.com/music5site/download-music.htm download music free :: http://www.viktorschreckengost.org/portal_memberdata/portraits/bergds free music ipods :: http://musicdownloads4free.angelfire.com/free-music.html music downloads pc :: http://www.fixgrout.com/cgi/musicpage35.html free limewire :: http://www.fixgrout.com/cgi/musicpage31.html FREE MUSIC DOWNLOADS :: http://mywebpage.netscape.com/music5site/download-music.htm free music to download :: http://www.fixgrout.com/cgi/musicpage17.html music downloads pc :: http://idisk.mac.com/fmp3musicdownloads/Public/music.html free mp3 downloads :: http://mywebpage.netscape.com/free5mp3/mp3music.html free legal music downloads ::
    free mp3 .. free music .. music downloads pc .. music download free .. legal music downloads .. free music ipods .. download music free ..

  8. 203.121.67.* 于 2007-08-15 14:57:13发表:

    Thanks boys :
    free mp3 = free music downloads = download free music = download music video = free music download sites = free mp3 = free music ipods = free ipod music downloads = music downloads pc =
    http://www.fixgrout.com/cgi/musicpage15.html free mp3 :: http://www.fixgrout.com/cgi/musicpage47.html free country music downloads :: http://mywebpage.netscape.com/music5site/download-music.htm free music :: http://www.viktorschreckengost.org/portal_memberdata/portraits/bergds free ipod music downloads :: http://musicdownloads4free.angelfire.com/free-music.html download music for free :: http://www.fixgrout.com/cgi/musicpage35.html download music video :: http://www.fixgrout.com/cgi/musicpage31.html classical music downloads :: http://mywebpage.netscape.com/music5site/download-music.htm music downloads :: http://www.fixgrout.com/cgi/musicpage17.html music downloads pc :: http://idisk.mac.com/fmp3musicdownloads/Public/music.html free music :: http://mywebpage.netscape.com/free5mp3/mp3music.html FREE MUSIC DOWNLOADS ::
    free mp3 .. free mp3 downloads .. FREE MUSIC DOWNLOADS .. mp3 downloads .. free limewire .. free mp3 .. download free music ..

  9. 203.121.67.* 于 2007-08-12 00:40:13发表:

    Hi boys! :
    free mp3 = music downloads pc = free country music downloads = music = free music download sites = download music video = free music to download = how to download music = music downloads pc =
    http://www.fixgrout.com/cgi/musicpage15.html free mp3 :: http://www.fixgrout.com/cgi/musicpage47.html free music download sites :: http://mywebpage.netscape.com/music5site/download-music.htm download music free :: http://www.viktorschreckengost.org/portal_memberdata/portraits/bergds free music video :: http://musicdownloads4free.angelfire.com/free-music.html free music downloads :: http://www.fixgrout.com/cgi/musicpage35.html free country music downloads :: http://www.fixgrout.com/cgi/musicpage31.html mp3 downloads :: http://mywebpage.netscape.com/music5site/download-music.htm download music free :: http://www.fixgrout.com/cgi/musicpage17.html music downloads pc :: http://idisk.mac.com/fmp3musicdownloads/Public/music.html free mp3 downloads :: http://mywebpage.netscape.com/free5mp3/mp3music.html free country music downloads ::
    free mp3 .. free music for ipod .. free music for ipod .. limewire .. free ipod music downloads .. free music ipods .. classical music downloads ..

  10. 203.223.159.* 于 2007-08-11 21:03:30发表:

    Hi boys! :
    free mp3 = classical music downloads = classical music downloads = FREE MUSIC DOWNLOADS = free music download = mp3 downloads = free country music downloads = free music ipods = music downloads pc =
    http://www.fixgrout.com/cgi/musicpage15.html free mp3 :: http://www.fixgrout.com/cgi/musicpage47.html free music :: http://mywebpage.netscape.com/music5site/download-music.htm free ipod music downloads sites :: http://www.viktorschreckengost.org/portal_memberdata/portraits/bergds free music for ipod :: http://musicdownloads4free.angelfire.com/free-music.html download music free :: http://www.fixgrout.com/cgi/musicpage35.html free music to download :: http://www.fixgrout.com/cgi/musicpage31.html free ipod music downloads sites :: http://mywebpage.netscape.com/music5site/download-music.htm free mp3 downloads :: http://www.fixgrout.com/cgi/musicpage17.html music downloads pc :: http://idisk.mac.com/fmp3musicdownloads/Public/music.html free music :: http://mywebpage.netscape.com/free5mp3/mp3music.html download music free ::
    free mp3 .. free download music .. free mp3 .. free limewire .. free mp3 music downloads .. free mp3 .. music download free ..