史萊姆論壇

史萊姆論壇 (http://forum.slime.com.tw/)
-   網路軟硬體架設技術文件 (http://forum.slime.com.tw/f133.html)
-   -   如何用RouteOS實現ip pnp (http://forum.slime.com.tw/thread131390.html)

psac 2004-10-30 12:55 AM

如何用RouteOS實現ip pnp
 
源起如何實現「網路即插即用」
完成routeos的基本安裝,
以我的機器為例,
更改網路卡名

/interface
set ether1 name=local
set ether2 name=public
enable local
enable public

類BIOSIP的話,設定網路卡IP,因為我做的hotspot,在這裡有台機器在上一級做NAT的,所以外部IP我是用10.4.8.199/24,大家可以在這裡設定成ISP給的IP位址

/ip address
add address="192.168.2.1/24" interface=local
add address="10.4.8.199/16" interface=public

如果是用pppoe撥號則需要

/interface pppoe-client
add name="adsl" user="isp username" password="isp password" mtu=1492 mru=1492 \
interface=public add-default-route=yes use-peer-dns=yes disabled=no
/ip address
add address="192.168.2.1/24" interface=local

增加ip pool

/ip pool
add ranges=192.168.2.1-192.168.2.100 name=local_User_Pool
add ranges=192.168.2.101-192.168.2.200 name=Universal_User_Pool

增加DHCP server

/ip dhcp-server
add name=local interface=local address-pool=local_User_Pool \
dhs-server=192.168.2.1 gateway=192.168.2.1 lease-time=24h netmask=24 wins-server=10.4.1.10

設定正確的DNS

/ip dns
set primary-dns=202.96.134.133 secondary-dns=202.96.128.68

設定正確的DNS cache

/ip dns-cache
set enabled=yes primary-dns=202.96.134.133 secondary-server=202.96.128.68

設定NAT

/ip firewall src-nat
add action=masquerade

在這裡只說明一下大家所說的ip pnp的設定,其它的如hotspot,firewall等的設定就不多說了

/ip hotspot universal
add address-pool=Universal_User_Pool disabled=no interface=local


/ip firewall dst-nat
add dst-address=0.0.0.0/0:53 protocol=udp src-address=192.168.2.0/24:0-65535 \
to-dst-address=192.168.2.1 to-dst-port=53 action=nat

就這麼簡單的設定。下面的客戶端已經可以任意IP上internet了。
如果結合hotspot可以實現類似酒店裡web頁面登入上網的功能。
RouteOS的功能很強大,像輕鬆實現VPN,透明代理等,他原有的的一些小工具也比較好用,像通過ping檢測伺服器狀態並觸發事件,這個是很實用的功能。
歡迎大家交流使用心得。
有個小問題,有個朋友使用RouteOS的pppoe撥號,接入後不能通過FTP下載一些大文件,反覆修改mtu和mru未果,請朋友指教。
可以加一條DNAT,攔截訪問udp53(dns)的請求到你的dns server

dst.port=53
protocol=udp
action=nat
to dst. address=你的routeros ip(如果開了dnscache功能,並且允許remote request)
to dst. ports=53

superxboy 2004-10-30 01:23 AM

這篇看來不錯......來實驗看看


所有時間均為台北時間。現在的時間是 02:08 PM

Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2024, Jelsoft Enterprises Ltd.

『服務條款』

* 有問題不知道該怎麼解決嗎?請聯絡本站的系統管理員 *


SEO by vBSEO 3.6.1