網絡訓練小項目

                    左側擁抱小兔子網絡訓練小項目小兔子右側擁抱

目錄

實訓項目1.. - 3 -

項目背景: - 3 -

項目要求: - 3 -

項目規劃圖.... - 5 -

項目分析:.... - 5 -

項目簡圖:.... - 7 -

項目配置規劃:.... - 7 -

? 服務器配置.... - 7 -

? Linux. - 7 -

? DNS. - 7 -

? DHCP.. - 10 -

? WWW... - 11 -

2 身份驗證登陸網頁.... - 13 -

2 自簽發證書配置.... - 13 -

2 Php.. - 16 -

2 Mysql - 16 -

2 論壇.... - 17 -

? FTP.. - 20 -

? AAA.. - 24 -

? R13.. - 28 -

? SW1.. - 28 -

? 內部網絡測試.... - 30 -

? 外網測試結果.... - 32 -

項目背景:

 

該集團是以工程總承包、房地產開發、設計諮詢、經營生產和資本運作相結合的大型綜合性建築企業集團,具有房屋建築工程、公路工程施工總承包特級資質和市政公用工程、機電安裝、地基與基礎、鋼結構、公路路面、城市軌道交通工程等一批專業總承包一級資質。以工業與民用建築、市政工程、地鐵、高速公路、深基礎工程、機場港口、長輸管線等工程設計、施工、房地產開發和資本經營爲主業,並從事工業生產、物業經營、飯店管理、外經外貿等多種業務。

項目要求:

? 該企業建設有局域網絡,由於機器較多,結構複雜,故採用vlan技術,用於隔離廣播,保證安全,分別建設技術部門valn和市場部門vlan以及服務器vlan

? 服務器vlan中有dhcp(用於向技術部門vlan和市場部門vlan分配ip地址等參數) 、www、ftp以及AAA服務器,該公司建有主站點,論壇,市場分部門站點和技術部門站點

1. 爲了企業網絡的安全,要求內部用戶實現安全接入,採用基於端口的認證技術(802.1x),使用服務器中心的AAA服務器實現集中的身份驗證

2. 爲保證公司的服務器安全穩定的運行,www、dhcp服務器,以及DNS服務器採用linux,FTP、AAA服務器採用windows

3. 在公司前端的路由器上採用SNAT技術接入互聯網絡,爲了規範用戶的上網行爲,在上班時間(每天8:00-20:00)可以使用http訪問internet上的資源,

4. 通過在前端的H3C的路由器上採用DNAT技術,在internet上發佈公司的主站點

5. 在www服務器上建設虛擬主機,主站的域名爲www.cj.com,技術部門網站域名爲tec.cj.com,市場部門網站域名爲mkt.cj.com,論壇爲bbs.cj.com,主站點匿名用戶可以訪問(內部用戶可以訪問,internet用戶也可以訪問),技術部門站點要求使用https進行訪問,利用賬號進行驗證訪問

6. 公司的ftp站點上,存放有公司的公共文檔以及市場部門和技術部門文檔,要求各自部門自能訪問自己的資源

7. 服務器vlan主機數量5臺,技術部門20臺、市場部門30臺,公司的ip段爲192.168.1.0/24 ,要求合理分配地址

項目策劃圖

p_w_picpath

項目分析

1. Vlan劃分: valn5、vlan10、vlan20

Server歸入vlan5、tec技術部歸入vlan10、mkt市場部歸入vlan20

2. 服務器分配:Dns、dhcp、www、搭建於紅帽系統,集於一臺主機。ftp、AAA搭建於windows2003,集於一臺主機。

3. 域名地址:主站點www.cj.com、技術部tec.cj.com、市場部mkt.cj.com、論壇bbs.cj.com。

4. IP地址劃分:

Vlan5

192.168.1.8/29

192.168.1.9-------192.168.1.13

192.168.1.14-----網關

Vlan10

192.168.1.32/27

192.168.1.33------192.168.1.61

192.168.1.62------網關

Vlan20

192.168.1.64/27

192.168.1.65------192.168.1.93

192.168.1.94------網關




5. 設備:linux、windows2003、H3C交換機、H3C路由器、客戶機一臺

