最終的には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]]>
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]]>
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]]>
今回SoftBankのIPv6高速ハイブリッドIPv6 IPoE+IPv4(以降IPoE)を契約した。
このIPoEはBBユニットを必ず使用しなければならなかった。
しかも、ルーティングテーブルはかけないしろもの。
さすが、クSoftBan(ry
と言う事で841Mで何とかしてみた。
VLANの第4オクテットの101-150は固定IPで使用、
151-200はDHCPで使用しているので、これらのみIPoE経由でWANに出たい。
残りのアドレスは今まで通りPPPoE経由でWANに出す。
接続はHGWからBBユニット(WAN)と841M(GE0/5)にそれぞれ接続する。
BBユニット(LAN)から841M(GE0/4)に接続する。
841Mに設定されているVLANは28。
まずは、IPoE経由で出たいアドレスをアクセスリストで許可する。
ip access-list extended A-IPoE 10 deny ip any 192.168.0.0 0.0.255.255 20 deny ip 192.168.28.96 0.0.0.3 any 21 deny ip 192.168.28.100 0.0.0.0 any 22 permit ip 192.168.28.96 0.0.0.31 any 23 permit ip 192.168.28.128 0.0.0.63 any 24 permit ip 192.168.28.192 0.0.0.7 any 25 permit ip 192.168.28.200 0.0.0.0 any 30 deny ip 192.168.28.0 0.0.0.255 any exit ip access-list resequence A-IPoE 10 10
ルートマップを作成する
route-map R-IPoE permit 10 match ip address A-IPoE set ip next-hop 192.168.27.254 set interface GigabitEthernet0/4 exit
BBユニット向けにNATを構築
interface GigabitEthernet0/4 ip nat outside exit ! interface Vlan28 ip nat inside exit ! ip nat inside source list A-IPoE interface GigabitEthernet0/4 overload
VLANにルートマップを適用する
interface Vlan28 ip policy route-map R-IPoE exit]]>
do copy running-config flash:cpconfig-200807.1.cfg do copy running-config usbflash0:cpconfig-200807.1.cfg ! ! bridge crb ! interface GigabitEthernet0/1 switchport access vlan 24 ! interface Vlan24 bridge-group 1 ! interface GigabitEthernet0/5 bridge-group 1 bridge-group 1 input-type-list 200 ! ! PPPoE パススルー access-list 200 permit 0x8863 0x0000 access-list 200 permit 0x8864 0x0000 bridge 1 protocol ieee bridge 1 route ip do wr do copy running-config flash:cpconfig-200807.2.cfg do copy running-config usbflash0:cpconfig-200807.2.cfg]]>