您现在的位置是:首页
>
配钥匙的机器多少钱 如何在一台机子上配双网卡
如何在一台机子上配双网卡 在这个地址 可以找到最新版的各种 以太网卡的驱动程序的测试版 这些驱动程序一般也包括在了标准的Li ux内核源码包里 cd /u r/ rc/li ux ma

如何在一台机子上配双网卡
在这个地址 可以找到最新版的各种 以太网卡的驱动程序的测试版 这些驱动程序一般也包括在了标准的Linux内核源码包里 cd /usr/src/linux make menuconfig 一开始有一个提示性的问题 Prompt for development and/or inplete code/drivers _________________________ / 图 内核编译时的菜单界面 _________________________/ 回答 Y 就可以了 当然如果你不需要这些测试版的驱动程序最好 下面讲一下如何在一台机子上配双网卡 首先在内核编译的时候 把网卡驱动程序编译成模块 PCI卡可以自动被检测到 ISA卡就要手 工设一下端口和中断 要手工编辑/etc/conf modules 比方说你有两块NE 兼容网卡 ___________________________ / /etc/conf modules alias eth ne alias eth ne options ne io= x x ___________________________/ 这个顺序就是按照eth eth 下来的 还有一个方法就是把网卡驱动程序编译进内核 那么为了让Linux识别两块网卡 就要在LILO上 做手术 ________________________________________________ / /etc/nf append= ether= x eth ether= x eth ________________________________________________/ ____________________________________ / 图 dmesg显示的和以太网卡相关的内容 ____________________________________/ =>设置域名服务器 对于拨号用户来说 需要的是缓存域名服务 先来配置/etc/nf 这是named启动的时候要用到的 ________________________________________________________________________ / // Config file for caching only name server options { directory /var/named ; // 这是named的缺省工作目录 // Unmenting this might help if you have to go through a // firewall and things are not working out: // query source port ; }; zone { type hint; file root hints ; }; zone in addr arpa { type master; file pz/ ; }; ________________________________________________________________________/ 接下来是/var/named/root hints 这其实就是世界各地的根域名服务器 _____________________________________________________________ / D IN NS G ROOT SERVERS NET D IN NS J ROOT SERVERS NET D IN NS K ROOT SERVERS NET D IN NS L ROOT SERVERS NET D IN NS M ROOT SERVERS NET D IN NS A ROOT SERVERS NET D IN NS H ROOT SERVERS NET D IN NS B ROOT SERVERS NET D IN NS C ROOT SERVERS NET D IN NS D ROOT SERVERS NET D IN NS E ROOT SERVERS NET D IN NS I ROOT SERVERS NET D IN NS F ROOT SERVERS NET G ROOT SERVERS NET w d h IN A J ROOT SERVERS NET w d h IN A K ROOT SERVERS NET w d h IN A L ROOT SERVERS NET w d h IN A M ROOT SERVERS NET w d h IN A A ROOT SERVERS NET w d h IN A H ROOT SERVERS NET w d h IN A B ROOT SERVERS NET w d h IN A C ROOT SERVERS NET w d h IN A D ROOT SERVERS NET w d h IN A E ROOT SERVERS NET w d h IN A I ROOT SERVERS NET w d h IN A F ROOT SERVERS NET w d h IN A _____________________________________________________________/ 然后是/var/named/pz/ 我们先给出一个例子 __________________________________________________________________________ / @ IN SOA ns linux bogus hostmaster linux bogus ( ; Serial H ; Refresh H ; Retry W ; Expire D) ; Minimum TTL NS ns linux bogus PTR localhost __________________________________________________________________________/ 这就是一个zone file 这里包括有 种 Resource Records SOA Start Of Authority RR NS Name Server RR PTR 第一行上的 @ 就是指nf中这个zone file所对应的本地zone in addr arpa NS RR前面有一个缺省的 @ 没有写出来 NS这行就是说linux bogus域的域名服务器就是ns linux bogus PTR RR这行说明这个zone file所对应的本地zone的 这台机子是localhost SOA RR说明这个zone file所在的机子叫做ns linux bogus 负责人是hostmaster@linux bogus 该zone file的版本号是 ; Serial 最后是/etc/nf ________________________________________________ / search subdomain your domain edu your domain edu nameserver ________________________________________________/ search这行的意思就是 如果你寻找moifa 那么实际上就是moifa your domain edu nameserver就是指定你的域名服务器啦 如果你有其他的域名服务器 可以多加几个nameserver行 下面我们启动named 然后用nslookup来检查一下 是否named已经正常工作了 _______________ / 演示 nslookup _______________/ 接下来我们建立一个公司内部网上的真域名服务 先在nf里加上一个新的zone _____________________________ / zone linux bogus { notify no; type master; file pz/linux bogus ; }; _____________________________/ 下面我们来编辑我们真域名的zone file _______________________________________________________________________________ / @ IN SOA ns linux bogus hostmaster linux bogus ( ; serial todays date + todays serial # H ; refresh seconds H ; retry seconds W ; expire seconds D ) ; minimum seconds; NS ns ; Inet Address of name server MX mail linux bogus ; Primary Mail Exchanger MX mail friend bogus ; Secondary Mail Exchanger; localhost A ns A A ns mail A _______________________________________________________________________________/ 最后我们再来看一下reverse zone 所谓zone 就是把域名转化为ip地址 所谓reverse zone就是 把ip地址转化为域名 __________________________________ / zone in addr arpa { notify no; type master; file pz/ ; }; __________________________________/ ________________________________________________________________________ / @ IN SOA ns linux bogus hostmaster linux bogus ( ; Serial todays date + todays serial H ; Refresh H ; Retry W ; Expire D) ; Minimum TTL NS ns linux bogus PTR gw linux bogus PTR ns linux bogus PTR donald linux bogus PTR mail linux bogus PTR ftp linux bogus ________________________________________________________________________/ =>防火墙 第一步 编译内核 在内核中加入ip masquerade的支持 再安装上ipfwadm这个软件包就可以了 下面就开始动手配置 ______________________________________________________________________________________________ / #!/bin/sh # # /etc/rc d/rc firewall define the firewall configuration invoked from # rc local # PATH=/sbin:/bin:/usr/sbin:/usr/bin ipfwadm I f ipfwadm I p deny ipfwadm I a accept V S / D / ipfwadm I a deny lishixinzhi/Article/program/Oracle/201311/17554 很赞哦! (1047)