6. 端口地址及端口分配:

R13          

E0.5

E0.10

E0.20

E1-----------外網口      

192.168.1.14/29

192.168.1.62/27

192.168.1.94/27

192.168.101.157     

SW1

Server---e1/0/5

R13-------e1/0/24

Tec--------e1/0/10

Mkt-------e1/0/20

Vlan5

Trunk

Vlan10

Vlan20

項目簡圖

p_w_picpath

項目配置規劃

 計算機服務器配置

計算機 Linux

a) 服務器所需要的安裝包:

httpd.i386

httpd-manual.i386

dhcp.i386

mod_ssl.i386

bind.i386

bind-chroot.i386

bind-libs.i386

bind-utils.i386

caching-nameserver.i386

計算機 DNS

[root@server ~]# cd /var/named/chroot/ ////進到這個目錄下會有這四個文件夾

[root@server chroot]# ll

total 24

drwxr-x--- 2 root named 4096 Aug 25 02:59 dev

drwxr-x--- 2 root named 4096 Sep 11 06:37 etc

dr-xr-xr-x 148 root root 0 Sep 11 05:22 proc

drwxr-x--- 6 root named 4096 Aug 25 02:59 var

[root@server chroot]#

[root@server etc]# cd /var/named/chroot/etc/ /////進到這個文件夾會有這個文件

-rw-r----- 1 root named 1195 Jan 6 2009 named.caching-nameserver.conf

[root@server etc]# cp -p named.caching-nameserver.conf named.conf /////對這個文件拷貝爲named.conf

-rw-r----- 1 root named 1423 Sep 11 06:37 named.conf

[root@server etc]# vi named.conf/////對這個文件編輯如下

options {

               listen-on port 53 { any; };

               listen-on-v6 port 53 { ::1; };

               directory "/var/named";

                dump-file "/var/named/data/cache_dump.db";

                 statistics-file "/var/named/data/named_stats.txt";

                memstatistics-file "/var/named/data/named_mem_stats.txt";

              // Those options should be used carefully because they disable port

              // randomization

              // query-source port 53;

              // query-source-v6 port 53;

                       allow-query { any; };

};

                  logging {

                        channel default_debug {

                        file "data/named.run";

                         severity dynamic;

};

};

view localhost_resolver {

                     match-clients { 192.168.1.0/24; };

                     match-destinations { localhost; };

                     recursion yes;

                      include "/etc/named.rfc1912.zones";

};

view localhost_resolver1 {

                      match-clients { any; };

                     match-destinations { localhost; };

                     recursion yes;

zone "cj.com" IN {

                       type master;

                       file "cj1.com.db";

                       allow-update { none; };

          };///////////////////////紅色部分是用於dns解析使其外網可以訪問到內部網站

};

[root@server etc]# vi named.rfc1912.zones /////在裏面添加如下命令

     zone "cj.com" IN {

                  type master;

                 file "cj.com.db";

                 allow-update { none; };

    };

[root@server chroot]# cd /var/named/chroot/var/named/ /////進到這個文件夾

[root@server named]# cp -p localhost.zone cj.com.db ////同樣是拷貝爲cj.com.db最爲數據庫

[root@server named]# cp -p localhost.zone cj1.com.db /////這個是作爲dns分析數據庫是爲外網可以訪問到內部網站

[root@server named]# vi cj.com.db

$TTL 86400

@                 IN SOA ns.cj.com.              root (

                                                         42 ; serial (d. adams)

                                                        3H ; refresh

                                                        15M ; retry

                                                         1W ; expiry

                                                         1D ) ; minimum

                   IN NS               ns.cj.com.

ns                IN A                192.168.1.9

www           IN A                192.168.1.9

tec               IN CNAME      www

mkt             IN CNAME       www

bbs              IN CNAME       www

[root@server named]# vi cj1.com.db ////對這個文件編輯如下

$TTL 86400

  @       IN SOA ns.cj.com.       root (

                                                     42 ; serial (d. adams)

                                                     3H ; refresh

                                                     15M ; retry

                                                       1W ; expiry

                                                     1D ) ; minimum

                 IN NS       ns.cj.com.

