wiki:Internal/OpenFlow/CLISetup

Version 19 (modified by akoshibe, 15 years ago) ( diff )

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 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)# 
    
  1. 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
    
  1. 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)#
    

 

  1. 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 if the telnet configs worked would get an address from the switch. This was later disabled since hosts on this switch would acquire IP addresses from a designated DHCP server. The commands for making the switch a DHCP server is here.

The right way to flash the switch (6/16)

The specific how-to's are on 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:

UsageportsVLAN
CM1-43
Control5-827
Data9-1228

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
    
  1. 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
    

  1. 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 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 <vlan ID> 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

Port speeds (7/17)

By default, the switch autonegociates. You can change this by going into configuration mode for each port, and changing settings using the speed command. The syntax:

  • speed auto [10|100|1000] - autonegociate. If a speed is specified, the port will be shut down by the switch if the host refuses to negotiate to the set speed.
  • speed [10|100|1000] - sets port to specific speed, no autonegociation

The port should be shut down before changing speed settings. This seems to allow the changes to take immediate effect, even before saving config changes. Each port needs to be configured separately, which makes it a bit 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      

SNMP (8/13)

For a explanation of SNMP: http://en.wikipedia.org/wiki/Simple_Network_Management_Protocol
In the IP8800 guide: http://www.nec.co.jp/ip88n/s36_sw/html/cfguide2/index.html
MIB references: http://www.alvestrand.no/objectid/

Configuring the IP8800

Use of SNMP (Simple Network Management Protocol) is not set by default; you must create access lists with IP addresses allowed to request information as a manager device. In this case, an ACL is created for all the interfaces of SB9, eth1:

!sw-sb09(config)# access-list 1 permit 10.19.0.10 0.0.0.0
!sw-sb09(config)# access-list 1 permit 192.168.100.28 0.0.0.0
!sw-sb09(config)# access-list 1 permit 192.168.1.28 0.0.0.0
!sw-sb09(config)# access-list 1 permit 172.16.100.1 0.0.0.0
!sw-sb09(config)# sh access-list 
access-list 1 10 permit host 10.19.0.10
access-list 1 20 permit host 192.168.100.28
access-list 1 30 permit host 192.168.1.28
access-list 1 40 permit host 172.16.100.1

To add a block of IP's to the ACL, you need the starting IP address and wildcard (range of host addresses available) for that IP block. To add the Network VLAN subnet to the ACL:

access-list 1 50 permit 172.16.0.1 0.0.255.255

to include it in the snmp access list, use the following command:

sw-sb09(config)# snmp-server community "NET" rw 1

where "NET" is the group name, "rw" - read/write, as opposed to "ro", read-only, and "1" is the access list allowed.

Accessing MIBs on the IP8800

accessing it through the switch itsself is easy enough:

sw-sb09# snmp walk 1.3.6.1.2.1.1            

Name: sysDescr.0
Value: ALAXALA AX3640S AX-3640-48T2XW-L [AX3640S-48T2XW] Switching software Ver. 
10.7 [OS-L3L]

Name: sysObjectID.0
Value: ax3640s

Name: sysUpTime.0
Value: 25724205

Name: sysContact.0
Value: 

Name: sysName.0
Value: sw-sb09

Name: sysLocation.0
Value: 

Name: sysServices.0
Value: 78

Elucidation (Or, Frequently asked questions)

As of now, this is just a how-to/list of facts on how to configure the IP8800.

Logging in for the first time.

Assuming you have a brand new IP8800 on your hands:

Telnet is not configured by default, so you need to log in via the console port.

  1. Name your switch. People names are easier to remember than IP addresses or machine-like names i.e. as01-hh-alex, and are easier to use in discussion if everyone agrees on names. Note, the names Bob, Nancy, and Andy are already taken.
  1. Acquire a RS-232 cable - Hook up the cable to the port labeled 'console' on the switch, the other end to your PC.
  1. If not already installed, install kermit on your PC. Kermit is recommended because its default settings can be used to connect to the switch.
  1. Connect via serial using the following commands at the console (Make sure you are root):
     /$ kermit
     C-Kermit>set line /dev/ttyS0
     C-Kermit>set carrier-watch off
     C-Kermit>connect
    

Or, you can use the shorthand for the above:

 kermit -l /dev/ttyS0
 connect

You should then see something like below:

Connecting to /dev/ttyS0, speed 0
 Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.
----------------------------------------------------


login:

If the login prompt doesn't come up, hitting enter should bring it up. The default username is operator, and the password is blank.

Ctrl-\ q ends the kermit session.

Configuration

For configuration, you need to be in privileged mode. The magic word is "enable". "configure" brings you to the configuration prompt, which looks like this :

sw-sb09(config)#

From here, you can enter different contexts according to what you are trying to configure:

  • interface vlan n - create/ configure VLAN n, n being the VLAN ID (some number)
  • interface gigabitethernet 0/n - configure specific port, n being number between 1 and 48
  • line <vty|console> - configure telnet or console parameters, respectively

when in a different context, you can tell from how the prompt becomes "(config-if)."
Ranges of ports and VLANs can be specified. For example, to config ports 1-4 and 30 at once:

 sw-sb09(config)# int range gigabitethernet 0/1-4, gigabitethernet 0/30
 sw-sb09(config-if-range)# 

Note how the prompt becomes "(config-if-range)" in this case.

VLAN creation and port configuration.

In order to do anything with the switch, you need to configure the following two:

  • Virtual interfaces - Also called "VLANs" by the switch. They do function as VLANs in the traditional sense, but in this case, are also associated with IP addresses used by the switch (i.e. the IP address used when telnetting).

  • Ports - By default all ports are assigned to VLAN 1. The ports must be assigned to different VLANs according to how you want the frames to/from the port are handled. Port settings are configured from the interface gigabitethernet 0/n context in configure mode. The three main contexts we need are:

1- switchport mode access - the default port mode. Port is associated with a vlan, but frames from the port are not tagged - the frames are dropped if they are seen on the trunk.

2- switchport mode dot1q-tunnel - frames from the port are tagged upon hitting the trunk and not dropped.

3- switchport mode trunk - port is a trunk and can handle frames from multiple vlans.




Go back to OpenFlow index

Note: See TracWiki for help on using the wiki.