Vlan 1 に 192.168.2.251/24 を割り当てる例
コマンド
interface Vlan1
ip address 192.168.2.251 255.255.255.0
no shutdown
標準出力
--- System Configuration Dialog ---
Enable secret warning
----------------------------------
In order to access the device manager, an enable secret is required
If you enter the initial configuration dialog, you will be prompted for the enable secret
If you choose not to enter the intial configuration dialog, or if you exit setup without setting the enable secret,
please set an enable secret using the following CLI in configuration mode-
enable secret 0 <cleartext password>
----------------------------------
Would you like to enter the initial configuration dialog? [yes/no]: no
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
*Mar 1 00:25:56.413: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
Switch(config)#
Switch(config)#interface Vlan1
Switch(config-if)# ip address 192.168.2.251 255.255.255.0
Switch(config-if)# no shutdown
確認
ping 192.168.2.251
2つ目のIPをつける方法
ip address 192.168.2.250 255.255.255.0 secondary
注意点
Vlan 1 に 192.168.2.251/24 を割り当てて、
他のVlanに 同じく 192.168.2.251/24 を割り当てることはIOSの制限でできない。
overlaps with