46 | | |
| 45 | The console was then configured to be VLAN aware for VLANs 27,28, and 100. The site referenced: http://ubuntuforums.org/showthread.php?t=703387 |
| 46 | |
| 47 | The interfaces, according to /etc/network/interfaces |
| 48 | {{{ |
| 49 | # The primary network interface |
| 50 | auto eth0 eth1 |
| 51 | iface eth0 inet dhcp |
| 52 | |
| 53 | iface eth1 inet static |
| 54 | address 192.168.100.28 |
| 55 | netmask 255.255.255.0 |
| 56 | # address 10.19.0.10 |
| 57 | # netmask 255.255.0.0 |
| 58 | |
| 59 | #auto eth1.27 |
| 60 | iface eth1.27 inet static |
| 61 | address 10.19.0.10 |
| 62 | netmask 255.255.0.0 |
| 63 | |
| 64 | #auto eth1.28 |
| 65 | iface eth1.28 inet static |
| 66 | address 192.168.1.28 |
| 67 | netmask 255.255.255.0 |
| 68 | |
| 69 | #auto eth1.100 |
| 70 | iface eth1.100 inet static |
| 71 | address 172.16.100.1 |
| 72 | netmask 255.255.255.0 |
| 73 | }}} |
| 74 | |
| 75 | Eth1 was then connected to a reconfigured trunk port that allowed VLANs 27,28, and 100. The commands used for re-configuring trunk port 0/37: |
| 76 | |
| 77 | {{{ |
| 78 | sw-sb09(config)# sh int gi 0/37 |
| 79 | interface gigabitethernet 0/37 |
| 80 | switchport mode trunk |
| 81 | switchport trunk allowed vlan 1,3,27-28 |
| 82 | switchport trunk native vlan 1 |
| 83 | ! |
| 84 | sw-sb09(config)# int gi 0/37 |
| 85 | sw-sb09(config-if)# no switchport trunk native vlan 1 |
| 86 | !sw-sb09(config-if)# exit |
| 87 | !sw-sb09(config)# vlan 100 |
| 88 | !sw-sb09(config-vlan)# exit |
| 89 | !sw-sb09(config)# interface vlan 100 |
| 90 | !sw-sb09(config-if)# ip address 172.16.100.10 255.255.255.0 |
| 91 | !sw-sb09(config-if)# interface gigabitethernet 0/37 |
| 92 | !sw-sb09(config-if)# switchport trunk native vlan 100 |
| 93 | !sw-sb09(config-if)# switchport trunk allowed vlan remove 1 |
| 94 | !sw-sb09(config-if)# switchport trunk allowed vlan remove 3 |
| 95 | !sw-sb09(config-if)# switchport trunk allowed vlan add 100 |
| 96 | !sw-sb09(config-if)# save |
| 97 | }}} |
| 98 | |
| 99 | We later realized that VLAN interfaces for VLANs 27 and 28 also need to be assigned Ip addresses in order for the switch to be able to ping the controller's VLAN interfaces. |
| 100 | {{{ |
| 101 | sw-sb09(config-if)# interface vlan 27 |
| 102 | !sw-sb09(config-if)# ip address 10.19.0.20 255.255.0.0 |
| 103 | !sw-sb09(config-if)# interface vlan 28 |
| 104 | !sw-sb09(config-if)# ip address 192.168.1.20 255.255.255.0 |
| 105 | !sw-sb09(config-if)# save |
| 106 | sw-sb09(config-if)# exit |
| 107 | sw-sb09(config)# exit |
| 108 | }}} |
| 109 | |
| 110 | pinging the interfaces...success. |
| 111 | {{{ |
| 112 | sw-sb09# ping 10.19.0.10 |
| 113 | PING 10.19.0.10 (10.19.0.10): 56 data bytes |
| 114 | 64 bytes from 10.19.0.10: icmp_seq=0 ttl=64 time=2.095 ms |
| 115 | 64 bytes from 10.19.0.10: icmp_s^C |
| 116 | ----10.19.0.10 PING Statistics---- |
| 117 | 2 packets transmitted, 2 packets received, 0.0% packet loss |
| 118 | round-trip min/avg/max = 1.097/1.596/2.095 ms |
| 119 | sw-sb09# ping 192.168.1.28 |
| 120 | PING 192.168.1.28 (192.168.1.28): 56 data bytes |
| 121 | 64 bytes from 192.168.1.28: icmp_seq=0 ttl=64 time=2.100 ms |
| 122 | 64 bytes from 192.168.1.28: icmp_seq=1 ttl=64 time=1.013 ms |
| 123 | ^C |
| 124 | ----192.168.1.28 PING Statistics---- |
| 125 | 2 packets transmitted, 2 packets received, 0.0% packet loss |
| 126 | round-trip min/avg/max = 1.013/1.556/2.100 ms |
| 127 | }}} |
| 128 | |
| 129 | === establishing switch-controller connections === |
| 130 | The code for the controller is found intuitively in the controller directory. Using `ptcp:[port]` as the connection method seems to work. |
| 131 | we also wanted an output and log of everything, so the full command was this (from the controller's directory) : |
| 132 | |
| 133 | ./controller ptcp:6633 -v --log-file=test.log |
| 134 | |
| 135 | the first part of the output - you can see the OFPT_HELLO messages, negotiation of the !OpenFlow verison, the OFPT_FEATURES_REQUEST, and the switch's OFPT_FEATURES_REPLY: |
| 136 | {{{ |
| 137 | Jul 16 12:25:43|00001|vlog|WARN|opened log file test.log |
| 138 | Jul 16 12:25:53|00002|rconn|DBG|tcp: entering ACTIVE |
| 139 | Jul 16 12:25:53|00003|vconn|DBG|tcp:172.16.100.10:58499: sent (Success): hello (xid=0xacec814): |
| 140 | |
| 141 | Jul 16 12:25:53|00004|vconn|DBG|tcp:172.16.100.10:58499: received: hello (xid=0x9a45bcaf): |
| 142 | |
| 143 | Jul 16 12:25:53|00005|vconn|DBG|tcp:172.16.100.10:58499: negotiated OpenFlow version 0x97 (we support versions 0x97 to 0x97 inclusive, peer no later than version 0x97) |
| 144 | Jul 16 12:25:53|00006|vconn|DBG|tcp:172.16.100.10:58499: sent (Success): features_request (xid=0x9eebe16b): |
| 145 | |
| 146 | Jul 16 12:25:53|00007|vconn|DBG|tcp:172.16.100.10:58499: sent (Success): set_config (xid=0xff52f51d): (sending flow expirations) miss_send_len=128 |
| 147 | |
| 148 | Jul 16 12:25:53|00008|vconn|DBG|tcp:172.16.100.10:58499: received: features_reply (xid=0x9eebe16b): ver:0x97, dpid:12345678987 |
| 149 | n_tables:2, n_buffers:256 |
| 150 | features: capabilities:0x17, actions:0x3ff |
| 151 | 0(25): addr:00:12:e2:c8:1f:b5, config: 0, state:0x1 |
| 152 | 1(26): addr:00:12:e2:c8:1f:b6, config: 0, state:0x1 |
| 153 | 2(27): addr:00:12:e2:c8:1f:b7, config: 0, state:0x1 |
| 154 | 3(28): addr:00:12:e2:c8:1f:b8, config: 0, state:0x1 |
| 155 | 4(29): addr:00:12:e2:c8:1f:b9, config: 0, state:0x1 |
| 156 | 5(30): addr:00:12:e2:c8:1f:ba, config: 0, state:0x1 |
| 157 | 6(31): addr:00:12:e2:c8:1f:bb, config: 0, state:0x1 |
| 158 | 7(32): addr:00:12:e2:c8:1f:bc, config: 0, state:0x1 |
| 159 | 8(33): addr:00:12:e2:c8:1f:bd, config: 0, state:0x1 |
| 160 | 9(34): addr:00:12:e2:c8:1f:be, config: 0, state:0x1 |
| 161 | 10(35): addr:00:12:e2:c8:1f:bf, config: 0, state:0x1 |
| 162 | 11(36): addr:00:12:e2:c8:1f:c0, config: 0, state:0x1 |
| 163 | }}} |
| 164 | |
| 165 | |