NBC 頻出

ホスト名の設定

Router(config)#hostname ホスト名

インターフェース有効化

有効化するインターフェース : FastEthernet 0

R1#con t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#
R1(config)#interface FastEthernet 0
R1(config-if)#
R1(config-if)#no shutdown // ここ
R1(config-if)#
*Feb 13 08:12:39.567: %LINK-3-UPDOWN: Interface FastEthernet0, changed state to up
R1(config-if)#

shutdown で無効化

インターフェースのIPアドレス設定

設定するインターフェース : FastEthernet 0

R1(config)#interface FastEthernet 0
R1(contig-it)#
R1(config-if)#ip address 192.168.0.254 255.255.255.0
R1(config-if)#

ip address dhcp とするとDHCPクライアントになる no ip address でIPアドレスを削除する

参考 : https://www.infraexpert.com/study/dhcpz3.html

参考 : https://www.infraexpert.com/study/ciscorouter5.html

DHCP server

プールの名前 : pool-name

DHCPクライアントに割り当てるネットワークアドレス : 192.168.1.0 255.255.255.0

R1#con t
R1(config)#ip dhcp pool pool-name
R1(dhcp-config)#network 192.168.1.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.1.254 // ここにデフォゲ
R1(dhcp-config)#dns-server 1.1.1.1 172.16.1.11 //ここにdns-server
R1(dhcp-config)#lease 0 1

DHCPサービスの有効化

(config)#service dhcp

困った時

リースしてら何とかなりがち

Mac

Windows(プロンプト)

ipconfig /release
ipconfig /renew

参考 : https://www.infraexpert.com/study/dhcpz1.html

NAT

外部インターフェース : gigabitEthernet 0/5

外部ネットワーク : gigabitEthernet 0/5

内部ネットワーク : Vlan1

R1(config)#access-list 1 permit any
R1(config)#ip nat inside source list 1 interface gigabitEthernet 0/5 overload
// outside inside の設定をする
R1(config)#interface gigabitEthernet 0/5
R1(config-if)#ip nat outside

R1(config)#interface Vlan1
R1(config-if)#ip nat inside 

参考 : https://www.infraexpert.com/study/natz2.html

ip route

R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      192.168.101.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.101.0/24 is directly connected, Vlan1
L        192.168.101.1/32 is directly connected, Vlan1
      192.168.200.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.200.0/24 is directly connected, GigabitEthernet0/4
L        192.168.200.1/32 is directly connected, GigabitEthernet0/4



// 192.168.102.0 255.255.255.0 という

static route

R1(config)#ip route 150.100.0.0 255.255.0.0 200.1.1.2

default route

nexthop : 192.168.200.2

R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.200.2

ループバック生やす

R1(config)#interface loopback 0
R1(config-if)#
*Jul 23 04:29:41.382: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip address 192.168.111.1 255.255.255.0

RIP

ディスタンスベクタ型ルーティングプロトコル

R1(config)#router rip
R1(config-router)#network 192.168.101.0
R1(config-router)#network 192.168.200.0
R1(config-router)#network 192.168.102.0

どのインターフェースに出すか

どの口からRIPを聞くか

RIPに乗せるデータはどれか

redistribute

ルート再配布

ripにstaticのルートを再配布させれたりする

参考https://www.infraexpert.com/study/routecontrol03.html

Serial

R1(config)#interface serial0/0/1
R1(config-if)#clock rate 128000

Show

show ip int brief
show run
show ip route

Debug

(やりとりしているパケットの中身を解説してくれる)

debug ip rip

debugコマンドの終了:

undebug all

← Go home