|
論壇說明 |
歡迎您來到『史萊姆論壇』 ^___^ 您目前正以訪客的身份瀏覽本論壇,訪客所擁有的權限將受到限制,您可以瀏覽本論壇大部份的版區與文章,但您將無法參與任何討論或是使用私人訊息與其他會員交流。若您希望擁有完整的使用權限,請註冊成為我們的一份子,註冊的程序十分簡單、快速,而且最重要的是--註冊是完全免費的! 請點擊這裡:『註冊成為我們的一份子!』 |
|
主題工具 | 顯示模式 |
2004-10-30, 12:55 AM | #1 |
榮譽會員
|
如何用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 |
送花文章: 3,
|