| 1 | = The IP8800 Packet Switch = |
| 2 | The IP8800/S3640 is a smart switch built by NEC capable of running firmware compliant with !OpenFlow networking. WINLAB utilizes IP8800 switches in its experimental network infrastructure. This is a quick-start guide (hopefully) suitable for anyone trying to learn how to deploy the NEC IP8800 on the network. The !OpenFlow aspect of the switch will not be discussed here in too much detail as it involves a whole different set of network configurations. |
| 3 | |
| 4 | ''' References ''' [[BR]] |
| 5 | The full IP8800 operations manual can be found online. Then why am I taking my time to make this handbook? For one, the online manual is in Japanese. Even if you are literate in Japanese, the manual is quite extensive. So, to sum things up -- the purpose of this guide is to provide a quick reference so that no-body has to dig through the handbook to find out, say, how to safely shut the switch down. But, for those of you who want to check out the whole shebang, here are the links: |
| 6 | |
| 7 | * Vol. 1: http://www.nec.co.jp/ip88n/s36_sw/html/cfguide/index.html |
| 8 | * Vol. 2: http://www.nec.co.jp/ip88n/s36_sw/html/cfguide2/index.html |
| 9 | * Vol. 3: http://www.nec.co.jp/ip88n/s36_sw/html/cfguide3/index.html |
| 10 | |
| 11 | The switches may also come with 2 CDs containing the English translated version of the manual. |
| 12 | |
| 13 | '''Before we begin...'''[[BR]] |
| 14 | Here are the assumptions that are made in this handbook: |
| 15 | * You are using the NEC IP8800/S3640-48T2XW switch. Commands vary even amongst similar lines of devices. |
| 16 | * You are familiar with, and running some form of *nix on your PC (We are, for the most part, using Ubuntu unless specified) |
| 17 | * You have a serial port on your machine, and have either minicom or kermit installed on your machine. |
| 18 | |
| 19 | '''Conventions'''[[BR]] |
| 20 | Text in `console font` and in quotations are commands that can be entered at the command line. When in quotations, the quotes should be omitted. |
| 21 | |
| 22 | Each section outlined in the index starts with a short overview, followed by step-by-step instructions (if applicable), and ends with troubleshooting error messages that are associated with each. |
| 23 | |
| 24 | [[BR]] |
| 25 | |
| 26 | ---- |
| 27 | == Index == #index |
| 28 | [#I I Introduction] [[BR]] |
| 29 | [#Serial 1.1 Connection via serial] [[BR]] |
| 30 | [#Modes 1.2 User modes] [[BR]] |
| 31 | [#Help 1.3 Finding Information] [[BR]] |
| 32 | [#lookup 1.4 device information lookup] [[BR]] |
| 33 | [#unix 1.5 UNIX commands] [[BR]] |
| 34 | [#power 1.6 Powering off] [[BR]] |
| 35 | [#II II Basic Configuration Tasks] [[BR]] |
| 36 | [#Contexts 2.1 Contexts] [[BR]] |
| 37 | [#vlans 2.2 VLANs and VLAN Interfaces] [[BR]] |
| 38 | [#Ports 2.3 Ports] [[BR]] |
| 39 | [#Telnet 2.4 Telnet] [[BR]] |
| 40 | [#III III Miscellaneous Configuration Tasks] [[BR]] |
| 41 | [#acls 3.1 ACLs and SNMP] [[BR]] |
| 42 | [#dhClient 3.2 DHCP Relay Agent] [[BR]] |
| 43 | [#dhServer 3.3 DHCP Server] [[BR]] |
| 44 | [#mirror 3.4 Port Mirroring] [[BR]] |
| 45 | [#accounts 3.5 Users and Passwords] [[BR]] |
| 46 | [#IV IV OpenFlow Switching] [[BR]] |
| 47 | [#intro 4.1 What is OpenFlow? ] [[BR]] |
| 48 | [#prep 4.2 Preparation] [[BR]] |
| 49 | [#flash 4.3 Flashing the switch] [[BR]] |
| 50 | [#ofcom 4.4 OpenFLow Commands] [[BR]] |
| 51 | |
| 52 | |
| 53 | ---- |
| 54 | = I Introduction = #I |
| 55 | Many "Smart" switches, including the IP8800 series switches, must be configured using the Command-line-interface(CLI). This usually involves a serial, telnet, or ssh session through a terminal. This chapter explains how to connect to the switch via serial, and covers some basic commands and operational tasks to get started with these switches. |
| 56 | |
| 57 | [[BR]] |
| 58 | |
| 59 | == 1.1 Connecting via serial == #Serial |
| 60 | Telnet is not enabled by default on the switches. Therefore, initial configurations must be done through a serial connection. The steps below describe how to establish a serial connection with the switch using kermit, as its default settings allow it to connect without any modifications. Few laptops have serial ports these days, so have a desktop or a USB-to-serial converter handy. |
| 61 | |
| 62 | If not using kermit, the following settings are required if settings must be modified: |
| 63 | {{{ |
| 64 | * speed: 9600 |
| 65 | * data bits: 8 |
| 66 | * stop bits: 1 |
| 67 | * Flow control: none |
| 68 | * Parity: none |
| 69 | }}} |
| 70 | |
| 71 | === Steps. === |
| 72 | 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. |
| 73 | |
| 74 | 2. ''Establish a connection.'' Connect your PC serial port to the port labeled "console" on the switch using a RS-232 cable, and issue the following commands as root from a terminal: |
| 75 | {{{ |
| 76 | # kermit |
| 77 | C-Kermit>set line /dev/ttyS0 |
| 78 | C-Kermit>set carrier-watch off |
| 79 | C-Kermit>connect |
| 80 | }}} |
| 81 | |
| 82 | The following is also valid: |
| 83 | {{{ |
| 84 | kermit -l /dev/ttyS0 |
| 85 | set carrier-watch off |
| 86 | connect |
| 87 | }}} |
| 88 | |
| 89 | If all goes well, you should then see something like below. If the login prompt doesn't come up, hitting the enter key should bring it up. |
| 90 | |
| 91 | {{{ |
| 92 | Connecting to /dev/ttyS0, speed 0 |
| 93 | Escape character: Ctrl-\ (ASCII 28, FS): enabled |
| 94 | Type the escape character followed by C to get back, |
| 95 | or followed by ? to see other options. |
| 96 | ---------------------------------------------------- |
| 97 | |
| 98 | |
| 99 | login: |
| 100 | |
| 101 | }}} |
| 102 | |
| 103 | 3. ''Login.'' The default username is "operator", and the password is blank. Once logged in, you will be brought to the CLI. Commands are entered at the caret. |
| 104 | |
| 105 | {{{ |
| 106 | login: operator |
| 107 | |
| 108 | Copyright (c) 2005-2008 ALAXALA Networks Corporation. All rights reserved. |
| 109 | |
| 110 | |
| 111 | > |
| 112 | }}} |
| 113 | |
| 114 | 4. ''exiting.'' `Ctrl-\ q` ends the kermit session. The command `exit` or `logout` will just log you out of the switch, but will not end the session. |
| 115 | |
| 116 | === Troubleshooting serial connections === |
| 117 | * If using kermit, make sure you are root when you start up your connection. minicom does not require you to be root. |
| 118 | |
| 119 | * Kermit will balk if you try to log in while there is a session going on. Make sure that no one else is logged in via serial, and that you haven't forgotten to log out during a previous session. |
| 120 | |
| 121 | [#index return to index] |
| 122 | [[BR]] |
| 123 | |
| 124 | == 1.2 User modes == #Modes |
| 125 | === Enabled Mode === |
| 126 | You are in initially in user mode when you log into the switch. Only a limited set of commands for status lookup are accessible from user mode. In order to gain full access to device (e.g. for configuration) you must be in ''enabled'' mode. For all intensive purposes, this is equivalent to superuser mode in *nix. The command `enable` allows a user to enter enabled mode. The whole command need not be entered at the prompt, as the switch is capable of command interpretation. |
| 127 | |
| 128 | {{{ |
| 129 | > ena <<---whole command is 'enable' -- the switch assumes and autocompletes commands. |
| 130 | # |
| 131 | }}} |
| 132 | Note that once in enabled mode, the caret becomes a pound. Command "`exit`" exits you from enabled mode (and any other modes or contexts, such as configuration mode explained next). |
| 133 | |
| 134 | === Configuration Mode === |
| 135 | Once in enabled mode, switches can be configured by entering ''configuration mode''. All configurations, from ACLs to port speed, are done from this mode, or, as we may interchangeably call, ''context''. Configuration mode may be entered via the command `configure`. |
| 136 | |
| 137 | {{{ |
| 138 | # configure |
| 139 | (config)# |
| 140 | }}} |
| 141 | |
| 142 | We will be delving further into the details of configuration starting with [#II chapter II] of the guide. |
| 143 | |
| 144 | [#index return to index] |
| 145 | [[BR]] |
| 146 | == 1.3 Finding Information == #Help |
| 147 | Typing `?` at the prompt will display all of the basic commands that are available. Typing `?` after a articular command will display the available flags. |
| 148 | |
| 149 | {{{ |
| 150 | sw-sb09> reload ? |
| 151 | -f Restart without confirmation |
| 152 | dump-image Memory dump is extracted and preserved |
| 153 | no-dump-image Memory dump is not extracted and preserved |
| 154 | stop Stop, but do not restart |
| 155 | <cr> |
| 156 | }}} |
| 157 | Here, `<cr>` means hit `return`. |
| 158 | |
| 159 | An alphabetized list of commands and their usage can be found [http://www.nec.co.jp/ip88n/s36_sw/html/commindx/index.html here], although this is also in Japanese. |
| 160 | |
| 161 | The switch also recognizes some UNIX commands (see the [#unix UNIX commands] section for details). For such commands (and !OpenFlow commands such as `showswitch`), "`command --help`" or the flag `-h` may also be used to get information about a certain command. |
| 162 | |
| 163 | [[BR]] |
| 164 | == 1.4 Device information lookup == #lookup |
| 165 | This is primarily done through the `show` command. Some useful lines: |
| 166 | * `show configuration` - all current configurations, e.g. hostname, VLANs, ACLs, ports |
| 167 | * `show port statistics` - port status (interface name, up, down, ect.) |
| 168 | * `show port vlan` - list all port-to-VLAN associations |
| 169 | * `show version` - System information e.g. serial number, OS version |
| 170 | |
| 171 | For a complete list, do "show ?". |
| 172 | |
| 173 | In configuration mode, the `show` command will display the configurations for the current device element you are configuring: |
| 174 | {{{ |
| 175 | (config)# interface gigabitethernet 0/27 <<---entering port 0/27 config prompt |
| 176 | (config-if)# show |
| 177 | interface gigabitethernet 0/27 |
| 178 | switchport mode access |
| 179 | switchport access vlan 4 |
| 180 | ! |
| 181 | }}} |
| 182 | |
| 183 | Again, more details about the ''hows'' of configuration can be found in [#II chapter II] of the guide. |
| 184 | |
| 185 | [[BR]] |
| 186 | == 1.5 UNIX commands == #unix |
| 187 | The core OS of the switch is NetBSD 2.0. Therefore, some *nix commands can be used at the CLI. See /usr/local/bin, /usr/local/sbin, /usr/bin and /usr/sbin for a list of available commands. For example, the up arrow key will let you access previously issued commands, as will `!`. |
| 188 | |
| 189 | '''some commands''' [[BR]] |
| 190 | Note, enabled mode is not true superuser (user "admin", not "root"), so your actions are quite restricted. However, some useful commands are: |
| 191 | * find <rootdir> -/name <targetname> : find a *nix command |
| 192 | * /usr/bin/clear : clear the terminal screen |
| 193 | * /usr/bin/who : list users logged in |
| 194 | * /sbin/sysctl : system specs/status |
| 195 | * /sbin/dmesg : display system message buffer |
| 196 | * scp : better (more intuitive, I think) than ftp |
| 197 | |
| 198 | If you feel compelled to read them, try the [http://netbsd.gw.com/cgi-bin/man-cgi/man?+ANY+NetBSD-2.0 Online NetBSD man pages]. The built-in man pages are not very functional. [[BR]][[BR]] |
| 199 | |
| 200 | '''text editors''' [[BR]] |
| 201 | If you ''desperately'' need to, and can't do it any way else, things (e.g. your !OpenFlow config file, discussed in [#IV Chapter IV]) can be edited using `ed`. Be forewarned, this is not for the faint-hearted. |
| 202 | |
| 203 | [#index return to index] |
| 204 | [[BR]] |
| 205 | == 1.6 Powering off == #power |
| 206 | Yanking the power on a switch suddenly can cause file corruption, so we want to properly stop all processes before cutting the power. To shut down a switch, issue the command `reload stop`. This halts the system (stops all processes), but does not power the hardware off. After the system halts, the rom prompt will appear. At this point, you'd have to manually turn the switch off. |
| 207 | {{{ |
| 208 | sw-sb09-da# reload stop |
| 209 | Dump information extracted? (y/n): y |
| 210 | old dump file(rmdump 07/21 21:16) delete OK? (y/n): y |
| 211 | sw-sb09-da# |
| 212 | ROM 00.03.52 |
| 213 | Rom: |
| 214 | }}} |
| 215 | |
| 216 | [[BR]][[BR]] |
| 217 | ---- |
| 218 | = II Basic Configuration Tasks = #II |
| 219 | |
| 220 | This chapter covers the basics of switch configuration. We will first take a look at some of the more important contexts available from configuration mode. The overview will be followed by a look at lower layer constructs (ports, VLANs, IP addresses) with respect to the switch, and how to configure these elements. This chapter will end with the configuration of telnet so that we can access the switch over the network. |
| 221 | |
| 222 | == 2.1 Contexts == #Contexts |
| 223 | '''Entering Contexts''' [[BR]] |
| 224 | All configurations are done by entering various contexts from the (config)# prompt. Some contexts we want to focus on are: |
| 225 | |
| 226 | * `vlan n` - create/configure standard VLANs, n being the VLAN ID (some number) |
| 227 | * `interface vlan n` - create/ configure a virtual interface with both Layer 2 and 3 characteristics |
| 228 | * `interface gigabitethernet 0/n` - configure specific port, n being number between 1 and 48 |
| 229 | * `line <vty|console> vtyrange<0-b>` - configure telnet or console parameters, respectively |
| 230 | |
| 231 | The details of each context will be introduced in the following sections. |
| 232 | |
| 233 | when you enter a context, the prompt becomes "(config-if)#." Note, however, this prompt doesn't indicate what context you are using (i.e. which port you are setting up, what VLAN, ect); you just have to keep track of what you are doing. |
| 234 | |
| 235 | {{{ |
| 236 | (config)# interface vlan 8 <<---start by entering the 'interface vlan' context |
| 237 | !(config-if)# |
| 238 | !(config-if)# interface gi 0/3 <<---switch to 'interface gigabitethernet' context |
| 239 | !(config-if)# <<---note how prompt still shows up as "config-if" |
| 240 | }}} |
| 241 | |
| 242 | If you forget where you were in a context (i.e. which vlan you were configuring, ect.), typing "show" will display all of the configurations saved for that specific context (hopefully giving you enough information to let you recall what you were trying to configure). |
| 243 | |
| 244 | As you can see above, when there are unsaved changes in the configurations (e.g. a new vlan interface created, as in the case above), you will see a "!" before the prompt. This is there to remind you that you've made changes that must be saved if you want them to survive a reboot. The command "save" intuitively saves the settings. |
| 245 | |
| 246 | '''undoing configurations.''' [[BR]] |
| 247 | Re-running a command with "no" prepended to it will usually undo the configuration. Exceptions to this rule will be mentioned in the appropriate sections. |
| 248 | |
| 249 | '''exiting/ logging off. ''' |
| 250 | The command `exit` lets you exit from contexts and enabled mode, or lets you log out of the switch if you were just in user mode. |
| 251 | {{{ |
| 252 | !(config-if)# save |
| 253 | (config-if)# exit |
| 254 | (config)# exit |
| 255 | # |
| 256 | }}} |
| 257 | |
| 258 | [#index return to index] |
| 259 | [[BR]] |
| 260 | == 2.2 VLANs and VLAN Interfaces == #vlans |
| 261 | === Index === #vindex |
| 262 | This section is divided into the following sub-sections. |
| 263 | [#vback 2.2.1. Background] [[BR]] |
| 264 | [#create 2.2.2. VLAN creation] [[BR]] |
| 265 | [#vname 2.2.3. Naming VLANs] [[BR]] |
| 266 | [#toports 2.2.4. Associating VLANs to ports] [[BR]] |
| 267 | [#vints 2.2.5. IP address assignment] [[BR]] |
| 268 | [#delv 2.2.6. VLAN deletion] [[BR]] |
| 269 | === 2.2.1. Background === #vback |
| 270 | VLANs are a technology defined by IEEE 802.1. In terms of the switch, VLANs allow a switch to group the hosts it sees on its port based on their L2 addresses. The L2 addresses are associated with the port that it is seen on; therefore, the port that the host is attached to determines which group, or VLAN, the host belongs in. |
| 271 | |
| 272 | The "vlan" context allows you to create and configure dot1Q VLANs that can be associated with ports. The "interface vlan" context allows you to configure network layer features of a VLAN by tying it to a virtual interface on layer 3. The latter context is typically used to configure IP addresses associated with the switch. |
| 273 | |
| 274 | === 2.2.2. VLAN creation === #create |
| 275 | The switch comes with VLAN 1 by default, with all ports associated with it. New VLANs can be created by entering the `vlan` context for a non-existent VLAN ID from the config prompt. Entering the `interface vlan` context for a nonexistent VLAN will also do the same thing. |
| 276 | |
| 277 | ''creating multiple vlans.'' Multiple VLANs can be created at once with the command `vlan <vlan range> <vlan IDs>`. The `interface range vlan` context, however, cannot be used in this manner; The range version of the interface vlan context can only be used to configure groups of VLANs that already exist. The following error will be thrown if you try to apply the context to a non-existent VLAN, in this case, VLAN 7: |
| 278 | {{{ |
| 279 | (config)# interface range vlan 7-38 |
| 280 | interface : Not found VLAN-ID <7>. |
| 281 | }}} |
| 282 | |
| 283 | more information on the `interface vlan` context can be found in [#vints section 2.2.5]. |
| 284 | |
| 285 | ''Example.'' The following illustrates typical steps for creating VLANs. We first generate VLANs 1-8, then 11-48, and finally, 50: |
| 286 | {{{ |
| 287 | (config)# vlan 1-8 |
| 288 | !(config-vlan)# vlan 11-48 |
| 289 | !(config-vlan)# vlan 50 |
| 290 | !(config-vlan)# save |
| 291 | (config-vlan)# |
| 292 | }}} |
| 293 | |
| 294 | [#vindex return to section index] [[BR]] |
| 295 | [#index return to main index] [[BR]] |
| 296 | === 2.2.3. Naming VLANs === #vname |
| 297 | Names are a good way to keep track of the various VLANs you create. VLANs are named through the `vlan` context with the `name` command. |
| 298 | {{{ |
| 299 | (config-vlan)# vlan 2 |
| 300 | (config-vlan)# name "Internal" |
| 301 | }}} |
| 302 | |
| 303 | === 2.2.4. Associating VLANs to ports === #toports |
| 304 | Port VLAN membership is configured through the `interface gigabitethernet <port>` context using the `switchport access vlan <VLAN ID>` command. |
| 305 | {{{ |
| 306 | (config)# interface gigabitethernet 0/25 |
| 307 | (config-if)# switchport mode access |
| 308 | (config-if)# swi acc vlan 3 <<-- full command is "switchport access vlan 3" |
| 309 | }}} |
| 310 | |
| 311 | Here, "switchport mode access" specifies that the traffic to and from this port will not be tagged. More on port configuration is discussed in [#Ports section 2.3]. |
| 312 | |
| 313 | [#vindex return to section index] [[BR]] |
| 314 | [#index return to main index] |
| 315 | [[BR]] |
| 316 | === 2.2.5. IP address assignment === #vints |
| 317 | VLAN interfaces are abstractions that allow you to configure higher layer services and protocols that act upon ports based on their VLAN membership. One way you'd find yourself using them is to assign a management IP address to your switch. |
| 318 | {{{ |
| 319 | sw-sb09-da(config)# interface vlan 1 |
| 320 | sw-sb09-da(config-if)# ip address 172.19.10.100 255.255.0.0 |
| 321 | !sw-sb09-da(config-if)# |
| 322 | }}} |
| 323 | The commands above assign the switch an IP address of 172.19.10.100 with subnet mask 255.255.0.0. As this is assigned to VLAN 1's VLAN interface, this address is only visible to devices on VLAN 1. |
| 324 | |
| 325 | '''undoing static IP assignments to virtual interfaces''' [[BR]] |
| 326 | When you have [#dhClient IP-helpers] configured, you want to type "no ip helper-address" at the CLI before trying to remove the IP address or else you get this warning: |
| 327 | {{{ |
| 328 | interface vlan 3 |
| 329 | ip address 192.168.5.5 255.255.255.0 |
| 330 | ip helper-address 192.168.5.1 |
| 331 | ! |
| 332 | (config-if)# no ip address 192.168.5.5 255.255.255.0 |
| 333 | interface : IP interface is not defined. |
| 334 | }}} |
| 335 | |
| 336 | [[BR]] |
| 337 | === 2.2.6. VLAN deletion === #delv |
| 338 | '''Deleting a VLAN'''[[BR]] |
| 339 | Any configurations involving a VLAN you want to remove has to be undone before deleting the VLAN. not doing so will result in the following error when you issue the `no vlan <n>` context: |
| 340 | {{{ |
| 341 | (config)# no vlan 4 |
| 342 | vlan : Can't delete this configuration referred by other configuration. |
| 343 | }}} |
| 344 | In this case, VLAN 4 has port 0/27 associated with it. Undoing the association allows you to delete the VLAN without issues. |
| 345 | {{{ |
| 346 | (config)# int gi 0/27 |
| 347 | (config-if)# no sw acc vlan 4 |
| 348 | !(config-if)# exit |
| 349 | !(config)# no vlan 4 <<-----second attempt |
| 350 | !(config)# |
| 351 | }}} |
| 352 | |
| 353 | [#vindex return to section index] [[BR]] |
| 354 | [#index return to main index] |
| 355 | [[BR]][[BR]] |
| 356 | == 2.3 Ports == #Ports |
| 357 | === Index === #pindex |
| 358 | The following subsections are found here: |
| 359 | [#pback 2.3.1. Background] [[BR]] |
| 360 | [#pmodes 2.3.2. port modes] [[BR]] |
| 361 | [#assoc 2.3.3. VLAN association] [[BR]] |
| 362 | [#Trunking 2.3.4. Configuring trunk ports] [[BR]] |
| 363 | [#speed 2.3.5. port speed] [[BR]] |
| 364 | |
| 365 | === 2.3.1. Background === #pback |
| 366 | There are 48 standard RJ-45 ports and 2 fiber ports on the switch recognized as 'geth' (1Gbs) and 'tengeth' (10Gbps) by the device, respectively. We focus only on the 'geth' interfaces. The context to configure these ports is `interface gigabitethernet <port>`, where <port> is a value between 0/1 and 0/48. `interface range gigabitethernet <port>` allows you to configure multiple ports at once. |
| 367 | |
| 368 | |
| 369 | === 2.3.2. port modes === #pmodes |
| 370 | The switchports are access ports by default. Access ports restrict L2 broadcasts by limiting the ports that get flooded to those in the same VLAN affiliation as the port from which the frames originated. The `switchport mode <port type>` context is used to change the manner in which traffic to/from certain ports are handled. Off the bat, 2 are important: |
| 371 | |
| 372 | * `switchport mode dot1q-tunnel` - frames from the port will be tagged with a VLAN ID when it hits the trunk. If one port is set to this mode, it is assumed that all access ports are of this mode, regardless of whether you've touched them or not. |
| 373 | * `switchport mode trunk` - Sets the port as a trunk port. Frames hitting the port will be tagged with a 2-byte VLAN ID unless a native VLAN. |
| 374 | |
| 375 | See section 2.3.3 for info on dot1q ports and trunk configuration. |
| 376 | |
| 377 | === 2.3.3. VLAN association === #assoc |
| 378 | Traffic from a port associated to a certain VLAN is only visible to other ports associated with the same VLAN (unless we're talking about trunk ports or using routers to bridge VLANs). The context `switchport access vlan <n>` is used to associate the port to a certain VLAN of ID <n>; See section [#toports 2.2.4] for an example. |
| 379 | [[BR]] |
| 380 | |
| 381 | [#pindex return to section index] [[BR]] |
| 382 | [#index return to main index] |
| 383 | [[BR]] |
| 384 | === 2.3.4. Configuring trunk ports === #Trunking |
| 385 | With "access mode" ports, VLANs with the same VLAN ID that are on different but connected switches would be recognized as different VLANs despite having the same VLAN ID. In order to allow the two same-ID VLANs to be treated as one, we need 1) ports set to `dot1q-tunneling` mode, and 2) trunk ports connecting the two switches. |
| 386 | |
| 387 | 1. ''Configure the trunk port.'' If ports 0/45-48 are to be trunk ports allowing the assage of frames from VLANs 3,27,and 28 (Remember, if you are just configuring one port, you can always use the singular "interface gigabitethernet" context.): |
| 388 | {{{ |
| 389 | !(config-if)# interface range gi 0/45-48 |
| 390 | !(config-if-range)# switchport mode trunk |
| 391 | !(config-if-range)# switchport trunk allowed vlan 3,27,28 |
| 392 | }}} |
| 393 | |
| 394 | * "interface range gi 0/45-48" - configure all four ports at once with "interface range" context |
| 395 | * "switchport mode trunk" - make the ports trunk ports |
| 396 | * "switchport trunk allowed vlan 3,27,28" - allow the trunk to only carry frames from VLANs 3,27,or 28 (frames from these VLANs will get tagged) |
| 397 | |
| 398 | '''Some extensions of the "switchport trunk allow" context."''' [[BR]] |
| 399 | As per the switch's help output: |
| 400 | {{{ |
| 401 | sw-sb09(config-if-range)# switchport trunk allowed vlan ? |
| 402 | <vlan id list> <List style>. 1 to 4094. ex. "10-20", "30,40" |
| 403 | add add the VLANs to use this port |
| 404 | remove remove the VLANs to use these port |
| 405 | }}} |
| 406 | |
| 407 | Summarized: |
| 408 | * "switchport trunk...vlan add <VLAN IDs> - add VLANs to your current "allowed VLANs" list. |
| 409 | * "switchport trunk...vlan remove <VLAN IDs> - remove VLANs from your current "allowed VLANs" list |
| 410 | |
| 411 | 2. ''Associate the trunk with a Native VLAN.'' Native VLANs allows hosts that do not understand VLAN tagging to function on a network implementing trunking (IEEE 802.1q). In context of the switch, the native VLAN is much like a trunk port version of an interface VLAN; It essentially assigns an IP address and VLAN to the switch's trunk port(s), and provides a means to transport non-tagged frames on the trunk. |
| 412 | {{{ |
| 413 | !(config-if-range)# switchport trunk native vlan 1 |
| 414 | }}} |
| 415 | |
| 416 | * "switchport trunk native vlan 1" - make VLAN 1 the native VLAN for trunk port 0/48 (any frames from VLAN 1 will pass through the trunk untagged) |
| 417 | |
| 418 | By the way, this is the configuration for interface VLAN 1, which should be done ahead of time: |
| 419 | {{{ |
| 420 | (config-vlan)# interface vlan 1 |
| 421 | (config-if)# ip address 172.16.19.253 255.255.0.0 |
| 422 | }}} |
| 423 | |
| 424 | If you now go into a context for one of your trunk ports and do a "show", your configurations should look like this: |
| 425 | {{{ |
| 426 | !(config-if-range)# interface gi 0/48 |
| 427 | !(config-if)# show |
| 428 | interface gigabitethernet 0/48 |
| 429 | switchport mode trunk |
| 430 | switchport trunk allowed vlan 1,3,27-28 |
| 431 | switchport trunk native vlan 1 |
| 432 | }}} |
| 433 | |
| 434 | But finally... |
| 435 | |
| 436 | 3. '''Configure the ports associated with the trunked VLANs.''' The steps are same as configuring the ports for regular VLANs, except instead of "switchport mode access" we specify "switchport mode dot1q-tunnel" in this case: |
| 437 | {{{ |
| 438 | (config)# int ran gi 0/13-22 |
| 439 | (config-if-range)# sw mo dot1q-tunnel |
| 440 | !(config-if-range)# sw acc vlan 3 |
| 441 | !(config-if-range)# save <<<-----VERY important if you want the configurations saved! |
| 442 | }}} |
| 443 | |
| 444 | [#pindex return to section index] [[BR]] |
| 445 | [#index return to main index] |
| 446 | [[BR]] |
| 447 | === 2.3.5 port speed === #speed |
| 448 | By default, the switch autonegociates. You can change this by going into configuration mode for each port, and changing settings. |
| 449 | |
| 450 | 1. ''Shut port(s) to configure down.'' Shutting the ports down before configuring them allows the changes to take immediate effect upon bringing them back up. |
| 451 | {{{ |
| 452 | sw-sb09(config)# interface gi 0/13 |
| 453 | sw-sb09(config-if)# shutdown |
| 454 | !sw-sb09(config-if)# |
| 455 | 02/06 03:35:48 E3 PORT GigabitEthernet0/13 25011100 1350:000000000000 Port disabled administratively. |
| 456 | }}} |
| 457 | |
| 458 | It is normal to see an output message when you take down ports. |
| 459 | |
| 460 | 2. ''Set speed.'' The sub-context "speed" allows you to configure the port speed. The syntax is the following: |
| 461 | |
| 462 | * `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. |
| 463 | * `speed [10|100|1000]` - force port to run at a specific speed, no autonegociation |
| 464 | |
| 465 | Where the numbers denote Mbps. Here, we configure the port to go at 1000Mbps (1Gbps), and bring it back up: |
| 466 | {{{ |
| 467 | !sw-sb09(config-if)# speed auto 1000 |
| 468 | !sw-sb09(config-if)# no shutdown |
| 469 | }}} |
| 470 | |
| 471 | [#pindex return to section index] [[BR]] |
| 472 | [#index return to main index] |
| 473 | |
| 474 | [[BR]][[BR]] |
| 475 | == 2.4 Telnet == #Telnet |
| 476 | This section covers the steps needed to set up telnet access to your switch. Replace the VLAN ID's, IP addresses, and other parameters to fit your deployment. |
| 477 | |
| 478 | 1. Create a VLAN for telnet via the "vlan" context. For clarity (and good practice), we name our VLAN "telnet" so we know what it's used for. |
| 479 | {{{ |
| 480 | (config)# vlan 4 |
| 481 | !(config-vlan)# name "telnet" |
| 482 | }}} |
| 483 | 2. Configure IP for the telnet VLAN's VLAN interface. |
| 484 | {{{ |
| 485 | !(config-vlan)# interface vlan 4 |
| 486 | !(config-if)# ip address 192.168.10.1 255.255.255.0 |
| 487 | }}} |
| 488 | 3. Enable telnet logins to the switch using the "line vty" context. The numbers following the context denote the range of virtual terminals that the users have access to for telnet. Here we set the values to "0 2", meaning that 3 users can simultaneously telnet to the switch. |
| 489 | {{{ |
| 490 | !(config-if)# line vty 0 2 |
| 491 | !(config-line)# exit |
| 492 | !(config)# |
| 493 | }}} |
| 494 | |
| 495 | '''Using Telnet''' [[BR]] |
| 496 | Once you've set up telnet on your switch, you can access the switch with the IP address you've assigned it during step 2 above. So for this config you'd issue the following command from the terminal: |
| 497 | {{{ |
| 498 | $ telnet 192.168.10.1 |
| 499 | }}} |
| 500 | |
| 501 | The username and password are the same for this prompt once you connect. |
| 502 | |
| 503 | [#index return to index] |
| 504 | |
| 505 | [[BR]][[BR]] |
| 506 | ---- |
| 507 | = III Miscellaneous Configuration Tasks = #III |
| 508 | This section covers some odds-and-ends that you may or may not need in terms of basic switch deployment, and that didn't really fit nicely with the past two sections. These bits tend to be a bit 'gorier' in terms of switch administration, and may require stuff covered in the past sections. |
| 509 | [[BR]][[BR]] |
| 510 | == 3.1 ACLs and SNMP == #acls |
| 511 | === Index === #acindex |
| 512 | The following subsections are found here: |
| 513 | [#acback 3.1.1. Background] [[BR]] |
| 514 | [#aconf 3.1.2. Configuring ACLs] [[BR]] |
| 515 | [#snmpconf 3.1.3. Configuring SNMP] [[BR]] |
| 516 | [#snmpg 3.1.4. Accessing SNMP data] [[BR]] |
| 517 | |
| 518 | === 3.1.1. Background === #acback |
| 519 | Access Control Lists (ACLs) dictate who and what can access various services provided by the device. One such service is Simple Network Management Protocol (SNMP), which allows you to look up and modify device information across the network. So - here we cut to the chase and cover both at the same time. Firstly, some references for SNMP: |
| 520 | * SNMP, courtesy of Wikipedia: http://en.wikipedia.org/wiki/Simple_Network_Management_Protocol [[BR]] |
| 521 | * MIB references: http://www.alvestrand.no/objectid/ |
| 522 | |
| 523 | === 3.1.2. Configuring the ACL === #aconf |
| 524 | 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. ACls are configured through the `access-list` context. The (basic) syntax is the following: |
| 525 | |
| 526 | `access-list <lid> <seq> <permit|deny> <inet|any> <netmask>` |
| 527 | |
| 528 | where |
| 529 | * lid - list ID, a value between 1 - 2699 |
| 530 | * seq - sequence number, a value between 1 - 4294967294 (can be omitted) |
| 531 | * inet - IP address of host or network address |
| 532 | * netmask - subnet mask, 0.0.0.0 for hosts |
| 533 | |
| 534 | `no access-list <lid>` deletes all entries with a particular list ID. |
| 535 | |
| 536 | '''example'''[[BR]] |
| 537 | {{{ |
| 538 | sw-sb09-da(config)# access-list 1 permit 10.19.0.10 0.0.0.0 |
| 539 | !sw-sb09-da(config)# access-list 1 permit 192.168.100.28 0.0.0.0 |
| 540 | !sw-sb09-da(config)# access-list 2 permit 172.16.0.1 255.255.0.0 |
| 541 | }}} |
| 542 | the resulting configs can be seen with `show access-list`: |
| 543 | {{{ |
| 544 | !sw-sb09-da(config)# sh access-list |
| 545 | access-list 1 10 permit host 10.19.0.10 |
| 546 | access-list 1 20 permit host 192.168.100.28 |
| 547 | access-list 2 10 permit 172.16.0.1 255.255.0.0 |
| 548 | }}} |
| 549 | doing a "no access-list 1" will remove the first two entries of this ACL. |
| 550 | |
| 551 | [[BR]] |
| 552 | === 3.1.2. Configuring SNMP === #snmpconf |
| 553 | Now that you have an ACL, you can specify which ACL entries may have access to SNMP services. This is done by specifying ACL entries by list ID in the `snmp-server community` context. |
| 554 | {{{ |
| 555 | sw-sb09(config)# snmp-server community "NET" rw 1 |
| 556 | }}} |
| 557 | here, "NET" is an arbitrary group name, `rw` means any member from the allowed group can read or modify SNMP parameters (as opposed to "ro", read-only), and "1" is the list ID of the group. |
| 558 | [[BR]] |
| 559 | [#acindex return to section index] [[BR]] |
| 560 | [#index return to main index] |
| 561 | [[BR]] |
| 562 | === 3.1.3. Accessing SNMP data === #snmpg |
| 563 | SNMP uses Management Information Bases (MIBs) to organize the data it can provide and modify on a device. SNMP data lookup is usually done by specifying the MIB values for a certain spec. The `snmp` context provides a set of tools for this - for a list of options, type "snmp ?". |
| 564 | |
| 565 | '''example''' [[BR]] |
| 566 | here we do a system information query on the switch we are logged into: |
| 567 | {{{ |
| 568 | sw-sb09# snmp walk 1.3.6.1.2.1.1 |
| 569 | |
| 570 | Name: sysDescr.0 |
| 571 | Value: ALAXALA AX3640S AX-3640-48T2XW-L [AX3640S-48T2XW] Switching software Ver. |
| 572 | 10.7 [OS-L3L] |
| 573 | |
| 574 | Name: sysObjectID.0 |
| 575 | Value: ax3640s |
| 576 | |
| 577 | Name: sysUpTime.0 |
| 578 | Value: 25724205 |
| 579 | |
| 580 | Name: sysContact.0 |
| 581 | Value: |
| 582 | |
| 583 | Name: sysName.0 |
| 584 | Value: sw-sb09 |
| 585 | |
| 586 | Name: sysLocation.0 |
| 587 | Value: |
| 588 | |
| 589 | Name: sysServices.0 |
| 590 | Value: 78 |
| 591 | }}} |
| 592 | '''using snmpwalk''' [[BR]] |
| 593 | This is an utility for *nix machines, and can be used to prod the switch over the network, given you have the ACLs set up properly. |
| 594 | [[BR]][[BR]] |
| 595 | [#acindex return to section index] [[BR]] |
| 596 | [#index return to main index] |
| 597 | |
| 598 | [[BR]][[BR]] |
| 599 | == 3.2 DHCP Relay Agent == #dhClient |
| 600 | A DHCP relay agent forwards DHCP messages between DHCP client and server residing on two different subnets and VLANs. This is a translation from the online NEC guide. |
| 601 | |
| 602 | 1. configure client VLAN. This is the VLAN on which the DHCP clients live. |
| 603 | {{{ |
| 604 | (config)# vlan 2 |
| 605 | (config-vlan)# exit |
| 606 | (config)# interface gigabitethernet 0/5 |
| 607 | (config-if)# switchport mode access |
| 608 | (config-if)# switchport access vlan 2 |
| 609 | (config-if)# exit |
| 610 | (config)# interface vlan 2 |
| 611 | (config-if)# ip address 10.1.0.1 255.255.0.0 |
| 612 | (config-if)# exit |
| 613 | }}} |
| 614 | |
| 615 | 2. Next, set up the VLAN and interface connected to the DHCP server. |
| 616 | {{{ |
| 617 | (config)# vlan 3 |
| 618 | (config-vlan)# exit |
| 619 | (config)# interface gigabitethernet 0/7 |
| 620 | (config-if)# switchport mode access |
| 621 | (config-if)# switchport access vlan 3 |
| 622 | (config-if)# exit |
| 623 | (config)# interface vlan 3 |
| 624 | (config-if)# ip address 20.1.0.1 255.255.0.0 |
| 625 | (config-if)# exit |
| 626 | }}} |
| 627 | |
| 628 | 3. set the DHCP server's address as the helper address on client VLAN. |
| 629 | {{{ |
| 630 | (config)# interface vlan 2 |
| 631 | (config-if)# ip helper-address 20.1.0.10 |
| 632 | (config-if)# exit |
| 633 | }}} |
| 634 | |
| 635 | [#index return to main index] |
| 636 | |
| 637 | [[BR]][[BR]] |
| 638 | == 3.3 DHCP Server == #dhServer |
| 639 | The IP8800 comes with DHCP server capabilities. DHCP on the switch is provided on a VLAN basis, where the service is provided to hosts based on VLAN membership. DHCP configs for the basic DHCP server use the `service dhcp` and `ip dhcp` contexts. |
| 640 | |
| 641 | 1. enable DHCP services for VLANs. Here, we want VLAN 1 to have the service. |
| 642 | {{{ |
| 643 | (config)# service dhcp vlan 1 |
| 644 | }}} |
| 645 | |
| 646 | 2. specify address(es) excluded from address block. Here, IP addresses between 10.1 and 11.10 will not be handed out to clients. |
| 647 | {{{ |
| 648 | !(config)# ip dhcp excluded-address 192.168.10.1 192.168.11.10 |
| 649 | }}} |
| 650 | |
| 651 | 3. configure client pool. Members of VLAN 1 will be part of pool "Test1", be given IP's from the 192.168.11.0/24 block, and will have 10-minute leases. |
| 652 | {{{ |
| 653 | !(config)# ip dhcp pool Test1 |
| 654 | !(dhcp-config)# network 192.168.11.0 255.255.255.0 |
| 655 | !(dhcp-config)# lease 0 0 10 |
| 656 | }}} |
| 657 | |
| 658 | [[BR]] |
| 659 | [#index return to main index] |
| 660 | |
| 661 | [[BR]][[BR]] |
| 662 | == 3.4 Port Mirroring == #mirror |
| 663 | Say that you want to monitor the traffic to/from a certain port. The switch can act as a network tap if you configure port mirroring. When configured to port mirror, the switch would send a copy of the frames it receives from certain ports to another port where you'd, say, connect a network analyzer. |
| 664 | |
| 665 | We needed to set up port mirroring to diagnose what was going wrong with the L2TP tunneling between the netFPGA hosts. |
| 666 | |
| 667 | '''Syntax'''[[BR]] |
| 668 | {{{ |
| 669 | monitor session <session no.> source interface gigabitethernet <src port> <tx|rx|both> destination interface gigabitethernet <mirror port> |
| 670 | }}} |
| 671 | |
| 672 | * <session no.> - a number between 1-4 uniquely identifying the mirroring session. the switch can do a maximum of 4 sessions at once. |
| 673 | * <src port> - the port number(s) of the port(s) you're trying to monitor. Can be a range of ports e.g. `0/5-6,27`. |
| 674 | * <tx|rx|both> - mirror incoming, outgoing, or both traffics, respectively. "tx" and "rx" are with respect t the host connected to the port. |
| 675 | * <mirror port> - this is the port connected to the analyzer. |
| 676 | |
| 677 | '''Errors'''[[BR]] |
| 678 | Rebooting the switch without `reload stop` sometimes corrupts the monitor configs. When this happens the monitor session will show up in your configurations but will not actually be there; Trying to delete it will result in this error: |
| 679 | |
| 680 | {{{ |
| 681 | (config)# no monitor session 1 |
| 682 | monitor : Can not delete it because data is not corresponding. |
| 683 | }}} |
| 684 | |
| 685 | Instantiating the same session again should fix things should this happen. [[BR]] |
| 686 | |
| 687 | [#index return to main index] |
| 688 | [[BR]][[BR]] |
| 689 | == 3.5 Users and Passwords == #accounts |
| 690 | '''adding a user''' [[BR]] |
| 691 | This is done with the `adduser` command as with any *nix machine (The new user is added to /etc/passwd as you expect). You need to be in enabled mode. |
| 692 | {{{ |
| 693 | sw-sb09-da# adduser native no-flash |
| 694 | User(empty password) add done. Please setting password. <<---this means "user added. please set password". |
| 695 | |
| 696 | Changing local password for native. |
| 697 | New password: |
| 698 | Retype new password: |
| 699 | !sw-sb09-da# |
| 700 | }}} |
| 701 | |
| 702 | '''deleting a user'''[[BR]] |
| 703 | This is not done with deluser, but with `rmuser`. |
| 704 | |
| 705 | '''setting/clearing passwords'''[[BR]] |
| 706 | `password` <username> will allow you to reset password. `clear password <username>` allows you to delete passwords. replacing <username> with "enable-mode" allows you to set the password for user admin (enabled mode). |
| 707 | |
| 708 | '''Forgotten admin password''' [[BR]] |
| 709 | There is no recovery process akin to Cisco switches per se - pressing the reset button on the switch for 5 seconds will "default reset" the device. Once the switch reboots, you will be able to set new passwords - Default reset just clears the administration password, but will not wipe out your configurations (although the descriptions make it sounds like it does) |
| 710 | |
| 711 | [#index return to main index] |
| 712 | [[BR]][[BR]] |
| 713 | ---- |
| 714 | side notes...IOS, disabling STP |
| 715 | {{{ |
| 716 | Switch(config)#no spanning-tree vlan 1-1005 |
| 717 | Switch(config)#exit |
| 718 | Switch# |
| 719 | 1w4d: %SYS-5-CONFIG_I: Configured from console by console |
| 720 | Switch#sh spann |
| 721 | Switch#sh spanning-tree |
| 722 | |
| 723 | No spanning tree instance exists. |
| 724 | }}} |
| 725 | ---- |
| 726 | = IV !OpenFlow Switching = #IV |
| 727 | |
| 728 | == 4.1 What is !OpenFlow? == #intro |
| 729 | == 4.2 Preparation == #prep |
| 730 | Materials |
| 731 | disable STP |
| 732 | vlan, port configs |
| 733 | == 4.3 Flashing the switch == #flash |
| 734 | licenses, image file, openflow.conf |
| 735 | == 4.4 OpenFLow Commands == #ofcom |
| 736 | instantiating vswitches/datapaths |