FutureNet

NXR,WXRシリーズ

NAT・フィルタ編

4. Web認証設定

4-4. Web認証フィルタ

Web認証フィルタを設定することにより、ある特定のホスト,ネットワーク,インタフェースではWeb認証せずに通信することができます。

 

【 構成図 】

 【 設定データ 】

設定項目 設定内容
LAN側インタフェース ethernet0のIPアドレス 192.168.10.1/24
WAN側インタフェース PPPoEクライアント(ethernet1) ppp0
ppp0のIPアドレス 動的IPアドレス
IPマスカレード 有効
SPIフィルタ 有効
MSS自動調整 オート
IPリダイレクト 無効
ISP接続用ユーザID test1@example.jp
ISP接続用パスワード test1pass
スタティックルート 宛先IP アドレス 0.0.0.0/0
ゲートウェイ(インタフェース) ppp0
Web認証 認証方式 HTTP Basic
強制認証 80番ポート監視(リダイレクト)
転送先URL http://www.centurysys.co.jp
接続許可時間(アイドルタイムアウト) 600秒
ログ取得 有効
ローカル認証用ユーザID test
ローカル認証用パスワード testpass
Web認証フィルタ ルール名 eth0_web_forward-in
eth0_web_forward-in 動作 許可
送信元IPアドレス 192.168.10.10
宛先IPアドレス any
LED AUX1 ppp0アップ時点灯
DNS サービス 有効
FastFowarding 有効

 【 設定例 】

nxr120#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
nxr120(config)#ip web-auth access-list eth0_web_forward-in permit 192.168.10.10 any
nxr120(config)#interface ethernet 0
nxr120(config-if)#ip address 192.168.10.1/24
nxr120(config-if)#ip webauth-filter forward-in eth0_web_forward-in
nxr120(config-if)#exit
nxr120(config)#ip route 0.0.0.0/0 ppp 0
nxr120(config)#interface ppp 0
nxr120(config-ppp)#ip address negotiated
nxr120(config-ppp)#ip masquerade
nxr120(config-ppp)#ip spi-filter
nxr120(config-ppp)#ip tcp adjust-mss auto
nxr120(config-ppp)#no ip redirects
nxr120(config-ppp)#ppp username test1@example.jp password test1pass
nxr120(config-ppp)#exit
nxr120(config)#interface ethernet 1
nxr120(config-if)#no ip address
nxr120(config-if)#pppoe-client ppp 0
nxr120(config-if)#exit
nxr120(config)#system led aux 1 interface ppp 0
nxr120(config)#web-authenticate
nxr120(config-webauth)#authenticate basic
nxr120(config-webauth)#monitor port 80 redirect
nxr120(config-webauth)#redirect-url http://www.centurysys.co.jp
nxr120(config-webauth)#close idle-timeout 600
nxr120(config-webauth)#log enable
nxr120(config-webauth)#account username test password testpass
nxr120(config-webauth)#exit
% restart http-server to apply this setting.
nxr120(config)#exit
nxr120#restart http-server
http-server starting… done
nxr120#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
nxr120(config)#dns
nxr120(config-dns)#service enable
nxr120(config-dns)#exit
nxr120(config)#fast-forwarding enable
nxr120(config)#exit
nxr120#save config

 【 設定例解説 】

1. <Web認証アクセスリスト>
nxr120(config)#ip web-auth access-list eth0_web_forward-in permit 192.168.10.10 any

Web認証アクセスリストを設定します。
Web認証アクセスリスト名をeth0_web_forward-inとし、送信元IPアドレス192.168.10.10のパケットを許可します。
なお、このWeb認証アクセスリスト設定はethernet0インタフェース設定で登録します。
(☞) Web認証アクセスリストを設定しただけではフィルタとして有効にはなりません。フィルタリングしたいインタフェースでの登録が必要になります。

 

2. <LAN側(ethernet0)インタフェース設定>
nxr120(config)#interface ethernet 0
nxr120(config-if)#ip address 192.168.10.1/24

ethernet0インタフェースのIPアドレスを設定します。

nxr120(config-if)#ip webauth-filter forward-in eth0_web_forward-in

Web認証アクセスリストeth0_web_forward-inをwebauth-filterのforward-inフィルタに適用します。

 

3. <スタティックルート設定>
nxr120(config)#ip route 0.0.0.0/0 ppp 0

デフォルトルートを設定します。

 

4. <WAN側(ppp0)インタフェース設定>
nxr120(config)#interface ppp 0
nxr120(config-ppp)#ip address negotiated

ppp0インタフェースのIPアドレスが動的IPアドレスの場合は、negotiatedを設定します。

nxr120(config-ppp)#ip masquerade
nxr120(config-ppp)#ip spi-filter
nxr120(config-ppp)#ip tcp adjust-mss auto
nxr120(config-ppp)#no ip redirects

IPマスカレード、ステートフルパケットインスペクションを有効に設定します。また、TCP MSSの調整機能をオート、ICMPリダイレクト機能を無効に設定します。

nxr120(config-ppp)#ppp username test1@example.jp password test1pass

ISP接続用のユーザIDとパスワードを設定します。

 

5. <ethernet1インタフェース設定>
nxr120(config)#interface ethernet 1
nxr120(config-if)#no ip address
nxr120(config-if)#pppoe-client ppp 0

PPPoEクライアントとしてppp0インタフェースを使用できるように設定します。

 

6. <システムLED設定>
nxr120(config)#system led aux 1 interface ppp 0

ppp0インタフェースのアップ/ダウンをaux1 LEDで表示するように設定します。

 

7. <Web認証設定>
nxr120(config)#web-authenticate
nxr120(config-webauth)#authenticate basic
nxr120(config-webauth)#monitor port 80 redirect

Web認証(Basic認証)を行い、ルータ配下の未認証端末からWEBアクセスした際に、Web認証画面をポップアップし、認証後、指定したURLへ転送します。

nxr120(config-webauth)#redirect-url http://www.centurysys.co.jp

転送するURLを設定します。

nxr120(config-webauth)#close idle-timeout 600

認証で許可されたユーザとの間で、無通信状態になってから600秒経過すると通信を遮断するよう設定します。

nxr120(config-webauth)#log enable

ログの取得を有効にします。

nxr120(config-webauth)#account username test password testpass

ローカル認証用のユーザID、パスワードを設定します。

 

8. <HTTPサーバ再起動>
nxr120#restart http-server

Web認証機能を有効にする場合はHTTPサーバを起動する必要があります。デフォルトではHTTPサーバは起動状態になっていますので、ここではHTTPサーバの再起動を行います。

 

9. <DNS設定>
nxr120(config)#dns
nxr120(config-dns)#service enable

DNSサービスを有効にします。

 

10. <ファストフォワーディングの有効化>
nxr120(config)#fast-forwarding enable

ファストフォワーディングを有効にします。ファストフォワーディングを設定することによりパケット転送の高速化を行うことができます。
(☞) ファストフォワーディングの詳細および利用時の制約については、NXR,WXRシリーズのユーザーズガイド(CLI版)に記載されているファストフォワーディングの解説をご参照ください。

 

【 端末の設定例 】

IP アドレス 192.168.10.100
サブネットマスク 255.255.255.0
デフォルトゲートウェイ 192.168.10.1
DNS サーバ