會員 | 請問兩個網卡如何區分一個對外一個對內呢...?? 請問一下.. 我的係統是FEDORA LINUX 並在電腦上裝了兩個網卡(eth0和eth1)想架DHCP.. 我把eth0啟動當對外..連上網路後是正常的.. 那我把eth1也啟動了但不管是設自動取得或是給虛擬固定ip 網路就會斷.. 我該怎麼讓linux知道說eth0是對外..eth1是對內呢..?? |
回覆 |
Kree | redhat-config-securitylevel [eth1]流量全部允許 |
回覆 |
會員 | 啊...有點看不懂哩.. 是不是可以講明白一點啊...?? |
回覆 |
www.ublink.org | 對內那片網卡不要填Gateway |
回覆 |
會員 | 我剛剛重新作了一次dhcp設定... 我簡略的說一下我的設定方式.. 我的電腦有兩張網卡 分為eth0跟eth1 eth1拿來對外 eth0拿來對內... eth1對外-->接固定實體ip-->203.69.150.xxx 子網路遮罩---->255.255.255.xxx 預設閘道------>203.69.150.xxx dns伺服器----->168.95.1.1 eth0對內-->接固定虛擬ip-->192.168.1.254 子網路遮罩---->255.255.255.0 預設閘道------>192.168.1.254 dns伺服器----->168.95.1.1 那我的/etc/dhcpd.conf的檔案內容如下 default-lease-time 259200; max-lease-time 518400; option domain-name "dns.pertbook.com.tw"; option domain-name-servers 168.95.1.1,139.175.10.20; ddns-update-style interim; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.50 192.168.1.100; option broadcast-address 192.168.1.255; option routers 192.168.1.254; } 而我的/etc/rc.d/init.d/dhcpd的檔案內容如下 #!/bin/sh # # dhcpd This shell script takes care of starting and stopping # dhcpd. # # chkconfig: - 65 35 # description: dhcpd provide access to Dynamic Host Control Protocol. # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network . /etc/sysconfig/dhcpd # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -f /usr/sbin/dhcpd ] || exit 0 [ -f /etc/dhcpd.conf ] || exit 0 [ -f /var/lib/dhcp/dhcpd.leases ] || exit 0 RETVAL=0 prog="dhcpd" start() { # Start daemons. echo -n $"Starting $prog: " daemon /usr/sbin/dhcpd ${DHCPDARGS} CONFIGFILE="/etc/dhcpd.conf" LEASEFILE="/var/lib/dhcp/dhcp.lease" INTERFACES="eth0" OPTION="-q" RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd return $RETVAL } stop() { # Stop daemons. echo -n $"Shutting down $prog: " killproc dhcpd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcpd return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) stop start RETVAL=$? ;; condrestart) if [ -f /var/lock/subsys/dhcpd ]; then stop start RETVAL=$? fi ;; configtest) dhcpd -t RETVAL=$? ;; status) status dhcpd RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|configtest|status}" exit 1 esac exit $RETVAL ===================================================================================================== 再設完了以上的動作之後.. 我也執行了touch /etc/dhcpd.lease 再執行 service dhcpd start後 可以正常啟動dhcp 那我的client端是win2000,在設tcp/ip時都設為自動取得後 我在這台win2000下cmd-->ipconfig /all後 所得的資料為 IP Address-------->192.168.1.100 Subnet Mask------->255.255.255.0 Default Gateway--->192.168.1.254 DHCPS Server------>192.168.1.0 DNS Servers------->168.95.1.1 139.175.10.20 Lease Obtained---->2004年15日 下午01:49:28 Lease Expires----->2004年18日 下午01:49:28 到最開ie~~挖...不能上網.... 不知道是我哪設錯...?? 還是有什麼細節我沒注意到的呢...?? 麻煩高手前輩 幫幫忙 看是哪裡出了問題呢...?? |
回覆 |
會員 | 引用:
| |
回覆 |
會員 | 引用:
| |
回覆 |
會員 | 引用:
你的nat啟動了嗎? | |
回覆 |
會員 | eth0對內-->接固定虛擬ip-->192.168.1.254 預設閘道------>192.168.1.254 更改接固定虛擬ip試試 |
回覆 |
GOD | 個人獨斷的偏見: > eth1對外-->接固定實體ip-->203.69.150.xxx > 預設閘道------>203.69.150.xxx 設ISP給的gateway沒錯吧? > dns伺服器----->168.95.1.1 因為對外,請設ISP給的或Hinet/Seednet的PublicDNS如168.95.1.1/139.175.55.244 > eth0對內-->接固定虛擬ip-->192.168.1.254 > 子網路遮罩---->255.255.255.0 > 預設閘道------>192.168.1.254 > dns伺服器----->168.95.1.1 這裡的DNS及DHCPServer都請統一設192.168.1.254 請試試. 以上 |
回覆 |
XML | RSS 2.0 | RSS |
本論壇所有文章僅代表留言者個人意見,並不代表本站之立場,討論區以「即時留言」方式運作,故無法完全監察所有即時留言,若您發現文章可能有異議,請 email :[email protected] 處理。