wiki:Internal/OpenFlow/XORP

XorPlus Configs for the Quanta

The switch pointed to boot from the cf card will start up with XorPlus as its default firmware. If the switch is already flashed with the OpenFlow image, just go back into u-boot and point the boot command to the cfcard boot parameters. The following commands set the XorPlus switch up as a regular switch in the Grid's data VLAN (8), with a trunk port on ge-1/1/47 (lower rightmost port) living on native VLAN 1 and a telnet-accessible management interface.

Set management IP address on eth0 (The address used to access the machine via SSH):

XorPlus# set interface management-ethernet eth0 address 172.16.20.253/16

Configuring VLANs and the trunk port:

XorPlus# set vlans vlan-id 8
XorPlus# set interface gigabit-ethernet ge-1/1/47 family ethernet-switching port-mode trunk
XorPlus# set interface gigabit-ethernet ge-1/1/47 family ethernet-switching native-vlan-id 1
XorPlus# set interface gigabit-ethernet ge-1/1/47 family ethernet-switching vlan members 8
XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 1            <<-----------for each interface ge-1/1/1-48

Allow telnet access:

XorPlus# set system services telnet connection-limit 7

save changes:

XorPlus# commit
XorPlus# save running-to-startup

Commands.

  • To power off the switch
    XorPlus> request system power-off 
    
  • To get to the configuration prompt as enabled user - configure
  • for a list of available options for a specific set of commands, type "?" or "help" at any point:
    XorPlus# run ?
    Possible completions:
      clear                         Clear information in the system
      file                          Perform file operations
      ping                          Ping remote target
      request                       Make system-level requests
      set                           Set parameters of the system
      show                          Show system information
      ssh                           Connect to another host via SSH
      start                         Start shell
      syslog                        System logging
      telnet                        Connect to another host via telnet
      traceroute                    Trace route to remote host
    
  • To execute non-config CLI commands from enabled mode, use run <parameters> (choices are shown above)
  • Setting interface parameters - The GBe ports are named ge-1/1/n, n from 1 to 48. To configure them:
    XorPlus# set interface gigabit-ethernet ge-1/1/4 family ethernet-switching <port mode, vlan id, ect. here>
    

Multiport configurations.

XorPlus doesn't seem to let you configure more than one port at a time. This is a pain (e.g. for setting the native vlans for all of the ethernet ports). A quick way to get to config many ports at a time is to echo commands into the serial device (/dev/ttyS0 or /dev/ttyUSB0 - what you used to connect to the switch). For example, to set the vlans for all the interfaces to 8:

At your terminal, as root:

# echo "set vlans vlan-id 8" >> /dev/ttyS0
# for i in `seq 1 48`; do echo "set interface gigabit-ethernet ge-1/1/$i family ethernet-switching native-vlan-id 8"; done >> /dev/ttyS0

Then, at the switch CLI:

XorPlus# set interface gigabit-ethernet ge-1/1/47 family ethernet-switching native-vlan-id 1
XorPlus# set interface gigabit-ethernet ge-1/1/47 family ethernet-switching vlan members 8
XorPlus# commit
XorPlus# save running-to-startup

Two scripts were hacked together to make multi-port configurations a bit easier:

  1. A bash script for range port configurations over serial. It supports a very limited number of configuration schemes:
    • VLAN creation
    • port VLAN/type assignment and deleting configurations
    • management interface configuration
    • "help" or "?" for a list of commands

This script also has to be run as root, and assumes that your serial device is /dev/ttyUSB0. This should be modified accordingly. When run, the script gives you a mock-switch style CLI:

# ./swconf.sh 
> ?
iface [eth0|eth1] [IP addr] - Configure management interface address. Address is in CIDR form (e.g 172.16.0.30/16)
vlan [VLAN ID] - instantiate a VLAN interface of tag [VLAN ID]
ports [min] [max] - Configure VLAN and mode of ports between [min] and [max] inclusive
save - Commit changes to memory
exit - exit script
help - display this list (equivalent to '?')
clear - clear the screen
> ports 2 7
(ports)# ?
vlan [1..1020]: set native vlan for ports
mode [access|trunk]
delete: wipe out port settings
range [min] [max]: configure new range of ports
exit: exit from port context
  1. A similar script for configuring switches over the network (with its companion support library). The script assumes that you are on a machine that can access the network management VLAN.
~$ ./swconf.rb -h
Allows configuration of multiple ports on a Quanta running XorPlus.
Usage: ./swconf.rb [host] [port]
    -d, --debug                      Enable verbose debugging mode (default: off)
    -r, --dryrun                     Do a dry run (Do not actually send command - default: off)
    -h, --help                       Display this list
~$ ./swconf.rb "s-sb" 10001
D, [2011-08-30T12:45:30.578119 #7325] DEBUG -- : host: s-sb port: 10001
> help 
        clear - clear the screen
        delete - delete settings
        exit - exit script
        help - display this list
        iface [eth0|eth1] [IP addr] - Configure management interface address. Address is in CIDR form (e.g 172.16.0.30/16)
        ports [portrange] - Configure VLAN and mode of ports in a list of ports [portrange]
        save - Commit changes to memory
        vlan [VLAN ID] - instantiate a VLAN interface of tag [VLAN ID]
> ports 2..4,7
(ports)# help
        vlan [1..1020]: set native vlan for ports
        mode [access|trunk]
        delete: wipe out port settings
        range [portrange]: configure new range of ports
        exit: exit from port context

Both can be found as attachments to this page.

SSH/Telnet login

Verbatim from FAQs (but not in the CLI users manual):

Q: What is default users and passwords?

A: By default users root/admin/operator are enabled, "admin/operator" will log into CLI; "root" will log into system shell; all passwords are 'pica8' now. You should BETTER change the passwords if you use it in a production environment or on the Internet. You can use "# passwd some_user" command to change the password of some_user in system shell.
Last modified 8 years ago Last modified on 08/30/11 16:59:20

Attachments (3)

Download all attachments as: .zip