精華區beta Linux 關於我們 聯絡資訊
今天加了一張網路卡想架一個router 當一切都設定好之後..發現 我可以ping到要 client的電腦也可以對外 但用 client的電腦來ping我的主機時確沒辦法ping到.. 所以clinet的電腦還是連不出去... 這是為什麼呢???真的百思不解... 煩請高手解惑...^_^ -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> > -------------------------------------------------------------------------- < 發信人: aboar.bbs@bbs.mgt.ncu.edu.tw (大傻瓜愛妳), 看板: Linux 標 題: Re: router的問題 發信站: 中大資管龍貓資訊天地 (Sat Dec 4 09:29:20 1999) 轉信站: Ptt!news.ntu!ctu-gate!news.nctu!news.ncu!totoro ==> superA.bbs@cis.nctu.edu.tw (Future) 提到: : 今天加了一張網路卡想架一個router : 當一切都設定好之後..發現 : 我可以ping到要 client的電腦也可以對外 : 但用 client的電腦來ping我的主機時確沒辦法ping到.. : 所以clinet的電腦還是連不出去... : 這是為什麼呢???真的百思不解... : 煩請高手解惑...^_^ 是不是沒有ipchains? -- ◎(bbs.mgt.ncu.edu.tw) ◎[aboar]來自: host166.2106232.gcn.net.tw > -------------------------------------------------------------------------- < 發信人: superA.bbs@cis.nctu.edu.tw (Future), 看板: Linux 標 題: Re: router的問題 發信站: 交大資科_BBS (Sat Dec 4 10:39:45 1999) 轉信站: Ptt!news.ntu!ctu-gate!news.nctu!netnews.csie.nctu!news.cis.nctu!cis_nc ==> 在 aboar.bbs@bbs.mgt.ncu.edu.tw (大傻瓜愛妳) 的文章中提到: > ==> superA.bbs@cis.nctu.edu.tw (Future) 提到: > : 今天加了一張網路卡想架一個router > : 當一切都設定好之後..發現 > : 我可以ping到要 client的電腦也可以對外 > : 但用 client的電腦來ping我的主機時確沒辦法ping到.. > : 所以clinet的電腦還是連不出去... > : 這是為什麼呢???真的百思不解... > : 煩請高手解惑...^_^ > 是不是沒有ipchains? 有呀 我打了 ipchains -P forward DENY ipchains -A forward -s 192.168.1.0/255.255.255.0 -j MASQ 還有我後來發現一件事情 就是不論我ping 192.168.1.XXX都ping的到 不過那些ip我跟本都沒設呀...怎麼會這樣????? 呼...弄的好累ㄛ..希望各位高手能幫忙 thx^_^ -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> > -------------------------------------------------------------------------- < 發信人: superA.bbs@cis.nctu.edu.tw (Future), 看板: Linux 標 題: Re: router的問題 發信站: 交大資科_BBS (Sat Dec 4 10:48:46 1999) 轉信站: Ptt!news.ntu!freebsd.ntu!ctu-peer!ctu-gate!news.nctu!netnews.csie.nctu 這是我的一些設定資料 Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.1 * 255.255.255.255 UH 0 0 0 eth1 140.122.196.14 * 255.255.255.255 UH 0 0 0 eth0 192.168.1.0 * 255.255.255.0 U 0 0 0 eth1 140.122.196.0 140.122.196.14 255.255.255.0 UG 0 0 0 eth0 140.122.196.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 140.122.196.254 0.0.0.0 UG 0 0 0 eth0 打ping 192.168.1.4後 PING 192.168.1.4 (192.168.1.4) from 192.168.1.4 : 56 data bytes 64 bytes from 192.168.1.4: icmp_seq=0 ttl=255 time=0.1 ms 64 bytes from 192.168.1.4: icmp_seq=1 ttl=255 time=0.1 ms --- 192.168.1.4 ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max = 0.1/0.1/0.1 ms -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> > -------------------------------------------------------------------------- < 發信人: tbsky.bbs@cis.nctu.edu.tw (sky), 看板: Linux 標 題: Re: router的問題 發信站: 交大資科_BBS (Sat Dec 4 12:07:50 1999) 轉信站: Ptt!news.ntu!freebsd.ntu!news.cis.nctu!cis_nctu ==> 在 superA@cis_nctu (Future) 的文章中提到: > 這是我的一些設定資料 > Kernel IP routing table > Destination Gateway Genmask Flags Metric Ref Use Iface > 192.168.1.1 * 255.255.255.255 UH 0 0 0 eth1 > 140.122.196.14 * 255.255.255.255 UH 0 0 0 eth0 > 192.168.1.0 * 255.255.255.0 U 0 0 0 eth1 > 140.122.196.0 140.122.196.14 255.255.255.0 UG 0 0 0 eth0 > 140.122.196.0 * 255.255.255.0 U 0 0 0 eth0 > 127.0.0.0 * 255.0.0.0 U 0 0 0 lo > default 140.122.196.254 0.0.0.0 UG 0 0 0 eth0 > 打ping 192.168.1.4後 > PING 192.168.1.4 (192.168.1.4) from 192.168.1.4 : 56 data bytes > 64 bytes from 192.168.1.4: icmp_seq=0 ttl=255 time=0.1 ms > 64 bytes from 192.168.1.4: icmp_seq=1 ttl=255 time=0.1 ms > --- 192.168.1.4 ping statistics --- > 2 packets transmitted, 2 packets received, 0% packet loss > round-trip min/avg/max = 0.1/0.1/0.1 ms 你的 ipchains 好像設的怪怪的,記得設完之後看看 ipchains -L 有沒有設對... 你可以如下設定.. /sbin/ipchains -P forward DENY /sbin/ipchains -A forward -j MASQ -s 192.168.1.0/24 -d 0/0 /sbin/insmod ip_masq_ftp echo 1 > /proc/sys/net/ipv4/ip_forward 記得最後要把 forward 功能打開不然 ipchains 的設定是無效的 當然最重要的,client 端的 gateway 一定要指向 192.168.1.1 不然打死都出不去的啊... -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> > -------------------------------------------------------------------------- < 發信人: superA.bbs@cis.nctu.edu.tw (Future), 看板: Linux 標 題: Re: router的問題 發信站: 交大資科_BBS (Sat Dec 4 13:18:09 1999) 轉信站: Ptt!news.ntu!ctu-gate!news.nctu!news.cis.nctu!cis_nctu 我又重打了一次ipchains.... ipchains -L出來的節果 Chain input (policy ACCEPT): hain forward (policy DENY): target prot opt source destination ports MASQ all ------ 192.168.1.0/24 anywhere n/a Chain output (policy ACCEPT): 我不知道這樣算有沒設對耶... 還有ipv4我有開.... 不過到現在還是不能連.. 呼...甲又..!!希望各位高手能多指點...thx:)))) -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> > -------------------------------------------------------------------------- < 發信人: superA.bbs@cis.nctu.edu.tw (Future), 看板: Linux 標 題: Re: router的問題 發信站: 交大資科_BBS (Sat Dec 4 13:58:12 1999) 轉信站: Ptt!news.ntu!freebsd.ntu!ctu-peer!news.nctu!news.iim.nctu!netnews.csie ==> 在 superA@cis_nctu (Future) 的文章中提到: > 我又重打了一次ipchains.... > ipchains -L出來的節果 > Chain input (policy ACCEPT): > hain forward (policy DENY): > target prot opt source destination ports > MASQ all ------ 192.168.1.0/24 anywhere n/a > Chain output (policy ACCEPT): > 我不知道這樣算有沒設對耶... > 還有ipv4我有開.... > 不過到現在還是不能連.. > 呼...甲又..!!希望各位高手能多指點...thx:)))) 剛才發現 forward被deny了 ..所以又把它改成accept不過訊息是這樣 Chain input (policy ACCEPT): Chain forward (policy ACCEPT): target prot opt source destination ports MASQ all ------ 192.168.1.0/24 anywhere n/a MASQ all ------ 192.168.1.0/24 anywhere n/a Chain output (policy ACCEPT): 會有中間那兩行 MASQ的訊息.. 我同學裝好可以用的就沒有那兩行訊息 所以我現在當然還是不能連...呼...再加油 -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> > -------------------------------------------------------------------------- < 發信人: superA.bbs@cis.nctu.edu.tw (Future), 看板: Linux 標 題: Re: router的問題 發信站: 交大資科_BBS (Sat Dec 4 14:41:55 1999) 轉信站: Ptt!news.ntu!feeder.seed.net.tw!ctu-gate!news.nctu!news.cis.nctu!cis_n 我剛解決了....:))) 期實也不太知道為啥...我在interface好像多裝了一個lo:0 我剛把它砍了就沒事了...真高興 還有前面那郭 hain forward (policy DENY): > target prot opt source destination ports > MASQ all ------ 192.168.1.0/24 anywhere n/a 好像是正常的.....不用ACCEPT....嗯.. 呼...裝的好辛苦ㄛ...不過終於裝完了... 裝的過程的一些錯誤經驗...希望會對大家有幫助...:)))) -- * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3> > -------------------------------------------------------------------------- < 發信人: "Riche" <wea@winart.com.tw>, 看板: Linux 標 題: Re: router的問題 發信站: ISnews (Sat Dec 4 03:05:38 1999) 轉信站: Ptt!news.ntu!spring!netnews.hinet.net!news.is.net.tw!not-for-mail 如果您是Clinet要Ping Router的那台電腦Ping不到,但是Router可以Ping到的話,應是網路卡上設定的問題,我的也會啊!!只要我把client的那張網路卡設為100 M的就變成這樣了,我也不知到為什麼,奇怪的是走Netbebi還是可以...真的不懂,所以現在都放在10M這設定上了,真不知買個100M的網路卡和Hub是 為了什麼..... PS我的卡是Dlink 530TX,和一張螃蟹卡8139.client都是Dlink 530Tx.. Future 撰寫於文章 <3Xg5ZP$G1O@bbs.cis.nctu.edu.tw>... > > > 今天加了一張網路卡想架一個router > 當一切都設定好之後..發現 > > 我可以ping到要 client的電腦也可以對外 > 但用 client的電腦來ping我的主機時確沒辦法ping到.. > 所以clinet的電腦還是連不出去... > > 這是為什麼呢???真的百思不解... > 煩請高手解惑...^_^ > >-- > * Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3>