ns              IN A          192.168.1.9

www          IN A          192.168.101.157//////////路由外網口

[root@server ~]# service named start ////啓用dns

計算機 DHCP

需要對一個文件進行編輯如下:

[root@server ~]# vi /etc/dhcpd.conf

subnet 192.168.1.8 netmask 255.255.255.248 {

# --- default gateway

                        option routers 192.168.1.14;//////網關地址

                        option subnet-mask 255.255.255.248;

                        option nis-domain "domain.org";

                        option domain-name "domain.org";

                        option domain-name-servers 192.168.1.9;////服務器地址

                         option time-offset -18000; # Eastern Standard Time

#                     option ntp-servers 192.168.1.1;

#                     option netbios-name-servers 192.168.1.1;

# --- Selects point-to-point node (default is hybrid). Don't change this unless

# -- you understand Netbios very well

# option netbios-node-type 2;

range dynamic-bootp 192.168.1.10 192.168.1.13;/////自動分配地址範圍

default-lease-time 21600;

max-lease-time 43200;

# we want the nameserver to appear at a fixed address

                 host ns {

                              next-server marvin.redhat.com;

                              hardware ethernet 12:34:56:78:AB:CD;

                               fixed-address 207.175.42.254;

      }

}

subnet 192.168.1.32 netmask 255.255.255.224 {

# --- default gateway

                           option routers 192.168.1.62;

                           option subnet-mask 255.255.255.224;

                           option nis-domain "domain.org";

                           option domain-name "domain.org";

                           option domain-name-servers 192.168.1.9;

            range dynamic-bootp 192.168.1.33 192.168.1.61;

                     default-lease-time 21600;

                      max-lease-time 43200;

}

subnet 192.168.1.64 netmask 255.255.255.224 {

# --- default gateway

                         option routers 192.168.1.94;

                         option subnet-mask 255.255.255.224;

                         option nis-domain "domain.org";

                        option domain-name "domain.org";

                        option domain-name-servers 192.168.1.9;

                        option time-offset -18000; # Eastern Standard Time

# option ntp-servers 192.168.1.1;

# option netbios-name-servers 192.168.1.1;

# --- Selects point-to-point node (default is hybrid). Don't change this unless

# -- you understand Netbios very well

# option netbios-node-type 2;

range dynamic-bootp 192.168.1.65 192.168.1.93;

default-lease-time 21600;

max-lease-time 43200;

# we want the nameserver to appear at a fixed address

                       host qq {

                                    next-server marvin.redhat.com;

                                       hardware ethernet 12:34:56:78:AB:CD;

                                    fixed-address 207.175.42.254;

                                      }

}

[root@server ~]# service dhcpd start///////啓用dhcp

計算機WWW:需要如下配置

1. 身份驗證

2. 證書頒發

3. Php

4. Mysql

5. 論壇安裝

在這個文件夾下有如下文件

[root@server ~]# cd /etc/httpd/

[root@server httpd]# ll

total 36

drwxr-xr-x 2 root root 4096 Sep 11 05:45 conf

drwxr-xr-x 2 root root 4096 Sep 10 08:56 conf.d

lrwxrwxrwx 1 root root 19 Aug 25 02:08 logs -> ../../var/log/httpd

lrwxrwxrwx 1 root root 27 Aug 25 02:08 modules -> ../../usr/lib/httpd/modules

drwxr-xr-x 9 root root 4096 Sep 10 04:51 phpmyadmin

lrwxrwxrwx 1 root root 13 Aug 25 02:08 run -> ../../var/run

[root@server httpd]# ll conf /////在這個文件夾下有一個httpd.conf就是我們要配置的文件

total 56

-rw-r--r-- 1 root root 34607 Sep 10 09:47 httpd.conf

-rw-r--r-- 1 root root 12958 Nov 12 2008 magic

