熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

如何在一台機子上配雙網卡

2022-06-13   來源: Oracle 

  在這個地址可以找到最新版的各種
  以太網卡的驅動程序的測試版這些驅動程序一般也包括在了標准的Linux內核源碼包裡
  cd /usr/src/linux
  make menuconfig
  一開始有一個提示性的問題Prompt for development and/or incomplete code/drivers
  _________________________
  /
  圖內核編譯時的菜單界面
  \_________________________/
  回答Y就可以了當然如果你不需要這些測試版的驅動程序最好
  
  下面講一下如何在一台機子上配雙網卡
  首先在內核編譯的時候把網卡驅動程序編譯成模塊PCI卡可以自動被檢測到ISA卡就要手
  工設一下端口和中斷要手工編輯/etc/confmodules比方說你有兩塊NE兼容網卡
  ___________________________
  /
  /etc/confmodules
  
  alias eth ne
  alias eth ne
  options ne io=x x
  
  \___________________________/
  
  這個順序就是按照etheth下來的
  還有一個方法就是把網卡驅動程序編譯進內核那麼為了讓Linux識別兩塊網卡就要在LILO上
  做手術
  ________________________________________________
  /
  /etc/nf
  
  append=ether=xeth ether=xeth
  
  \________________________________________________/
  ____________________________________
  /
  圖dmesg顯示的和以太網卡相關的內容
  \____________________________________/
  
  =>設置域名服務器
  
  對於撥號用戶來說需要的是緩存域名服務
  先來配置/etc/nf這是named啟動的時候要用到的
  ________________________________________________________________________
  /
  // Config file for caching only name server
  
  options {
  directory /var/named; // 這是named的缺省工作目錄
  
  // Uncommenting this might help if you have to go through a
  // firewall and things are not working out:
  
  // querysource port ;
  };
  
  zone {
  type hint;
  file roothints;
  };
  
  zone inaddrarpa {
  type master;
  file pz/;
  };
  \________________________________________________________________________/
  
  接下來是/var/named/roothints這其實就是世界各地的根域名服務器
  _____________________________________________________________
  /
   D IN NS GROOTSERVERSNET
   D IN NS JROOTSERVERSNET
   D IN NS KROOTSERVERSNET
   D IN NS LROOTSERVERSNET
   D IN NS MROOTSERVERSNET
   D IN NS AROOTSERVERSNET
   D IN NS HROOTSERVERSNET
   D IN NS BROOTSERVERSNET
   D IN NS CROOTSERVERSNET
   D IN NS DROOTSERVERSNET
   D IN NS EROOTSERVERSNET
   D IN NS IROOTSERVERSNET
   D IN NS FROOTSERVERSNET
  
  GROOTSERVERSNET wdh IN A
  JROOTSERVERSNET wdh IN A
  KROOTSERVERSNET wdh IN A
  LROOTSERVERSNET wdh IN A
  MROOTSERVERSNET wdh IN A
  AROOTSERVERSNET wdh IN A
  HROOTSERVERSNET wdh IN A
  BROOTSERVERSNET wdh IN A
  CROOTSERVERSNET wdh IN A
  DROOTSERVERSNET wdh IN A
  EROOTSERVERSNET wdh IN A
  IROOTSERVERSNET wdh IN A
  FROOTSERVERSNET wdh IN A
  \_____________________________________________________________/
  
  然後是/var/named/pz/我們先給出一個例子
  __________________________________________________________________________
  /
  @ IN SOA nslinuxbogus hostmasterlinuxbogus (
   ; Serial
  H ; Refresh
  H ; Retry
  W ; Expire
  D) ; Minimum TTL
  NS nslinuxbogus
   PTR localhost
  \__________________________________________________________________________/
  
  這就是一個zone file這裡包括有Resource Records
  SOAStart Of Authority RR
  NSName Server RR
  PTR
  第一行上的@就是指nf中這個zone file所對應的本地zoneinaddrarpa
  NS RR前面有一個缺省的@沒有寫出來NS這行就是說linuxbogus域的域名服務器就是nslinuxbogus
  PTR RR這行說明這個zone file所對應的本地zone的這台機子是localhost
  SOA RR說明這個zone file所在的機子叫做nslinuxbogus負責人是hostmaster@linuxbogus
  該zone file的版本號是 ; Serial
  
  最後是/etc/nf
  ________________________________________________
  /
  search subdomainyourdomainedu yourdomainedu
  nameserver
  \________________________________________________/
  
  search這行的意思就是如果你尋找moifa那麼實際上就是moifayourdomainedu
  nameserver就是指定你的域名服務器啦如果你有其他的域名服務器可以多加幾個nameserver行
  
  下面我們啟動named然後用nslookup來檢查一下是否named已經正常工作了
  _______________
  /
  演示nslookup
  \_______________/
  
  接下來我們建立一個公司內部網上的真域名服務
  先在nf裡加上一個新的zone
  _____________________________
  /
  zone linuxbogus {
  notify no;
  type master;
  file pz/linuxbogus;
  };
  \_____________________________/
  
  下面我們來編輯我們真域名的zone file
  _______________________________________________________________________________
  /
  @ IN SOA nslinuxbogus hostmasterlinuxbogus (
   ; 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 maillinuxbogus ; Primary Mail Exchanger
  MX mailfriendbogus ; Secondary Mail Exchanger;
  localhost A
  ns A
  www A ns
  mail A
  \_______________________________________________________________________________/
  
  最後我們再來看一下reverse zone所謂zone就是把域名轉化為ip地址所謂reverse zone就是
  把ip地址轉化為域名
  __________________________________
  /
  zone inaddrarpa {
  notify no;
  type master;
  file pz/;
  };
  \__________________________________/
  ________________________________________________________________________
  /
  @ IN SOA nslinuxbogus hostmasterlinuxbogus (
   ; Serial todays date + todays serial
  H ; Refresh
  H ; Retry
  W ; Expire
  D) ; Minimum TTL
  NS nslinuxbogus
  
   PTR gwlinuxbogus
   PTR nslinuxbogus
   PTR donaldlinuxbogus
   PTR maillinuxbogus
   PTR ftplinuxbogus
  \________________________________________________________________________/
  
  =>防火牆
  
  第一步編譯內核在內核中加入ip masquerade的支持
  再安裝上ipfwadm這個軟件包就可以了下面就開始動手配置
  ______________________________________________________________________________________________
  /
  #!/bin/sh
  #
  # /etc/rcd/rcfirewall define the firewall configuration invoked from
  # rclocal
  #
  
  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
From:http://tw.wingwit.com/Article/program/Oracle/201311/17554.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.