---
# System prepended metadata

title: 'ネト研 12/8 '

---

# 構築会 2023 12 / 8





<a id="top"></a>

| Router Name | 担当 | 
| -------- | -------- | 
| [TKY](#1)    | 林    | 
| [OSK](#2)  | 木村     | 
| [ISP](#3)    | 明日     | 
| [D1](#4)   | Text     | 
| [D2](#5)  | 柳田     | 
| [core](#6)     | Text     | 


## 担当 log 

# TKY
<a id="1"></a>
```
hostname TKY
ip route 0.0.0.0 0.0.0.0 Dialer 1
crypto isakmp key cisco address 192.168.2.2
!
interface gigabitEthernet 0/1
    no ip add
    pppoe enable
    pppoe-client dial-pool-number 1
     ip mtu 1454
!
# pppoe  client 設定
interface Dialer 1
    ip add negotiated 
    dialer-group 1
    dialer pool 1
    crypto map TKY
!
crypto isakmp policy 1
    encryption 3des
    hash md5
    authentication pre-share 
    group 2
!
crypto map TKY 1 ipsec-isakmp  
    set peer 192.168.2.2 
    match address A-ipsec  
!
ip access-list extended A-ipsec  
    permit ip  192.168.2.0 0.0.0.255 192.168.1.0  

!
dialer-list 1 protocol ip permit 
```

# OSK
<a id="2"></a>
ホストネーム設定
```php
hostname OSK
```

g0/4 コア

```php
int g0/0
ip address 172.16.0.2 255.255.255.0
no shutdown
```

g0/5 インターネット　

```php
int g0/0
ip address 192.168.2.2 255.255.255.0
no shutdown
```

ospf

```php
router ospf 1
network 172.16.0.2 0.0.0.255 area 0
```

pppoe 

```php
interface GigabitEthernet0/5
 no ip address
 duplex auto
 speed auto
 pppoe enable
 pppoe-client dial-pool-number 1
```

```php
interface Dialer1
 ip address negotiated
 ip mtu 1415
 encapsulation ppp
 dialer pool 1
 dialer-group 1
```

### 12月12日
```php
no ip domain-lookup
hostname OSK
```

### pppoeクライアント

[PPPoEクライアント参考設定](https://www.bfoip.net/jirei-PPPoE01.html)

[PPPoEクライアント参考設定2](https://www.infraexpert.com/study/wan14.html#google_vignette)

[PPPoEクライアント参考設定3](https://www.infraexpert.com/study/wan10.html)

[PPPoEクライアント参考設定4](https://www.infraexpert.com/study/wan17.html)

username 設定

```php
username OSK password 0 kimura
```

 
int g0/4のpppoeの設定

```php
int g0/4
pppoe enable
pppoe-client dial-pool-number 1
```

interface Dialer1の設定

```php
interface Dialer1
ip address negotiated
encapsulation ppp
dialer pool 1
dialer-group 1
# mtu 1492は不要だと思ったので入れない
#PPPのCHAP認証で「callin」を指定することでプロバイダ側でのみ認証を行うようになります。
ppp authentication chap callin
ppp chap hostname OSK
ppp chap password kimura
```

dialer-groupが入らないので下のやつを参考

[packertracerでした設定らしい](https://ipcisco.com/lesson/pppoe-configuration-with-packet-tracer/)

- 確認
    
    ```php
    interface Dialer1
     dialer pool 1
     ip address negotiated
     encapsulation ppp
    !
    ```
    

dialer 1

```php
dialer-list 1 protocol ip permit
```

ルーティングを全てdialerに流す

```php
ip route 0.0.0.0 0.0.0.0 dialer 1
```


## ipsec





# ISP 
<a id="3"></a>
```
username akehi@ecc.ac.jp
password akehi
loopback 0 10.1.1.1/32 →大阪につながっている方
loopback 1 10.1.1.2/32 →東京につながっている方

ip local pool pool1 30.1.1.1（大阪）
ip local pool pool2 30.1.1.2（大阪）


interface Virtual-Template1　（大阪）
 mtu 1454
 ip unnumbered Loopback1
 peer default ip address pool pool0
 ppp authentication chap

interface Virtual-Template2　（東京）
 mtu 1454
 ip unnumbered Loopback2
 peer default ip address pool pool1
 ppp authentication chap
 
 bba-group pppoe PPPOE-GROUP1 (大阪)
 virtual-template 1

bba-group pppoe PPPOE-GROUP2　（東京）
 virtual-template 2
```
interface 0/0(大阪)
pppoeをenable
group１を指定

interface 0/1(東京)
大阪と同じこと
group2を指定


```
Building configuration...

Current configuration : 1660 bytes
!
! Last configuration change at 09:54:44 UTC Tue Dec 12 2023
version 15.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ISP
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
memory-size iomem 15
!
!
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
multilink bundle-name authenticated
!
!
!
license udi pid CISCO1921/K9 sn FGL191120HM
!
!
username TKY password 0 hayashi
username OSK password 0 kimura
!
redundancy
!
!
!
!
!
bba-group pppoe TKY-user
 virtual-template 1
!
bba-group pppoe OSK-user
 virtual-template 2
!
!
interface Loopback1
 ip address 192.168.1.1 255.255.255.255
!
interface Loopback2
 ip address 192.168.2.1 255.255.255.255
!
interface Embedded-Service-Engine0/0
 no ip address
 shutdown
!
interface GigabitEthernet0/0
 no ip address
 duplex auto
 speed auto
 pppoe enable group TKY-user
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 pppoe enable group OSK-user
!
interface Virtual-Template1
 mtu 1454
 ip unnumbered Loopback1
 peer default ip address pool TKY-pool
 ppp authentication chap
!
interface Virtual-Template2
 mtu 1454
 ip unnumbered Loopback2
 peer default ip address pool OSK-pool
 ppp authentication chap
!
ip local pool TKY-pool 192.168.1.2
ip local pool OSK-pool 192.168.2.2
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
!
!
!
!
control-plane
!
!
!
line con 0
line aux 0
line 2
 no activation-character
 no exec
 transport preferred none
 transport output pad telnet rlogin lapb-ta mop udptn v120 ssh
 stopbits 1
line vty 0 4
 login
 transport input all
!
scheduler allocate 20000 1000
!
end

ISP(config)#
ISP(config)#
ISP(config)#do show ppp all
Interface/ID OPEN+ Nego* Fail-     Stage    Peer Address    Peer Name
------------ --------------------- -------- --------------- --------------------
Vi2.1        LCP+ CHAP+ IPCP+      LocalT   192.168.2.2     OSK
```

## 12月12日
```php
no ip domain-lookup
hostname ISP
```

### PPPoE

---

```php
no ip domain-lookup
hostname ISP
```

### PPPoE

PPPoEでIPが振られるので削除

[PPPoEの参考設定](https://www.bfoip.net/jirei-PPPoE03.html)

[ip unnumberedについて](https://milestone-of-se.nesuke.com/nw-basic/ip/ip-unnumbered/)

- ip unumbered についてのまとめ
    
    **『2 台のルータ同士を 1 台とみなす技術』言う説明は間違い!!!!!!!**
    
    point-to-point インタフェースにおいて、別のインタフェースから IP を借用することで、IP 空間を節約する技術である。
    

#### userを作成

! ### PPPoEアカウント , パスワードを入力 ##

```php
username TKY password 0 hayashi
username OSK password 0 kimura
```

#### 払い出しのipを作成

! ### PPPoEクライアントに払い出すIPアドレスを定義 ###

```php
ip local pool TKY-pool 192.168.1.2
ip local pool OSK-pool 192.168.2.2
```

#### Loopbackを設定

loopback1(TKY)

```php
int Loopback 1
ip address 192.168.1.1 255.255.255.255
```

loopback2(OSK)

```php
int Loopback 2
ip address 192.168.2.1 255.255.255.255
```

#### Virtual-Template1(OKY)設定

PPPoEサーバの仮想インタフェースと払い出しIPアドレス設定を対応づけ 

```php
int Virtual-Template 1
ip unnumbered Loopback1
peer default ip address pool TKY-pool
ppp authentication chap

```



Virtual-Template2(OSK)

```php
int Virtual-Template 2
ip unnumbered Loopback2
peer default ip address pool OSK-pool
ppp authentication chap
```


#### bba-group を定義し、PPPoEサーバの仮想インタフェースと対応づけ ###

! *** bba-group は仮想インタフェースと物理インタフェースをつなぐ役割 ***

bba-group pppoe TKY-user

```php
bba-group pppoe TKY-user
virtual-template 1
```

bba-group pppoe OSK-user

```php
bba-group pppoe OSK-user
virtual-template 2
```

g0/0/1にTKY-userを紐付け

```php
int g0/0
pppoe enable group TKY-user
no shut
```



g0/0/0にOSK-userを紐付け

```php
int g0/1
pppoe enable group OSK-user
no shut
```

##


# D1
<a id="4"></a>
ipアドレスの設定
```
interface gigabitEthernet 0/0
    ip address 10.0.1.254 255.255.255.0
    no shutdown
    
interface gigabitEthernet 0/1
    ip address 172.16.1.2 255.255.255.0
    no shutdown
```
ospfの設定
```
router ospf 1
    network 172.16.1.2 0.0.0.0 area 0 
    network 10.0.1.254 0.0.0.0 area 1
```

確認
```
interface GigabitEthernet0/0
 ip address 10.0.1.254 255.255.255.0
 duplex auto
 speed auto
!         
interface GigabitEthernet0/1
 ip address 172.16.1.2 255.255.255.0
 duplex auto
 speed auto
~~~~~~~~~~~~
!
router ospf 1
 network 10.0.1.254 0.0.0.0 area 1
 network 172.16.1.2 0.0.0.0 area 0
```


# D2
<a id="5"></a>
ホストネームの設定
```
hostname D2
```
ipアドレスの設定
```
interface gigabitEthernet 0/0
    ip address 10.0.2.254 255.255.255.0
    no shutdown
    
interface gigabitEthernet 0/1
    ip address 172.16.2.2 255.255.255.0
    no shutdown
```
ospfの設定
```
router ospf 1
    network 172.16.2.2 0.0.0.0 area 0 
    network 10.0.2.254 0.0.0.0 area 2  
```

確認
```
interface GigabitEthernet0/0
 ip address 10.0.2.254 255.255.255.0
 duplex auto
 speed auto
!         
interface GigabitEthernet0/1
 ip address 172.16.2.2 255.255.255.0
 duplex auto
 speed auto
~~~~~~~~~~~~
!
router ospf 1
 network 10.0.2.254 0.0.0.0 area 2
 network 172.16.2.2 0.0.0.0 area 0
```





# core 
<a id="6"></a>
IPアドレスを各インターフェースに設定していく
```
int GigaEthernet0.0
Router(config-GigaEthernet1.0)# ip address 172.16.0.1/24
Router(config-GigaEthernet1.0)# no sh
int GigaEthernet1.0
Router(config-GigaEthernet1.0)# ip address 172.16.2.1/24
Router(config-GigaEthernet1.0)# no sh
int GigaEthernet2.0
Router(config-GigaEthernet1.0)# ip address 172.16.1.1/24
Router(config-GigaEthernet1.0)# no sh
```
設定ができたか確認
```
interface GigaEthernet0.0
  ip address 172.16.0.1/24
  no shutdown
!
interface GigaEthernet1.0
  ip address 172.16.2.1/24
  no shutdown
!
interface GigaEthernet2.0
  ip address 172.16.1.1/24
  no shutdown
!
interface GigaEthernet3.0
  no ip address
  shutdown
!
interface Loopback0.0
  no ip address
!
interface Null0.0
  no ip address
```
ip address　の設定は出来てそう

OSPFの設定をしていく
```
Router(config)# ip router ospf 1
Router(config-ospfv2-1)# network 172.16.0.1/24 area 0
Router(config-ospfv2-1)# network 172.16.1.1/24 area 0
Router(config-ospfv2-1)# network 172.16.2.1/24 area 0
```

# 12/12 TKY mitarai
```
interface Ethernet0/0
pppoe enable
pppoe-client dial-pool-number 1

interface Dialer1
ip address negotiated
ip mtu 1492
encapsulation ppp
dialer pool 1
dialer-group 1
ppp authentication chap callin
ppp chap hostname TKY
ppp chap password hayashi
exit

dialer-list 1 protocol ip permit

ip route 0.0.0.0 0.0.0.0 Dialer1
```
```
TKY(config)#do sh ppp all
Interface/ID OPEN+ Nego* Fail-     Stage    Peer Address    Peer Name
------------ --------------------- -------- --------------- --------------------
Vi2          LCP+ IPCP+ CDPCP-     LocalT   192.168.1.1     ISP             
```
```
router ospf 1
network 10.0.3.0 0.0.0.255 area 0
```