現在住的地方,有提供上網....
但是, gateway 及 host ip 在不同 subnet....
設定如下
ex :
ip 為 : 192.168.7.223
netmask : 255.255.255.0
getway : 192.168.0.1
dns : 168.95.1.1
在 windowsXP 下,這樣設定沒有問日題可以正常上網
這是 windowx 的 routing table
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.7.221 1
0.0.0.0 0.0.0.0 192.168.9.1 192.168.9.233 25
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.7.0 255.255.255.0 192.168.7.221 192.168.7.221 20
192.168.7.221 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.7.255 255.255.255.255 192.168.7.221 192.168.7.221 20
192.168.9.0 255.255.255.0 192.168.9.233 192.168.9.233 25
192.168.9.233 255.255.255.255 127.0.0.1 127.0.0.1 25
192.168.9.255 255.255.255.255 192.168.9.233 192.168.9.233 25
224.0.0.0 240.0.0.0 192.168.7.221 192.168.7.221 20
224.0.0.0 240.0.0.0 192.168.9.233 192.168.9.233 25
255.255.255.255 255.255.255.255 192.168.7.221 192.168.7.221 1
255.255.255.255 255.255.255.255 192.168.9.233 10006 1
255.255.255.255 255.255.255.255 192.168.9.233 4 1
255.255.255.255 255.255.255.255 192.168.9.233 192.168.9.233 1
Default Gateway: 192.168.0.1
但是同樣的設定我設定要 dd-wrt && tomato .... fon whatever 我手頭上有的 ap全都不行
在 tomato && dd-wrt 設完後的 routing table 為
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.7.0 * 255.255.255.0 U 0 0 0 vlan1
192.168.9.0 * 255.255.255.0 U 0 0 0 br0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
想請,linux 高手指導該如何設定 routing table 或 iptable
讓dd-wrt or tomato 可以連上網路
thansk
不好意思,
表達能力不太好.
我再講清楚一點,
我們房東給我們用的網路架構有點怪, ip 跟 gateway 是屬於不同的 subnet 如圖
目地可能是防止一些什麼東西,
基本上用, Windows 及 Mac 照這樣設定都可以上網沒有什麼問題,
但當我用這樣設定 6615GT with dd-wrt 或 Tomato 都無法上網
用 telent 連上6615GT ping 192.168.0.1 都 ping 不到
可能需要把routing table 的 default gateway 設成 192.168.0.1 因為,我的 Windows 的 routing table 就是這樣設且可以用.
但在 dd-wrt 的環境下我不會設,用它的 Web GUI 設了,好像也沒有用
有聽人說 iptables 好像也可以達到這個功能,但不知道怎麼設

發現你的電腦有二組 IP 網段
192.168.7.221 255.255.255.255 127.0.0.1 127.0.0.1 20
192.168.9.233 255.255.255.255 127.0.0.1 127.0.0.1 25
你的電腦有二張網卡嗎?
真正能用的 ip 是 192.168.9.233
真正的 gateway 是 192.168.9.1
如果內部網路有某些設備是用 192.168.7.x 的 ip 時
192.168.7.221 這個 ip 只能與內部網段 192.168.7.x 互通
至於 gateway 192.168.0.1 這組是騙人的啦
你永遠到不了 192.168.0.1
0.0.0.0 0.0.0.0 192.168.0.1 192.168.7.221 1 <----- 這行完全沒用
0.0.0.0 0.0.0.0 192.168.9.1 192.168.9.233 25 <------ 真正的 gateway 在此
rowland wrote:
看了你的 routi...(恕刪)
192.168.9.233
是我的 無線網路 沒有對外的
我可以到 192.168.0.1
甚至我用 http://192.168.0.1:1755 (port 用 ip scan掃到)可以連到 router 的 web GUI
我現在正想用暴力法,給它破密碼
C:\Documents and Settings\edwards>ipconfig
Windows IP Configuration
Ethernet adapter 區域連線:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.7.221
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
Ethernet adapter 無線網路連線 8:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.1.143
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
我連到 192.168.0.1 是沒問題的, 請看我的路由
確實透過 192.168.0.1 出去
C:\Documents and Settings\edwards>tracert 140.116.6.12
Tracing route to bbs.ncku.edu.tw [140.116.6.12]
over a maximum of 30 hops:
1 <1 ms <1 ms 1 ms 192.168.0.1
2 1 ms 2 ms 1 ms 210.203.31.158
3 3 ms 1 ms 1 ms 10.26.251.1
4 7 ms 6 ms 7 ms 210.200.111.162
5 7 ms 7 ms 7 ms 211-76-96-253.ebix.net.tw [211.76.96.253]
6 7 ms 7 ms 7 ms 202.169.174.161
7 8 ms 8 ms 7 ms 202.169.174.89
8 14 ms 16 ms 9 ms ncku-76-v20.twaren.net [211.79.60.100]
9 9 ms 9 ms 9 ms 1G-GE-P1.NCKU-NCKUE.twaren.net [211.79.56.26]
10 9 ms 8 ms 8 ms 140.116.243.181
11 9 ms 10 ms 10 ms 140.116.243.198
12 8 ms 9 ms 8 ms bbs.ncku.edu.tw [140.116.6.12]
Trace complete.
rowland wrote:
OK, 我們先將問題...(恕刪)
報告是
C:\Documents and Settings\edwards>ipconfig
Windows IP Configuration
Ethernet adapter 區域連線:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.7.221
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
C:\Documents and Settings\edwards>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x10004 ...xx xx xx xx xx xx ...... Intel(R) 82566MM Gigabit Network Connection
- TVT Packet Filter Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination.........Netmask.................Gateway...........Interface............Metric
.....................0.0.0.0........ 0.0.0.0....................192.168.0.1......192.168.7.221...1
.................127.0.0.0.........255.0.0.0................127.0.0.1..........127.0.0.1...........1
.............192.168.7.0.........255.255.255.0........192.168.7.221..192.168.7.221...20
.........192.168.7.221.........255.255.255.255....127.0.0.1..........127.0.0.1...........20
.........192.168.7.255 ........255.255.255.255....192.168.7.221..192.168.7.221...20
.................224.0.0.0.........240.0.0.0................192.168.7.221..192.168.7.221...20
.....255.255.255.255.........255.255.255.255....192.168.7.221..192.168.7.221....1
Default Gateway: 192.168.0.1
==============================================
你的房東 gateway 的設定是 192.168.0.1 mask 255.255.0.0
所以 gateway 是 class B
因此只要是 192.168.xxx.xxx 的電腦, 都可以連到 gateway.
一般是不會這樣設定網路的, 除非是你的房東故意將學生的電腦分成數個 class B
例如 A group 的學生用 192.168.1.X, B group 的學生用 192.168.2.X
不過我不大相信你那兒有住這麼多的學生, 也有可能是幫房東設定網路的人設錯了也說不定.
除非 gateway 有鎖 mac, 防止有人偷帶電腦來上網, 不然你只要找一組沒人使用的 ip 來用即可.
例如 192.168.100.100