[root@server httpd]# vi conf/httpd.conf //////對這文件編輯,在文件的最後添加這麼幾行命令

            993 <VirtualHost 192.168.1.9:80>

            994 ServerAdmin [email protected]

             995 DocumentRoot /var/www/html

             996 ServerName www.cj.com

             997 ErrorLog logs/error_log

            998 CustomLog logs/access_log common

            999 </VirtualHost>

           1000 <VirtualHost 192.168.1.9:80>

           1001 ServerAdmin [email protected]

            1002 DocumentRoot /var/www/html/tec

            1003 ServerName tec.cj.com

            1004 ErrorLog logs/tec-error_log

            1005 CustomLog logs/tec-access_log common

            1006 </VirtualHost>

            1007 <VirtualHost 192.168.1.9:80>

                    ServerAdmin [email protected]

              1009 DocumentRoot /var/www/html/mkt

             1010 ServerName mkt.cj.com

             1011 ErrorLog logs/mkt-error_log

              1012 CustomLog logs/mkt-access_log common

              1013 </VirtualHost>

              1014 <VirtualHost 192.168.1.9:80>

               1015 ServerAdmin [email protected]

               1016 DocumentRoot /var/www/html/bbs

               1017 ServerName bbs.cj.com

                      ErrorLog logs/bbs-error_log

                1019 CustomLog logs/bbs-access_log common

                1020 </VirtualHost>

                973 NameVirtualHost 192.168.1.9:80//////同時還要把這一行啓用修改爲這樣

[root@server ~]# cd /var/www/html/ /////進到這個文件夾建一個主頁如下

[root@server html]# vi index.html //////內容任意都可以

[root@server html]# mkdir mkt //////市場部主頁目錄

[root@server html]# mkdir tec ////////技術部主頁目錄

[root@server html]# mkdir bbs //////////論壇主頁目錄

[root@server html]# service httpd start //////啓用www

2 計算機身份驗證登陸網頁:.................

[root@server certs]# vi /etc/httpd/conf/httpd.conf

<Directory />

              293 Options FollowSymLinks

             294 AllowOverride None

            295 </Directory>

307 <Directory "/var/www/html">///加密目錄此時改爲/var/www/html/tec

              Options Indexes FollowSymLinks

              328 AllowOverride None/////none要改爲all

              336 </Directory>

設置身份驗證時還要編輯一個文件進到要身份驗證的主目錄

[root@server certs]# cd /var/www/html/tec/

[root@server tec]# vi .htaccess

authuserfile /var/www/html/tec/.htpasswd//存放用戶文件夾

authtype basic

authname "please input your name and password"

require valid-user/////指有效用戶

[root@server tec]# htpasswd -c .htpasswd lisi//第一次創建用戶要加-c 下次不用加

[root@server tec]# ll -a///可以看到隱藏的文件

2 計算機證書配置

root@server ~]# cd /etc/pki/

[root@server pki]# vi tls/openssl.cnf

34 [ algs ]

35 # Algorithm configuration options. Currently just fips_mode

36 fips_mode = no

37

38 ####################################################################

39 [ ca ]

40 default_ca = CA_default # The default ca section

41

42 ####################################################################

43 [ CA_default ]

44

45 dir = ../../CA # Where everything is kept

46 certs = $dir/certs # Where the issued certs are kep t

47 crl_dir = $dir/crl # Where the issued crl are kept

48 database = $dir/index.txt # database index file.

49 #unique_subject = no # Set to 'no' to allow creation of

50 # several ctificates with same s ubject.

51 new_certs_dir = $dir/newcerts # default place for new certs.

52

53 certificate = $dir/cacert.pem # The CA certificate

54 serial = $dir/serial # The current serial number

55 crlnumber = $dir/crlnumber # the current crl number

56 # must be commented out to leave a V1 CRL

57 crl = $dir/crl.pem # The current CRL

58 private_key = $dir/private/cakey.pem# The private key

59 RANDFILE = $dir/private/.rand # private random number file

60

61 x509_extensions = usr_cert # The extentions to add to the c ert

62

63 # Comment out the following two lines for the "traditional"

64 # (and highly broken) format.

65 name_opt = ca_default # Subject Name options

66 cert_opt = ca_default # Certificate field options

67

68 # Extension copying option: use with caution.

69 # copy_extensions = copy

70

71 # Extensions to add to a CRL. Note: Netscape communicator chokes on V2 C RLs

72 # so this is commented out by default to leave a V1 CRL.

