= Configuring the switch through command line interface (CLI) = The IP8800/S3640-48T2XW and IP8800/S3640-24T2XW are the two models of NEC switch that support !OpenFlow. This page is a how-to/log on configuring the IP8800/S3640-48T2XW NEC switch through the CLI. == References == For people literate in Japanese, a complete set of configuration guides may be found in the [http://www.nec.co.jp/ip88n/02.html#manual03 documents section of the NEC website.] == console connection to the switch (6/11) == The switch uses regular RS-232 for the serial connection. The settings for the serial connection are the following: * speed: 9600 * data bits: 8 * stop bits: 1 * Flow control: none * Parity: none Minicom didn't seem to work too well no matter what settings were changed. Kermit was used to connect to the switch because default settings can be used directly and no changes need to be made. After installation (The Debian package is ckermit), use the following commands as root: {{{ C-Kermit>set line /dev/ttyS0 C-Kermit>set carrier-watch off C-Kermit>connect }}} `Ctrl-\ q` ends the kermit session. If the login prompt doesn't show up, pressing enter a couple of times should do the trick. The default username is `operator`, and the password, blank. == Making configuration changes through CLI == A lot of it looks like Cisco IOS. Type `enable` in the prompt to get to privileged mode. The '>' should become a '#'. {{{ > ena # }}} The shorthand of a command can be used. The switch also does command completions when you hit tab. A full list of commands can be seen by typing `?` at the prompt. Commands are often used in compound, so a `?` can be used at any time to see what options are available: {{{ # show interface ? gigabitethernet The type of a port is specified in 10BASE-T/100BASE-TX/1000BASE-T/1000BASE-X line tengigabitethernet The type of a port is specified in 10GBASE-R line }}} To actually configure the switch, you need to be in configuration mode. Type `configure` to enter configuration mode: {{{ # configure (config)# }}} If, at any time, you get confused as to which interface or '' what '' you are even configuring, command `show` will output the name of the interface and the configuration changes made to it so far: {{{ (config-if)# show interface gigabitethernet 0/27 switchport mode access switchport access vlan 4 ! }}} == Telnet access to the switch (6/12) == To telnet to a switch, you need to set up an IP address for the switch. To do this, you need to not only set up a vlan interface to which the IP address belongs, but also permit telnet access. 1. After entering configuration mode, create a vlan. Give it a name if you feel like it. The '!' before the prompt indicates that a change has been made, and you must use the command 'save' before exiting out of config mode to have the configuration changes apply. {{{ (config)# vlan 4 !(config-vlan)# name "telnet" !(config-vlan)# exit !(config)# }}} 2. Assign the port that is to be used for remote access the vlan you just created. the range of ports available save the 10GBe interfaces are 0/1-0/48. {{{ !(config)# interface gigabitethernet 0/27 !(config-if)# switchport mode access !(config-if)# swi acc vlan 4 !(config-if)# exit }}} 3. Assign an IP address and subnet mask to the vlan's interface: {{{ !(config)# interface vlan 4 !(config-if)# ip address 192.168.10.1 255.255.255.0 !(config-if)# exit !(config)# }}}   4. Allow login via telnet. This will limit the number of maximum simultaneous telnet connections to 3. `save` will allow config changes to survive a reboot, and gets rid of the annoying !'s. {{{ !(config)# line vty 0 2 !(config-line)# exit !(config)# !(config)# save (config)# exit # }}} The telnet VLAN (4) was later changed to VLAN 1. == switch as DHCP server == The switch can be a DHCP server, so it was made so the laptop that'll be used to test telnet would get an address from the switch. The commands make it so there is DHCP for group "Test1" on VLAN 1, and an address pool whose lease length is 10 minutes. {{{ !(config)# service dhcp vlan 1 !(config)# ip dhcp excluded-address 192.168.10.1 !(config)# ip dhcp pool Test1 !(dhcp-config)# network 192.168.11.0 255.255.255.0 !(dhcp-config)# lease 0 0 10 }}} == The right way to flash the switch (6/16) == The specific how-to's are on [wiki:Documentation/OpenFlow/Firmware another article], but the general gist is to copy the firmware, license, and configuration files onto a SD card provided by NEC, and cold booting the switch off of it. == VLAN Configuration, based on convention (6/23) == The switch should follow the conventions used in other switches for which port corresponds to which VLAN, where the trunk is, ect. After week 2, the switch was booted back into normal mode (no SD card), and the VLANs statically set according to the following convention for networking SB9: ||Usage||ports||VLAN|| ||CM||1-4||3|| ||Control||5-8||27|| ||Data||9-12||28|| == Static VLAN Configuration == Configuration of the CM VLAN (VLAN 3) is shown here. 1. Create and name VLAN {{{ (config)# vlan 3 !(config-vlan)# name "CM" !(config-vlan)# exit }}} 2. Assign CM VLAN 3 to the desired ports. Unfortunately, you have to configure one port at a time. Luckily, you can use the up arrow key to go through previous commands to make things faster. {{{ !(config)# interface gi 0/1 !(config-if)# switchport mode access !(config-if)# switchport acc vlan 3 !(config)# interface gi 0/2 !(config-if)# switchport mode access !(config-if)# switchport acc vlan 3 !(config)# interface gi 0/3 !(config-if)# switchport mode access !(config-if)# switchport acc vlan 3 !(config)# interface gi 0/4 !(config-if)# switchport mode access !(config-if)# switchport acc vlan 3 }}} 3. After repeating steps 1 and 2 for the Control and Data VLANs (with correct port numbers and VLAN number, of course), configure the trunk ports: {{{ !(config-if)# interface gi 0/45 !(config-if)# switchport mode trunk !(config-if)# switchport trunk allowed vlan 3,27,28 !(config-if)# interface gi 0/46 !(config-if)# switchport mode trunk !(config-if)# switchport trunk allowed vlan 3,27,28 !(config-if)# interface gi 0/47 !(config-if)# switchport mode trunk !(config-if)# switchport trunk allowed vlan 3,27,28 !(config-if)# interface gi 0/48 !(config-if)# switchport mode trunk !(config-if)# switchport trunk allowed vlan 3,27,28 !(config-if)# exit !(config)# save (config)# exit }}} == DHCP/BootP relay agent (6/24) == attempt was made but not knowing the DHCP server's address didn't help. Nevertheless, translations on how to set up a relay agent/ IP helper are [wiki:Documentation/OpenFlow/SwitchConfiguration here]. == Native VLAN configuration (6/25) == A native VLAN was set up on the trunk ports so the switch will have an interface that can be assigned an IP address. 1. Make a VLAN. Name the native VLAN. {{{ (config)# vlan 1 (config-vlan)# name "Network" !(config-vlan)# exit }}} 2. Assign static IP address to the interface. we needed to find the switch's IP address with nslookup. This was actually done 7/2, after its MAC address was registered. {{{ !(config-vlan)# interface vlan 1 !(config-if)# ip address 172.16.19.253 255.255.0.0 }}} 3. Configure ports to be trunk ports, then specify the native VLAN {{{ !(config)# interface gi 0/48 !(config-if)# switchport mode trunk !(config-if)# switchport trunk native vlan 1 }}} 4. Specify which VLANs are allowed on the trunk. This includes all VLANs that converge to this trunk, as well as the native VLAN for this trunk. If the port is already made to allow other VLANs, instead of using command `switchport trunk allowed vlan 1,3,27,28` you can just add VLAN 1 by using the `vlan add ` context: {{{ !(config-if)# swi trunk allowed vlan add 1 }}} so now the configurations for port 0/48 look like this: {{{ !(config-if)# sh interface gigabitethernet 0/48 switchport mode trunk switchport trunk allowed vlan 1,3,27-28 switchport trunk native vlan 1 }}} === Setting port speeds (7/17) === The default is autonegociation, but somehow, the nodes weren't connected at 1Gbps. So we had to set the port speeds to 1Gbps. You have to do each port, which is pretty annoying. {{{ sw-sb09(config)# interface gi 0/13 sw-sb09(config-if)# shutdown !sw-sb09(config-if)# 02/06 03:35:48 E3 PORT GigabitEthernet0/13 25011100 1350:000000000000 Port disabled administratively. !sw-sb09(config-if)# speed auto 1000 !sw-sb09(config-if)# no shutdown }}} rinse and repeat for how-many ever ports you want, then `save` at the end. For Control, Data and Trunk the speed was set to auto/1000, and the CM ports only autonegociation was set using the `speed auto` command. [[BR]] [[BR]] [[BR]] [wiki:Documentation/OpenFlow/ Go back to OpenFlow index]