113 | | || VLAN80 || 10.XY.80.254 || 2401:DD00:20XY:2280::FFFF/64 || |
| 113 | || VLAN80 || 10.XY.80.254 || 2401:DD00:20XY:2280::FFFF/64 || |
| 114 | |
| 115 | ---- |
| 116 | |
| 117 | |
| 118 | === Log in to the the devices === |
| 119 | |
| 120 | In GNS3 topology right click on each network device and select Console. It will open your device console screen on a putty. |
| 121 | |
| 122 | |
| 123 | ==== Core Network Layer==== |
| 124 | |
| 125 | Let's start Configuring the connectivity between core network (FAC1 and Fac2). We will start from Fac1. |
| 126 | |
| 127 | - Login to Fac1 device. Give your console port password (class password) |
| 128 | - Go to config mode from user mode. Give your enable password (class password) |
| 129 | - Core network runs on VLAN 2. Create VLAN 2 and name it '''Core''' |
| 130 | {{{ |
| 131 | FAC1(config)# vlan 2 |
| 132 | FAC1(config-vlan)# name Core |
| 133 | FAC1(config-vlan)# exit |
| 134 | }}} |
| 135 | - Then assign the IP Address to the VLAN interface. Get the IP from the [#point1 table] |
| 136 | {{{ |
| 137 | CampusCore(config)#interface vlan 2 |
| 138 | CampusCore(config-if)# ip address 10.0.2.1 255.255.255.0 |
| 139 | CampusCore(config-if)# exit |
| 140 | }}} |
| 141 | - Finally configure fast ethernet interfaces switchport modes. You can find then from the [#point2 table] |
| 142 | * Fisrt make the interface a trunk port. This is for the FacACore link |
| 143 | {{{ |
| 144 | CampusCore(config)#interface FastEthernet 1/0 |
| 145 | CampusCore(config-if)#switchport mode trunk |
| 146 | }}} |
| 147 | * Define the encapsulation |
| 148 | {{{ |
| 149 | CampusCore(config-if)#switchport trunk encapsulation dot1q |
| 150 | }}} |
| 151 | * Give the Description of the interface |
| 152 | {{{ |
| 153 | CampusCore(config-if)#description Core link to FacACore |
| 154 | CampusCore(config-if)#exit |
| 155 | }}} |
| 156 | * Follow the same procedure for FacBCore link |
| 157 | {{{ |
| 158 | CampusCore(config)#interface FastEthernet 1/1 |
| 159 | CampusCore(config-if)#switchport mode trunk |
| 160 | CampusCore(config-if)#switchport trunk encapsulation dot1q |
| 161 | CampusCore(config-if)#description Core link to FacBCore |
| 162 | CampusCore(config-if)#exit |
| 163 | }}} |
| 164 | |
| 165 | - You have successfully configured the !CampusCore device for you core networks connectivity. Let's move on to FacACore device. |
| 166 | {{{ |
| 167 | FacACore(config)# vlan 2 |
| 168 | FacACore(config-vlan)# name Core |
| 169 | FacACore(config-vlan)# exit |
| 170 | FacACore(config)#interface vlan 2 |
| 171 | FacACore(config-if)# ip address 10.0.2.2 255.255.255.0 |
| 172 | FacACore(config-if)# exit |
| 173 | FacACore(config)#interface FastEthernet 1/15 |
| 174 | FacACore(config-if)#switchport mode trunk |
| 175 | FacACore(config-if)#switchport trunk encapsulation dot1q |
| 176 | FacACore(config-if)#description Core link to CampusCore |
| 177 | FacACore(config-if)#exit |
| 178 | }}} |
| 179 | |
| 180 | - Now let's configure FacBCore |
| 181 | {{{ |
| 182 | FacBCore(config)# vlan 2 |
| 183 | FacBCore(config-vlan)# name Core |
| 184 | FacBCore(config-vlan)# exit |
| 185 | FacBCore(config)#interface vlan 2 |
| 186 | FacBCore(config-if)# ip address 10.0.2.3 255.255.255.0 |
| 187 | FacBCore(config-if)# exit |
| 188 | FacBCore(config)#interface FastEthernet 1/15 |
| 189 | FacBCore(config-if)#switchport mode trunk |
| 190 | FacBCore(config-if)#switchport trunk encapsulation dot1q |
| 191 | FacBCore(config-if)#description Core link to CampusCore |
| 192 | FacBCore(config-if)#exit |
| 193 | }}} |
| 194 | |
| 195 | - Finally Verify the connectivity |
| 196 | * Go to FacACore device |
| 197 | * Go to privileged mode and ping !CampusCore and FacBCore |
| 198 | {{{ |
| 199 | ping 10.0.2.1 |
| 200 | ping 10.0.2.3 |
| 201 | }}} |
| 202 | * You should get a positive reply with '''"!!"''' |
| 203 | |
| 204 | ==== Distribution Network Layer ==== |
| 205 | |
| 206 | Let's Start Configuring the distribution layer of your campus LAN. Here you will have to configure both Layer 3 switches (FacACore and FacBCore) and Layer 2 Switches (Dept1PC and Dept2PC). Let's start from Layer 3 devices. |
| 207 | |
| 208 | - Login to FacACore device |
| 209 | - Go to config mode from privileged mode |
| 210 | - FacACore is the Core device in Faculty A and It can have different departments. In this scenario department 1 is in faculty A and It's VLAN is VLAN10. Create VLAN 10 and Name it '''Dept1''' |
| 211 | {{{ |
| 212 | FacACore(config)# vlan 10 |
| 213 | FacACore(config-vlan)# name Dept1 |
| 214 | FacACore(config-vlan)# exit |
| 215 | }}} |
| 216 | - Then assign the IP Address to the VLAN interface. Get the IP from the [#point1 table] |
| 217 | {{{ |
| 218 | FacACore(config)#interface vlan 10 |
| 219 | FacACore(config-if)# ip address 10.0.10.254 255.255.255.0 |
| 220 | FacACore(config-if)# exit |
| 221 | }}} |
| 222 | - Next configure fast ethernet interfaces switchport modes. You can find then from the [#point2 table] |
| 223 | * Fisrt make the interface a trunk port. |
| 224 | {{{ |
| 225 | FacACore(config)#interface FastEthernet 1/0 |
| 226 | FacACore(config-if)#switchport mode trunk |
| 227 | }}} |
| 228 | * Define the encapsulation |
| 229 | {{{ |
| 230 | FacACore(config-if)#switchport trunk encapsulation dot1q |
| 231 | }}} |
| 232 | * Give the Description of the interface |
| 233 | {{{ |
| 234 | FacACore(config-if)#description link to Dept1Sw |
| 235 | FacACore(config-if)#exit |
| 236 | }}} |
| 237 | - Follow the same procedure for FacBCore device. VLAN 20 name is dept 2. |
| 238 | {{{ |
| 239 | FacBCore(config)# vlan 20 |
| 240 | FacBCore(config-vlan)# name Dept2 |
| 241 | FacBCore(config-vlan)# exit |
| 242 | FacBCore(config)#interface vlan 20 |
| 243 | FacBCore(config-if)# ip address 10.0.20.254 255.255.255.0 |
| 244 | FacBCore(config-if)# exit |
| 245 | FacBCore(config)#interface FastEthernet 1/0 |
| 246 | FacBCore(config-if)#switchport mode trunk |
| 247 | FacBCore(config-if)#switchport trunk encapsulation dot1q |
| 248 | FacBCore(config-if)#description link to Dept2Sw |
| 249 | FacBCore(config-if)#exit |
| 250 | }}} |
| 251 | - Now the Core devices are done, Let's Configure Layer 2 devices. Login to Dept1PC |
| 252 | - Go to config mode |
| 253 | - Create Vlan 10 and Give a Name |
| 254 | {{{ |
| 255 | Dept1Sw(config)# vlan 10 |
| 256 | Dept1Sw(config-vlan)# name Dept1 |
| 257 | Dept1Sw(config-vlan)# exit |
| 258 | }}} |
| 259 | - Next configure fast ethernet interface which connects to the Core device and give a description |
| 260 | {{{ |
| 261 | Dept1Sw(config)#interface FastEthernet 1/15 |
| 262 | Dept1Sw(config-if)#switchport mode trunk |
| 263 | Dept1Sw(config-if)#switchport trunk encapsulation dot1q |
| 264 | Dept1Sw(config-if)#description link to FacACore |
| 265 | Dept1Sw(config-if)#exit |
| 266 | }}} |
| 267 | - Configure fast ethernet interface, which connects to the User PC to an access port of VLAN 10 and give a description |
| 268 | {{{ |
| 269 | Dept1Sw(config)#interface FastEthernet 1/0 |
| 270 | Dept1Sw(config-if)#switchport mode access |
| 271 | Dept1Sw(config-if)#switchport access vlan 10 |
| 272 | Dept1Sw(config-if)#description link to Dept1PC |
| 273 | Dept1Sw(config-if)#exit |
| 274 | }}} |
| 275 | - Follow the same steps for Dept2Sw |
| 276 | {{{ |
| 277 | Dept2Sw(config)# vlan 20 |
| 278 | Dept2Sw(config-vlan)# name Dept2 |
| 279 | Dept2Sw(config-vlan)# exit |
| 280 | Dept2Sw(config)#interface FastEthernet 1/15 |
| 281 | Dept2Sw(config-if)#switchport mode trunk |
| 282 | Dept2Sw(config-if)#switchport trunk encapsulation dot1q |
| 283 | Dept2Sw(config-if)#description link to FacBCore |
| 284 | Dept2Sw(config-if)#exit |
| 285 | Dept2Sw(config)#interface FastEthernet 1/0 |
| 286 | Dept2Sw(config-if)#switchport mode access |
| 287 | Dept2Sw(config-if)#switchport access vlan 20 |
| 288 | Dept2Sw(config-if)#description link to Dept2PC |
| 289 | Dept2Sw(config-if)#exit |
| 290 | }}} |
| 291 | - You have configured your distribution layer. Check and verify the connectivity |
| 292 | * Go to Dept1PC and try ping the gateway (VLAN 10 Interface IP of FacACore) |
| 293 | {{{ |
| 294 | ping 10.0.10.254 |
| 295 | }}} |
| 296 | * You should get a reply |
| 297 | * Try the same in Dept2PC |
| 298 | |
| 299 | ==== Connecting LAN to the Router ==== |
| 300 | |
| 301 | Your Campus LAN is connecting to the outside through a border router. Your !CampusCore switch connects to this border router. In this link router's fast ethernet interface IP connects with the Core switch's vlan interface IP. Let's start configuring this link starting from the !CampusCore. |
| 302 | |
| 303 | - Login to !CampusCore switch and switch to config mode |
| 304 | - Create VLAN 255 and name it Public |
| 305 | {{{ |
| 306 | CampusCore(config)# vlan 255 |
| 307 | CampusCore(config-vlan)# name Public |
| 308 | CampusCore(config-vlan)# exit |
| 309 | }}} |
| 310 | - Then assign the IP Address to the VLAN interface. Get the IP from the [#point1 table]. In the real situation this VLAN could be a public IP range which is assign to your Institute. In this Lab we are using a private IP block. |
| 311 | {{{ |
| 312 | CampusCore(config)#interface vlan 255 |
| 313 | CampusCore(config-if)# ip address 10.0.255.253 255.255.255.0 |
| 314 | CampusCore(config-if)# exit |
| 315 | }}} |
| 316 | - Next configure fast ethernet interface which connects to the Core device and give a description.You can find then from the [#point2 table] |
| 317 | {{{ |
| 318 | CampusCore(config)#interface FastEthernet 1/15 |
| 319 | CampusCore(config-if)#switchport mode access |
| 320 | CampusCore(config-if)#switchport access vlan 255 |
| 321 | CampusCore(config-if)#description link to Border Router |
| 322 | CampusCore(config-if)#speed 100 |
| 323 | CampusCore(config-if)#duplex full |
| 324 | CampusCore(config-if)#exit |
| 325 | }}} |
| 326 | '''Note''': In the real environment you might not need Duplex and Speed. It will be negotiate automatically |
| 327 | |
| 328 | - Now you have done !CampusCore configuration. Let's start routers Configuration. |
| 329 | - Login to !BorderRt Router and switch to config mode |
| 330 | - Router's IP allocation is as follows. You can get your Router's IP address from [wiki:2017Ipv6ipallocation here] |
| 331 | ||= Interface Name =||= IP Address =|| |
| 332 | ||Fast Ethernet 0/0 ||10.0.255.254/24|| |
| 333 | ||Fast Ethernet 0/1 ||<Your Routers WAN IP>|| |
| 334 | - Let's configure the LAN port (fa 0/0) |
| 335 | {{{ |
| 336 | BorderRt(config)#interface fastEthernet 0/0 |
| 337 | BorderRt(config-if)#ip address 10.0.255.254 255.255.255.0 |
| 338 | BorderRt(config-if)#description LAN Port connects to CampusCore |
| 339 | BorderRt(config-if)#no shutdown |
| 340 | BorderRt(config-if)#speed 100 |
| 341 | BorderRt(config-if)#duplex full |
| 342 | BorderRt(config-if)#exit |
| 343 | }}} |
| 344 | - Configure the WAN port (fa 0/1) |
| 345 | {{{ |
| 346 | BorderRt(config)#interface fastEthernet 0/1 |
| 347 | BorderRt(config-if)#ip address x.x.x.x 255.255.255.0 |
| 348 | BorderRt(config-if)#description WAN Port Bridged with CampusLAN host |
| 349 | BorderRt(config-if)#no shutdown |
| 350 | BorderRt(config-if)#exit |
| 351 | }}} |
| 352 | - You have successfully finished connecting !CampusCore to the !BorderRt router. Let's verify the connectivity using the ping command. |
| 353 | - Go to !BorderRt and ping to !CampusCore switch's VLAN 255 Interface IP |
| 354 | {{{ |
| 355 | ping 10.0.255.253 |
| 356 | }}} |
| 357 | - Now Check the routers connectivity in WAN port. Ping to the WAN Gateway |
| 358 | {{{ |
| 359 | ping 192.248.6.254 |
| 360 | }}} |
| 361 | - Both these ping commands should give you a reply |
| 362 | |
| 363 | ==== Routing ==== |
| 364 | If You go to the Dept1PC and try a Ping to Dept2PC (10.0.20.1) and !BorderRt router LAN port(10.0.255.254), you will not get a reply. That is because you don't have inter VLAN routing yet. In this Lab we will enable OSPF in all the Layer 3 devices and we will add default routes as following table. |
| 365 | |
| 366 | - Following are the default routes of the devices |
| 367 | ||= Device =||= Default Route Destination IP =||= Default Route Destination Description =|| |
| 368 | || !BorderRt || 192.248.6.254 || This is Configured in the router in the Lab || |
| 369 | || !CampusCore || 10.0.255.254 || !BorderRt routers LAN interface IP || |
| 370 | || FacACore || 10.0.2.1 || !CampusCore Switches VLAN2 Interface IP || |
| 371 | || FacBCore || 10.0.2.1 || !CampusCore Switches VLAN2 Interface IP || |
| 372 | || Dept1PC || none || This is a L2 device || |
| 373 | || Dept2PC || none || This is a L2 device || |
| 374 | || Dept1PC || 10.0.10.254 || FacACore Switches VLAN10 Interface IP || |
| 375 | || Dept2PC || 10.0.20.254 || FacBCore Switches VLAN20 Interface IP || |
| 376 | - Now let's enable OSPF on Core devices. Starting from !CampusCore |
| 377 | * Login to !CampusCore switch and switch to config mode |
| 378 | * Define OSPF process and Process ID. In this lab use process ID as 1 |
| 379 | {{{ |
| 380 | CampusCore(config)#router ospf 1 |
| 381 | }}} |
| 382 | * Give the router ID |
| 383 | {{{ |
| 384 | CampusCore(config-router)#router-id 10.0.2.1 |
| 385 | }}} |
| 386 | * You are going to announce the subnets which are directly connects to you. Use this command for that |
| 387 | {{{ |
| 388 | CampusCore(config-router)#redistribute connected subnets |
| 389 | }}} |
| 390 | * You are announcing to the core network (10.0.2.0/24) in area 2. Use this command for this |
| 391 | {{{ |
| 392 | CampusCore(config-router)#network 10.0.2.0 0.0.0.255 area 2 |
| 393 | CampusCore(config-router)#exit |
| 394 | }}} |
| 395 | * You are enabling OSPF on VLAN 2. Use this command for that. |
| 396 | {{{ |
| 397 | CampusCore(config)#interface vlan 2 |
| 398 | CampusCore(config-if)# ip ospf 1 area 2 |
| 399 | CampusCore(config-if)# exit |
| 400 | }}} |
| 401 | * Now you have enable OSPF on !CampusCore Switch. Now lets add the default Route. |
| 402 | {{{ |
| 403 | CampusCore(config)# ip route 0.0.0.0 0.0.0.0 10.0.255.254 |
| 404 | }}} |
| 405 | - Follow the same steps in FacACore and FacBCore |
| 406 | * FacACore |
| 407 | {{{ |
| 408 | FacACore(config)#router ospf 1 |
| 409 | FacACore(config-router)#router-id 10.0.2.2 |
| 410 | FacACore(config-router)#redistribute connected subnets |
| 411 | FacACore(config-router)#network 10.0.2.0 0.0.0.255 area 2 |
| 412 | FacACore(config-router)#exit |
| 413 | FacACore(config)#interface vlan 2 |
| 414 | FacACore(config-if)# ip ospf 1 area 2 |
| 415 | FacACore(config-if)# exit |
| 416 | FacACore(config)# ip route 0.0.0.0 0.0.0.0 10.0.2.1 |
| 417 | }}} |
| 418 | * FacBCore |
| 419 | {{{ |
| 420 | FacBCore(config)#router ospf 1 |
| 421 | FacBCore(config-router)#router-id 10.0.2.3 |
| 422 | FacBCore(config-router)#redistribute connected subnets |
| 423 | FacBCore(config-router)#network 10.0.2.0 0.0.0.255 area 2 |
| 424 | FacBCore(config-router)#exit |
| 425 | FacBCore(config)#interface vlan 2 |
| 426 | FacBCore(config-if)# ip ospf 1 area 2 |
| 427 | FacBCore(config-if)# exit |
| 428 | FacBCore(config)# ip route 0.0.0.0 0.0.0.0 10.0.2.1 |
| 429 | }}} |
| 430 | - Now you have enable Routing in your Core network. Let's verify whether it is working. |
| 431 | * Go to Dept1PC and try a Ping to Dept2PC |
| 432 | {{{ |
| 433 | ping 10.0.20.1 |
| 434 | }}} |
| 435 | * It should give you a reply |
| 436 | - add the !BorderRt Routers default gateway |
| 437 | * Go to !BorderRt and switch to config mode |
| 438 | * Add the default route |
| 439 | {{{ |
| 440 | BorderRt(config)# ip route 0.0.0.0 0.0.0.0 192.248.6.254 |
| 441 | }}} |
| 442 | * Verify the route by ping a known host from the !BorderRt router |
| 443 | {{{ |
| 444 | ping 192.248.1.161 |
| 445 | ping www.google.com |
| 446 | }}} |
| 447 | * Both should give you a reply |
| 448 | |
| 449 | - Some troubleshooting commands |
| 450 | * You can get the routing table by following |
| 451 | {{{ |
| 452 | Router#show ip route |
| 453 | }}} |
| 454 | * To get OSPF routes |
| 455 | {{{ |
| 456 | Router#show ip route ospf |
| 457 | }}} |
| 458 | * To get ospf neighbors |
| 459 | {{{ |
| 460 | Router#show ip ospf neighbor |
| 461 | }}} |
| 462 | * To reset OSPF process |
| 463 | {{{ |
| 464 | clear ip ospf process |
| 465 | }}} |
| 466 | |
| 467 | ==== Router Configuration ==== |
| 468 | Now you have complete most of the IPv4 Configurations. Go to DeptPC1 and try a ping to the DNS server (192.248.1.161). You will not get a reply. That is because your PC have a private IP. There must be a method to connect to the outside using a private IP. What we use here is adding a NAT in !BorderRt router. There are different NAT types what we use here is the method called NAT overload. In this method we can assign set of local(private) IP's and overload it to a interface with a global(public) IP. So the outside the network will see the traffic coming from local IP's as traffic coming from the global IP. Let's add this configuration to your router. |
| 469 | - Login to !BorderRt Router and switch to config mode |
| 470 | - Let's define the local IP set in a ACL. |
| 471 | {{{ |
| 472 | BorderRt(config)#access-list 1 permit 10.0.0.0 0.0.255.255 |
| 473 | }}} |
| 474 | - Then dd the NAT entry. In your router public IP is assign to !FastEthernet 0/1 interface |
| 475 | {{{ |
| 476 | BorderRt(config)#ip nat inside source list 1 interface FastEthernet0/1 overload |
| 477 | }}} |
| 478 | - Then define NAT inside & NAT outside. NAT inside is your router's LAN port and Nat outside is your router's WAN port. |
| 479 | {{{ |
| 480 | BorderRt(config)#interface FastEthernet 0/0 |
| 481 | BorderRt(config-if)#ip nat inside |
| 482 | BorderRt(config-if)#exit |
| 483 | BorderRt(config)#interface FastEthernet 0/1 |
| 484 | BorderRt(config-if)#ip nat outside |
| 485 | BorderRt(config-if)#exit |
| 486 | }}} |
| 487 | - Finally add a static route in the router so that the traffic coming to our defined network will redirect to !CampusCore switch |
| 488 | {{{ |
| 489 | BorderRt(config)#ip route 10.0.0.0 255.255.0.0 10.0.255.253 |
| 490 | }}} |
| 491 | - Now try a ping from DeptPC1 to the DNS server. It should give reply |
| 492 | - Use the following for NAT troubleshooting |
| 493 | {{{ |
| 494 | Router#show ip nat translation |
| 495 | }}} |
| 496 | |
| 497 | '''You have successfully complete the IPv4 configurations. save all the configurations in all the routers''' |
| 498 | |
| 499 | === Wireshark === |
| 500 | |
| 501 | Let's capture some packets and do a analysis. |
| 502 | - Log in to Dept1PC and and start blackbox. |
| 503 | {{{ |
| 504 | sudo startx |
| 505 | }}} |
| 506 | - Right click on desktop and open '''xterm''' terminal |
| 507 | - type '''wireshark''' and press enter |
| 508 | - On the wireshark interface select the '''enp0s3''' interface and click '''Capture packets''' button |
| 509 | - While you are capturing. Open another xterm terminal. And type '''midori''' and press enter. |
| 510 | - You will get midori browser. Click the arrow head at top right corner to get the menu. In the menu select '''New Private Browsing Window''' |
| 511 | - Browse for '''www.google.com''' from the browser. |
| 512 | - Go back to wireshark and '''stop''' capturing |
| 513 | - You will see plenty of broadcast packets. They will look like following |
| 514 | {{{ |
| 515 | NO Time Source Destination Protocol Length Info |
| 516 | 9 0.579325000 00:fe:c9:3e:13:a0 Broadcast ARP 60 Who has x.x.x.x? Tell y.y.y.y |
| 517 | }}} |
| 518 | - Click on '''Statistics''' and select '''Summary''' |
| 519 | - You will get a summary window and it will show you some percentages. You will see a high percentage of ARP messages. |
| 520 | - Go to '''file''' in main menu and click '''close''' and exit without saving |
| 521 | - You will get the initial interface. Select '''enp0s3''' interface |
| 522 | - click on the '''green flag''' in the '''using this filter...''' dropdown list. |
| 523 | - Select '''New capture filter:icmp6''' |
| 524 | - Start Capturing |