備忘録 NEC IX3110のconfig設定

## 動画で紹介した方法のまとめ
https://www.youtube.com/watch?v=QRw8EyNDW8w
# 構成
Gi0.0をWAN側（ONU）へ接続、残りのGi1.0～Gi3.0を市販のルーターのハブポートのように使いたい
![Samurai_Chop.00_02_18_19.静止画002.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2713165/9a900feb-75a7-3f0d-8cc0-d751de3684ec.jpeg)

## ユーザー作成
初期ユーザーを作成する
```ssh
username <ユーザー名> password plan 1 <パスワード>
```
## モジュールの有効化
DHCP、DNSサーバー機能を有効化する。
また、VBI（仮想ブリッジインターフェース）も有効化する
```ssh
Router(config)#ip dhcp enable
Router(config)#proxy-dns ip enable
Router(config)#bridge irb enable
```

## ppp profileの作成

```ssh
Router(config)#ppp profile web-ppp-gigaethernet0.1
Router(web-ppp-gigaethernet0.1)#authentication myname <接続ID>
Router(web-ppp-gigaethernet0.1)#authentication password <接続ID> <パスワード>
```
## dhcp profileの作成

```ssh
Router(config)#ip dhcp profile my-local-dhcp
Router(my-local-dhcp)#assignable-range 192.168.200.1 192.168.200.254
Router(my-local-dhcp)#dns-server 192.168.200.1
```

## interface GigaEthernet0.1の作成＆設定

```ssh
Router(config)#interface GigaEthernet0.1
Router(interface GigaEthernet0.1)#description WAN1
Router(interface GigaEthernet0.1)#encapsulation pppoe
Router(interface GigaEthernet0.1)#auto-connect
Router(interface GigaEthernet0.1)#ppp binding web-ppp-gigaethernet0.1
Router(interface GigaEthernet0.1)#ip address ipcp
Router(interface GigaEthernet0.1)#ip tcp adjust-mss auto
Router(interface GigaEthernet0.1)#ip napt enable
Router(interface GigaEthernet0.1)#ip napt hairpinning
Router(interface GigaEthernet0.1)#no shutdown
```
## interface BVI1の作成

```ssh
Router(config)interface BVI1
Router(BVI1)ip address 192.168.200.1/24
Router(BVI1)ip proxy-arp
Router(BVI1)ip dhcp binding my-local-dhcp
Router(BVI1)bridge-group 1
Router(BVI1)proxy-dns ip enable
Router(BVI1)no shutdown
```

## Gi1.0~3.0にbridge-group 1に割り当てる

```ssh
Router(config)interface GigaEthernet1.0
Router(interface GigaEthernet1.0)bridge-group 1
Router(interface GigaEthernet1.0)no shutdown

Router(config)interface GigaEthernet2.0
Router(interface GigaEthernet2.0)no ip address
Router(interface GigaEthernet2.0)bridge-group 1
Router(interface GigaEthernet2.0)no shutdown

Router(config)interface GigaEthernet3.0
Router(interface GigaEthernet3.0)no ip address
Router(interface GigaEthernet3.0)bridge-group 1
Router(interface GigaEthernet3.0)no shutdown
```

## default routeの設定
```ssh
Router(config)#ip route default GigaEthernet0.1
```

## config全体

DHCP範囲:192.168.200.1 192.168.200.254
ルーターIPアドレス（DNS）:192.168.200.1の場合
```config
hostname Router2

username <ユーザー名> password plan 1 <パスワード>

ip dhcp enable
bridge irb enable
proxy-dns ip enable
http-server username cat


ppp profile web-ppp-gigaethernet0.1
  authentication myname <接続ID>
  authentication password <接続ID> <パスワード>


ip dhcp profile my-local-dhcp
  assignable-range 192.168.200.1 192.168.200.254
  dns-server 192.168.200.1


interface GigaEthernet0.0
  no ip address
  shutdown

interface GigaEthernet1.0
  bridge-group 1
  no shutdown

interface GigaEthernet2.0
  no ip address
  bridge-group 1
  no shutdown

interface GigaEthernet3.0
  no ip address
  bridge-group 1
  no shutdown

  description WAN1
  encapsulation pppoe
  auto-connect
  ppp binding web-ppp-gigaethernet0.1
  ip address ipcp
  ip tcp adjust-mss auto
  ip napt enable
  ip napt hairpinning
  no shutdown

interface BVI1
  ip address 192.168.200.1/24
  ip proxy-arp
  ip dhcp binding my-local-dhcp
  bridge-group 1
  proxy-dns ip enable
  no shutdown


ip route default GigaEthernet0.1


interface Loopback0.0
  no ip address
!
interface Null0.0
  no ip address
!
web-console system information
  o wan1 GigaEthernet0.1


```