73 # crlnumber must also be commented out to leave a V1 CRL.

45 dir = /etc/pki/CA # Where ever

[root@server pki]# cd /etc/pki/CA/

[root@server CA]# ll

total 8

drwx------ 2 root root 4096 Dec 17 2008 private

機構自己的私鑰在private

[root@server CA]# openssl genrsa 1024 &gt;private/cakey.pem   //////產生私鑰放在private的cakey.pem

[root@server CA]# chmod 600 private/*     /////// 使私鑰只有管理員可以訪問所以修改權限

[root@server CA]# openssl req -x509 -new -key private/cakey.pem -out cacert.pem -days 3655          /////產生一個自簽發的證書 :產生公鑰輸出機構證書時間

私鑰公鑰 和證書都已經產生   

然後給站點頒發證書

[root@server CA]# cd /etc/httpd/

[root@server httpd]# mkdir certs

[root@server certs]# openssl genrsa 1024 &gt;httpd.key                   ////////////產生鑰匙

[root@server certs]# chmod 600 httpd.key                              //////////////修改權限

[root@server certs]# openssl req -new -key httpd.key -out httpd.csr                ////////////產生一個請求文件

[root@server certs]# cd /etc/pki/CA/

[root@server CA]# mkdir certs crl newcerts

[root@server CA]# touch index.txt serial           ///////////////產生下一個證書需要現有這些文件

[root@server CA]# echo "01" &gt;serial                ///////////給serial一個值

[root@server CA]# cd /etc/httpd/certs/

[root@server certs]# openssl ca -in httpd.csr -out httpd.crt                ///////////使用請求文件產生證書

[root@server certs]# vi /etc/httpd/conf.d/ssl.conf                       //////////////設置配置文件

112 SSLCertificateFile /etc/pki/tls/certs/localhost.crt

SSLCertificateFile /etc/httpd/certs/httpd.crt                       ////////////////證書位置

119 SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

SSLCertificateKeyFile /etc/httpd/certs/httpd.key                    /////////////放置私鑰的位置

[root@server certs]# service httpd restart                //////////////重啓服務

這個時候還不能頒發證書需要在配置一個文件

[root@server certs]# vi /etc/httpd/conf.d/ssl.conf

128 #SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt

SSLCertificateChainFile /etc/pki/CA/cacert.pem                  /////////////CA證書存放位置 證書鏈

之後就可以安裝此證書

2 計算機Php

php.i386 /////////需要安裝這個軟件包

yum install php

cd /var/www/html/

mv index.html index.php

vi index.php /////////編輯如下就可以看到php頁面的效果

<?php

phpinfo();

?>

打開網頁後如下:

p_w_picpath

2計算機 Mysql

對於mysql需要安裝這兩個軟件包

Mysql        mysql-server

yum install mysql mysql-server

chkconfig --list |grep mysql

mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off

chkconfig mysqld on

mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off

service mysqld start

[root@localhost Server]# netstat -tupln |grep mysql

tcp 0 0 0.0.0.0:3306 0.0.0.0:* LIS                ////////php 和mysql 連接起來還要安裝

yum install php-mysql-5.1.6-27.el5.i386.rpm

vi /var/www/html/index.php             ////////////連接數據庫以root密碼爲空

<?php

$link=mysql_connect('127.0.0.1','root','');

if ($link)

echo "ok";

else

echo "failer";

?> ////////打開主頁出現ok說明連接數據庫成功

2 計算機論壇

在這裏直接用一個現成的論壇軟件包phpwind_GBK_8.3.zip把這個包挪到linux上解壓

unzip phpwind_GBK_8.3.zip

683 cd phpwind_GBK_8.3

mkdir /etc/httpd/bbs

cd upload/

mv * /etc/httpd/bbs/

cd /etc/httpd/bbs/

然後以虛擬機來實現

[root@server bbs]# vi /etc/httpd/conf/httpd.conf

<VirtualHost 192.168.101.27:80>

1022 ServerAdmin [email protected]

1023 DocumentRoot /etc/httpd/html/bbs

1024 ServerName bbs.cj.com

1025 ErrorLog logs/bbs-error_log

