いちいち同じことを設定するのが面倒なので、コピペで済むようまとめてみました。
Switchのセキュリティを確保するための初期設定(C2960-24TT用)
全てのポートをshutdownにし、vlanの割り当てを1から1001に変更、明示的にポートの状態をaccess portにするっていうセキュリティ用の設定
config terminal
vlan 1001
name notuse
exit
interface range fa 0/1-24 , gi0/1-2
shutdown
switchport mode access
switchport access vlan 1001
end
↑ここまでコピペ
Routerのポート同士を接続する
conf t
ip dhcp exclud 192.168.1.254
ip dhcp pool def-pool
network 192.168.1.0 255.255.255.0
default-router 192.168.1.254
end
↑ここまでコピペ
あとはSerialportに192.168.1.254 255.255.255.0を設定してやって、対向のポートでip address dhcpを打ち込んでやればおk
Ethernetでやる場合はクロスケーブルで接続して、Ethernet portにip addressを設定してあげてください。
RouterのGigaPort2つにそれぞれ192.168.1.0/24, 192.168.2.0/24のネットワークを割り当て、さらにdhcpサーバとする
↑こんな構成ですね、ip addressはかなり無駄になってますがとりあえず検証用
conf t
enable secret root
line vty 0 4
password root
login
exit
ip dhcp excluded-address 192.168.1.1
ip dhcp excluded-address 192.168.2.1
int gi0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
int gi0/1
ip address 192.168.2.1 255.255.255.0
no shutdown
exit
ip dhcp pool gi00
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 192.168.1.1
exit
ip dhcp pool gi01
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
dns-server 192.168.2.1
end
↑ここまでコピペ
あとは対向のルータのポートで ip address dhcp or ホストの設定画面で dhcpを選択してあげてください。