最終的にはPPPoEパススルーも設定し、
クライアント配下のN.Wからもダイアルアップしたい。
コード中の変数は次の通り。
使用する際は適宜変更してください。
【ユーザ1】
アカウント:user1@example.local
パスワード:user1
固定IP:20.0.0.10
【ユーザ2】
アカウント:user2@example.local
パスワード:user2
固定IP:20.0.0.20
【ユーザ3】
アカウント:user3@example.local
パスワード:user3
固定IP:20.0.0.30
【ユーザ4】
アカウント:user4@example.local
パスワード:user4
固定IP:20.0.0.40
!! ! AAAの設定 !! aaa new-model aaa authentication ppp PPP local aaa authorization network default local ! aaa attribute list USER1_LIST attribute type addr 20.0.0.10 service ppp protocol ip exit aaa attribute list USER2_LIST attribute type addr 20.0.0.20 service ppp protocol ip exit aaa attribute list USER3_LIST attribute type addr 20.0.0.30 service ppp protocol ip exit aaa attribute list USER4_LIST attribute type addr 20.0.0.40 service ppp protocol ip exit ! username user1@example.local password 0 user1 username user1@example.local aaa attribute list USER1_LIST username user2@example.local password 0 user2 username user2@example.local aaa attribute list USER2_LIST username user3@example.local password 0 user3 username user3@example.local aaa attribute list USER3_LIST username user4@example.local password 0 user4 username user4@example.local aaa attribute list USER4_LIST !! ! PPPoEサーバの設定 !! interface Virtual-Template9 ip address 20.0.0.254 255.255.255.0 ppp authentication chap PPP exit ! bba-group pppoe group-9 virtual-template 9 exit ! interface Vlan9 pppoe enable group group-9 exit ! interface GigabitEthernet0/0 switchport access vlan 9 exit interface GigabitEthernet0/1 switchport access vlan 9 exit interface GigabitEthernet0/2 switchport access vlan 9 exit interface GigabitEthernet0/3 switchport access vlan 9 exit]]>
実際にそのようなコマンドが存在するのか確認しようと思いましたが、
そもそもこのSlingboxは外部と接続する必要がないので遮断してみました。
VPNで接続するため内部通信は可能です。
===説明追記ここから===
コンフィグを流すルータはciscoのC841M-4X-JSEC/K9。
Slingboxが繋がっているネットワークは192.168.82.254/24。
SlingboxのIPは192.168.82.148で固定する。
別拠点のネットワークからもアクセスしたいので192.168.0.0/16で許可している。
家庭用ルータの一例を別記事に記載しました。
【(家庭用ルータで)Slingboxを外部ネットワークから遮断する】
===説明追記ここまで===
ip dhcp pool SlingBox host 192.168.82.148 255.255.255.0 client-identifier 0100.0dc5.MACA.DD client-name SlingBox default-router 192.168.82.254 dns-server 192.168.82.254 lease infinite ! ip access-list extended Vlan82_Out permit ip 192.168.0.0 0.0.255.255 host 192.168.82.148 deny ip any host 192.168.82.148 permit ip any any !
これでうまくいくと良いな
もしポート開放で接続に成功している人がおられましたら
そのポート以外を遮断してみては如何でしょうか?
今回の環境ではWAN回線とそれに伴うN.Wが2つ存在しています。
192.168.28.0/24 (IPoE)
192.168.29.0/24 (PPPoE)
基本的に各端末は28のN.Wに属しています。
IPoEはIPv4アドレスを共有しているので希望するポートを開けられません。
ですので外部からのアクセスはPPPoEから入ってくるように構築しています。
PPPoEでダイアルアップしている端末はciscoのC841M。
VLANで192.168.28.253を設定し28のN.Wに属しています。
この時のデフォルトゲートウェイは192.168.28.254
WOLで起こしたい端末は、192.168.28.105とします。
この環境で起こっていた現象は次の通り。
・LANからWOLは成功
・VPNで外部からWOLは成功
・105をシャットダウンしてしばらくはWANからのWOLも成功
3番目の症状からルータがARP情報をクリアしてしまうのが原因と推測し
ルータにARP情報を教えてあげました。
登録する情報は次の通り
IPアドレス:192.168.28.105
MACアドレス:AB-CD-EF-12-34-56
arp 192.168.28.105 ABCD.EF12.3456 ARPA
前から残っていたコンフィグ
interface Vlan28 ip directed-broadcast 101 ! interface Dialer1 ip directed-broadcast 101 ! ip nat inside source static udp 192.168.28.105 9 interface Dialer1 9 access-list 101 permit udp any any eq 9]]>
# do sh hosts | include hoge hoge.com None (temp, OK) 0 IP XXX.XXX.XXX.XXX
こうなってしまうとip host HOGE~を打ち込んでもpermになってくれません。
なので一時エントリーをクリアします。
# do clear host HOGE
このあとip hostでアドレスを登録します
# ip host HOGE 192.168.0.0
これでshow hostsした時にpermになっているのが確認できると思います。
]]>C841M
RTX1220
C841M
crypto isakmp policy 10 encr 3des authentication pre-share group 2 lifetime 28800 exit ! crypto isakmp key XKXt93CwB3QGq9p5 address 0.0.0.0 0.0.0.0 ! crypto ipsec transform-set RTX-TS esp-3des esp-sha-hmac mode tunnel ! crypto ipsec profile RTX-IPSEC-PROFILE set transform-set RTX-TS ! interface Tunnel 20 ip address 10.28.15.9 255.255.255.252 tunnel source Dialer1 tunnel destination yamaha-rtx1220.hoge0.netvolante.jp tunnel mode ipsec ipv4 tunnel protection ipsec profile RTX-IPSEC-PROFILE exit ! ip route 192.168.151.0 255.255.255.0 10.28.15.10 ! event manager applet TUNNEL-DDNS-EMA event timer cron name TUNNEL-DDNS-ETC cron-entry "* * * * *" action 1.0 cli command "enable" action 1.1 cli command "conf t" action 1.2 cli command "int Tunnel20" action 1.3 cli command "tunnel destination yamaha-rtx1220.hoge0.netvolante.jp" exit !
RTX1220
tunnel select 10 ipsec tunnel 101 ipsec sa policy 101 10 esp 3des-cbc sha-hmac ipsec ike duration ipsec-sa 10 3600 ipsec ike duration isakmp-sa 10 28800 ipsec ike encryption 10 3des-cbc ipsec ike group 10 modp1024 ipsec ike hash 10 sha ipsec ike keepalive use 10 on icmp-echo 10.28.15.9 ipsec ike local id 10 192.168.151.0/24 ipsec ike pre-shared-key 10 text XKXt93CwB3QGq9p5 ipsec ike remote address 10 cisco-c841m.hoge0.mydns.jp ipsec ike remote id 10 192.168.128.0/24 ip tunnel tcp mss limit 1350 ip tunnel address 10.28.15.10/30 tunnel enable 10 ipsec use on ipsec auto refresh on ip route 192.168.128.0/24 gateway tunnel 10 nat descriptor masquerade static 1000 1 10.28.15.10 udp 500 nat descriptor masquerade static 1000 2 10.28.15.10 esp # フィルタを設定している場合は、適切な所に追加してください。 ip filter 300101 pass * 10.28.15.10 udp * 500 ip filter 300102 pass * 10.28.15.10 esp pp select 1 ip pp secure filter in ***** ***** ***** 300101 300102 ***** *****]]>
Vlan10(G0/0)に接続してきたクライアントにIPv6を割り当てます。
ip dhcp excluded-address 192.168.10.201 192.168.10.254 ip dhcp pool pool-vlan10 network 192.168.10.0 255.255.255.0 default-router 192.168.10.254 dns-server 192.168.10.254 lease 0 0 1 exit ! ipv6 dhcp pool DHCP10v6 address prefix 2001:FE80::10:0/112 domain-name dhcp10v6.local exit ! int Vlan10 ip address 192.168.10.254 255.255.255.0 ip nat inside ipv6 address 2001:FE80::10:1/112 ipv6 nd prefix 2001:FE80::10:0/112 14400 14400 no-autoconfig ipv6 dhcp server DHCP10v6 exit ! int G0/0 switchport access vlan 10 no shut exit ! ! ! username user@example.local password 0 user ! interface Loopback10 ip address 20.20.10.254 255.255.255.255 exit ! ip local pool PPPoE-POOL-10 20.20.10.1 ! interface Virtual-Template10 mtu 1454 ip unnumbered Loopback10 peer default ip address pool PPPoE-POOL-10 ppp authentication chap ppp ipcp dns 20.20.10.254 exit ! bba-group pppoe PPPoE-GROUP-10 virtual-template 10 exit ! interface Vlan10 pppoe enable group PPPoE-GROUP-10 exit]]>
username user1@example.local password 0 user1 username user2@example.local password 0 user2 ! interface Loopback10 ip address 20.20.10.254 255.255.255.255 exit ! ip local pool pool-10 20.20.10.1 ! interface Virtual-Template10 mtu 1454 ip unnumbered Loopback10 peer default ip address pool pool-10 ppp authentication chap ppp ipcp dns 20.20.10.254 ! bba-group pppoe group-10 virtual-template 10 ! interface Vlan10 pppoe enable group group-10 ! interface GigabitEthernet0/0 switchport access vlan 10 ! ! interface Loopback20 ip address 20.20.20.254 255.255.255.255 exit ! ip local pool pool-20 20.20.20.1 ! interface Virtual-Template20 mtu 1454 ip unnumbered Loopback20 peer default ip address pool pool-20 ppp authentication chap ppp ipcp dns 20.20.20.254 ! bba-group pppoe group-20 virtual-template 20 ! interface Vlan20 pppoe enable group group-20 ! interface GigabitEthernet0/1 switchport access vlan 20 # 以下NAT ip nat inside source list 1 interface GigabitEthernet0/5 overload access-list 1 permit 20.20.10.0 0.0.0.255 access-list 1 permit 20.20.20.0 0.0.0.255]]>
ipv6 unicast-routing ipv6 cef ! ipv6 dhcp pool DHCP30v6 address prefix 2001:FE80:30::/112 domain-name stateful.local exit ! interface Vlan30 ipv6 address 2001:FE80:30::1/112 ipv6 nd prefix 2001:FE80:30::/112 14400 14400 no-autoconfig ipv6 nd managed-config-flag ipv6 dhcp server DHCP30v6 exit ! ipv6 dhcp pool DHCP40v6 address prefix 2001:FE80:40::/112 domain-name stateful.local exit ! interface Vlan40 ipv6 address 2001:FE80:40::1/112 ipv6 nd prefix 2001:FE80:40::/112 14400 14400 no-autoconfig ipv6 nd managed-config-flag ipv6 dhcp server DHCP40v6 exit !]]>
line vty 0 4 exec-timeout 60 0
exec-timeout <min> <sec>
]]>Cisco ルータを PPPoE サーバにするにはを参考にしました。
テスト構成は次の通り
既存のネットワークは無視しても良かったのだが、
気分的にWANに出てみたかったので接続した。
PPPoEサーバのGE0/0とGE0/1でPPPoEを受け付け
PPPoEクライアントにL2TPテスト用にGE0/3を使う事にした。
# 既存のN.W ip name-server 192.168.28.254 ! interface GigabitEthernet0/5 ip address 192.168.28.221 255.255.255.0 ip nat outside ip virtual-reassembly in duplex auto speed auto ! ip nat inside source list 1 interface GigabitEthernet0/5 overload ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/5 # 仮想WAN環境 ip dhcp excluded-address 20.20.21.201 20.20.21.254 ! ip dhcp pool virtual-wan network 20.20.21.0 255.255.255.0 default-router 20.20.21.254 dns-server 20.20.21.254 lease 0 2 ! interface GigabitEthernet0/3 switchport access vlan 200 no ip address ! interface Vlan200 ip address 20.20.21.254 255.255.255.0 ip nat inside ip virtual-reassembly in ! access-list 1 permit 20.20.21.0 0.0.0.255 # PPPoE username user@example.local password 0 user ! bba-group pppoe GROUP1 virtual-template 1 bba-group pppoe GROUP2 virtual-template 2 ! interface Loopback0 ip address 20.20.20.254 255.255.255.255 ! interface GigabitEthernet0/0 switchport access vlan 10 no ip address interface GigabitEthernet0/1 switchport access vlan 20 no ip address ! interface Virtual-Template1 mtu 1454 ip unnumbered Loopback0 peer default ip address pool POOL1 ppp authentication chap ppp ipcp dns 20.20.20.254 interface Virtual-Template2 mtu 1454 ip unnumbered Loopback0 peer default ip address pool POOL2 ppp authentication chap ppp ipcp dns 20.20.20.254 ! interface Vlan10 no ip address ip nat inside ip virtual-reassembly in pppoe enable group GROUP1 interface Vlan20 no ip address ip nat inside ip virtual-reassembly in pppoe enable group GROUP2 ! ip local pool POOL1 20.20.20.211 ip local pool POOL2 20.20.20.212 !
これでPPPoEクライアントから接続するとPOOL1とPOOL2のIPが割り当てられる。
だがWANに出られなかった。
アクセスリストも書いているし、NATも有効なのになぜだ!?
はい・・・
既存のネットワークにルーティングテーブルを記述していませんでした。
既存のNWの841M
ip route 20.20.20.0 255.255.255.0 192.168.28.221
ちな、現在接続中の一覧を見るときのコマンド
show ppp all]]>