1026 CustomLog logs/bbs-access_log common

1027 </VirtualHost>

[root@server bbs]# vi /var/named/chroot/var/named/cj.com.db

bbs IN CNAME www

打開網頁時可能是空白頁需要單擊 網頁上的查看--》編碼--》簡體中文就可以出現

打開之後會有一個安裝須知:

p_w_picpath

需要把這些文件都改爲777屬性

在這之前需

[root@server bbs]# vi /etc/httpd/conf/httpd.conf

把這個給禁用掉

747 AddDefaultCharset UTF-8

[root@server bbs]# cd /etc/httpd/bbs/

[root@server bbs]# chmod -R 777 p_w_upload/ html/ data/

然後開始安裝

安裝後會出現一個系統自己無法刪除需要手動刪除

p_w_picpath

[root@server bbs]# rm install.php

rm: remove regular file `install.php'? y

然後就可登陸到論壇頁面

p_w_picpath

管理員用戶登錄之後的頁面如下:

p_w_picpath

在系統設置裏可以登錄後臺進行管理頁面如下:

p_w_picpath

用管理員賬號登錄後的頁面顯示如下:

p_w_picpath

這裏可以進行站點設置-用戶組權限-帖子審覈-分類信息-公告管理-版塊管理-

可以增加想要的板塊,對論壇信息進行分類等等。

計算機 FTP

ftp服務器設置:

添加ftp在開始à控制面板à添加或刪除à應用程序服務器à詳細信息àinternet 信息服務(IIS)à詳細信息à文件傳輸協議(FTP)服務à確定

打開ftp服務器在默認ftp站點右擊點屬性選ftp站點地址和主目錄如下:

p_w_picpath

點允許匿名連接添加用戶,點擊瀏覽:

p_w_picpath

點擊瀏覽之後,如果知道用戶名可以直接輸入查找,如果不太清楚可以點擊高級,立即查找。所有建立的用戶都可以找到,然後點擊添加。

p_w_picpath

打開ftp服務器在默認ftp站點新建虛擬目錄:技術部和市場部

1.tec 2.mkt 兩個目錄

由於各部門只允許查找各自的部門的所以在建的兩個目錄右鍵點擊屬性,添加權限。以其中的一個爲例:

屬性中的目錄安全性下有授權訪問和拒絕訪問兩種權限。兩種任意一種都可以,根據自己的情況來添加。在這裏選拒絕訪問,下面的除外添加訪問權限,允許以下ip段可以訪問,就是技術部所在的ip段

p_w_picpath

計算機AAA

Windows2003

在這裏就用圖片來顯示AAA服務器的創建和配置:

首先要安裝internet驗證信息服務,在控制面板---添加和刪除----

p_w_picpath

p_w_picpath

p_w_picpath

p_w_picpath

p_w_picpath

p_w_picpath

p_w_picpath

 

 

計算機 R13

[r13]time enable

[r13]clo 11:39:00 10 09 2011

[r13]settr 08:00 20:00

[r13]int e1

[r13-Ethernet0]ip add 192.168.1.254 255.255.255.252 sub

[r13-Ethernet0]int e0.5

[r13-Ethernet0.5]vlan-type dot1q vid 5

[r13-Ethernet0.5]ip add 192.168.1.14 255.255.255.248

[r13-Ethernet0.5]int e0.10

[r13-Ethernet0.10]vlan-type dot1q vid 10

[r13-Ethernet0.10]ip add 192.168.1.62 255.255.255.224

[r13-Ethernet0.10]int e0.20

[r13-Ethernet0.20]vlan-type dot1q vid 20

[r13-Ethernet0.20]ip add 192.168.1.94 255.255.255.224

[r13-Ethernet0.20]ip relay-address 192.168.1.9

[r13-Ethernet0.20]int e0.10

[r13-Ethernet0.10]ip relay-address 192.168.1.9

[r13-Ethernet0.10]int e0.5

[r13-Ethernet0.5]ip relay-address 192.168.1.9

[r13-Ethernet1]ip add 192.168.101.157 24

[r13]acl 3001

[r13-acl-3001]rule special permit tcp source 192.168.1.0 0.0.0.255 destination

ny destination-port equal 80

[r13-acl-3001]rule special permit udp source any destination any destination-por

t equal 53

[r13-acl-3001]rule spe den ip sou any des any

[r13-Ethernet1]nat outbound 3001 interface //////dnat轉換

[r13-Ethernet1]nat ser glo 192.168.101.157 domain in 192.168.1.9 domain udp

[r13-Ethernet1]nat server global 192.168.101.157 www inside 192.168.1.9 www tcp

///dns地址解析使外網可以訪問內網的地址

[r13]ip route-static 0.0.0.0 0.0.0.0 192.168.101.254 preference 60

p_w_picpath

p_w_picpath

計算機SW1

[sw1]vlan 10

[sw1-vlan10]po

[sw1-vlan10]port e1/0/10

[sw1-vlan10]vlan

[sw1-vlan10]vlan 20

[sw1-vlan20]po

[sw1-vlan20]port e1/0/20

[sw1-vlan20]quit

[sw1]int e1/0/24

[sw1-Ethernet1/0/24]port link-type trunk

[sw1-Ethernet1/0/24]port trunk permit vlan all

[sw1]ip route-static 192.168.1.0 24 192.168.100.13/////在交換機上設置指向路由的路由表

///////AAA設置

[sw1]radius scheme cj

[sw1-radius-cj]primary authentication 192.168.1.12/// primary 設置首選RADIUS服務器的IP地址authentication 設置首選RADIUS認證服務器的IP地址

[sw1-radius-cj]accounting optional/// accounting設置計費方式optional 可選計費方

accounting 設置計費方式

accounting-on Accounting-On 報文發送方式

data-flow-format 設置發往RADIUS服務器的流量數據的格式

display 顯示當前系統信息

key 指定RADIUS服務器的共享密鑰

nas-ip 設置RADIUS使用的源地址

ping 檢查網絡連接或主機是否可達

primary 設置首選RADIUS服務器的IP地址

quit 退出當前的命令視圖

retry 設置報文重發的次數

return 退到用戶視圖

save 保存當前有效配置

secondary 設置備份RADIUS服務器的IP地址

server-type 設置RADIUS服務器的類型

state 設置首選/備份RADIUS 認證/計費服務器的狀態

stop-accounting-buffer 使能停止計費報文緩存功能

timer 指定定時器超時參數

tracert 跟蹤到達目的地的路由

undo 恢復缺省值或禁止某一項功能

user-name-format 設置送往RADIUS服務器的用戶名的格式

[sw1-radius-cj]key authentication 123456

[sw1-radius-cj]server-type standard//standard 基於RFC協議的RADIUS服務器

[sw1-radius-cj]user-name-format without-domain

[sw1]domain cj//域名

[sw1-isp-cj]radius-scheme cj///方案名///引用方案

[sw1-isp-cj]access-limit enable 10///enable 啓動接入限制///最大接入數

[sw1-isp-cj]accounting optional

[sw1]dot1x

[sw1]dot1x authentication-method pap////authentication-method 指定系統認證方法pap PAP(密碼認證協議)認證方法

[sw1]user-interface vty 0 4/////vty 虛擬用戶終端接口/欲配置的第一個用戶終端接口// user-interface 配置用戶終端接口

[sw1-ui-vty0-4]authentication-mode scheme//// scheme 利用RADIUS方案進行認證authentication-mode 配置用戶終端接口的認證方式

[sw1]dot1x interface e1/0/1 to e1/0/4 e1/0/6 to e1/0/23

p_w_picpath

計算機內部網絡測試

通過第三方軟件連接來獲取地址—否則獲不到地址:另外在撥之前應該先在AAA服務器建立cj1這個用戶屬性允許撥入--

p_w_picpath

在這裏要在屬性裏設置爲

p_w_picpath

這個說明連接上了,且獲得了地址

p_w_picpath

下面的是在AAA服務器上在事件查看器上獲得這個用戶被授予了訪問權限

p_w_picpath

計算機外網測試結果:ping www.cj.com獲得了外網口地址,並沒有得到內網服務器的地址,說明測試結果ok

p_w_picpath

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章