標籤:dhcp pppoe 軟路由 ros
今天先來做一個ROS的簡單實驗,在一般的幾十人的小型公司或幾個人的家中,如果來如何ROS做最基本的上網操作。
知識點:
-
ROS做為做為內網的DHCP Server。
-
ROS做為PPPOE的Client(一般人少會使用ADSL接入)
-
ROS做一個PAT,使內網使用者可以上網。
拓撲圖如下:
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/73/A0/wKiom1YCY-zRO1sKAAGlvUoLYzU474.jpg" title="ros基礎應用.png" alt="wKiom1YCY-zRO1sKAAGlvUoLYzU474.jpg" />
在上面的拓撲圖中,使用一台思科模擬器來類比PPPoE的伺服器,ROS和WinXP分別被安裝在Vmware Workstation虛擬機器中。讀者只需要一台電腦就能完成本實驗。
PPPoE Server配置:
關於PPPoE原理及可以參見筆者另一篇博文http://senyang.blog.51cto.com/3427514/1680155
為方便讀者,以下配置直接複製粘貼進思科模擬器中即可。
enconf thost ISPint lo 0ip add 1.1.1.1 255.255.255.0int f0/0no ip addno shutpppoe enableip local pool ippool 23.1.1.100 23.1.1.200bba-group pppoe global virtual-template 1exit int virtual-template 1ip unnumbered loopback 0peer default ip address pool ippoolppp authentication papexitusername user1 password cisco
ROS基本配置:
ip address add address=192.168.1.1/24 interface=ether3
ROS DHCP Server配置:
[email protected]] ip dhcp-server> setupSelect interface to run DHCP server ondhcp server interface: ether3Select network for DHCP addressesdhcp address space: 192.168.1.0/24Select gateway for given networkgateway for dhcp network: 192.168.1.1Select pool of ip addresses given out by DHCP serveraddresses to give out: 192.168.1.2-192.168.2.254Select DNS serversdns servers: 192.168.1.1Select lease timelease time: 3d[[email protected]] ip dhcp-server>
在WinXP上查看,已經獲得了IP地址。
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/73/A1/wKiom1YCZ0fBcVlfAAE_4BVFl5w666.jpg" title="1.png" alt="wKiom1YCZ0fBcVlfAAE_4BVFl5w666.jpg" />
配置ROS為PPPoE的Client:
interface pppoe-client add interface=ether3 user=user1 password=cisco add-default-=route=yes use-peer-dns=yes disable=no
查看IP地址:
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/73/9E/wKioL1YCaY3xEAeLAADjJ9n5wok509.jpg" style="float:none;" title="2.png" alt="wKioL1YCaY3xEAeLAADjJ9n5wok509.jpg" />
查看路由,有一條預設路由
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/73/A1/wKiom1YCaYzTiEiHAAEFZWvsCYk089.jpg" style="float:none;" title="3.png" alt="wKiom1YCaYzTiEiHAAEFZWvsCYk089.jpg" />
配置NAT:
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/73/9E/wKioL1YCaveisk4iAAD0yAA5TBE792.jpg" title="4.png" alt="wKioL1YCaveisk4iAAD0yAA5TBE792.jpg" />
在沒有配置NAT之前,WinXP不能ping通公網上的1.1.1.1,在配置之後,可以ping通,實驗成功。
這裡在的關鍵字"masquerade"就是PAT,把多個IP地址轉換成一個IP地址。
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/73/9E/wKioL1YCa3LQB-jvAAFpivToumc096.jpg" title="5.png" alt="wKioL1YCa3LQB-jvAAFpivToumc096.jpg" />
更多關於ROS的配置,筆者將慢慢介紹,筆者將同大家一塊學習這一款精典的軟路由。
本文出自 “楊森的IT之路” 部落格,請務必保留此出處http://senyang.blog.51cto.com/3427514/1697531
ROS軟路由:DHCP Server 配置和PPPoE用戶端配置