Changes between Version 3 and Version 4 of Cnbp2019/Agenda/NetworkSetup


Ignore:
Timestamp:
Feb 11, 2019, 10:00:10 AM (5 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Cnbp2019/Agenda/NetworkSetup

    v3 v4  
    111111||      VLAN60  ||      10.XY.60.254    ||      2401:DD00:20XY:2160::FFFF/64    ||             
    112112||      VLAN70  ||      10.XY.70.254    ||      2401:DD00:20XY:2270::FFFF/64    ||             
    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
     120In 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
     125Let'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{{{
     131FAC1(config)# vlan 2
     132FAC1(config-vlan)# name Core
     133FAC1(config-vlan)# exit
     134}}}
     135 - Then assign the IP Address to the VLAN interface. Get the IP from the [#point1 table]
     136{{{
     137CampusCore(config)#interface vlan 2
     138CampusCore(config-if)# ip address 10.0.2.1 255.255.255.0
     139CampusCore(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{{{
     144CampusCore(config)#interface FastEthernet 1/0
     145CampusCore(config-if)#switchport mode trunk
     146}}}
     147    * Define the encapsulation
     148{{{
     149CampusCore(config-if)#switchport trunk encapsulation dot1q
     150}}}
     151    * Give the Description of the interface
     152{{{
     153CampusCore(config-if)#description Core link to FacACore
     154CampusCore(config-if)#exit
     155}}}
     156    * Follow the same procedure for FacBCore link
     157{{{
     158CampusCore(config)#interface FastEthernet 1/1
     159CampusCore(config-if)#switchport mode trunk
     160CampusCore(config-if)#switchport trunk encapsulation dot1q
     161CampusCore(config-if)#description Core link to FacBCore
     162CampusCore(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{{{
     167FacACore(config)# vlan 2
     168FacACore(config-vlan)# name Core
     169FacACore(config-vlan)# exit
     170FacACore(config)#interface vlan 2
     171FacACore(config-if)# ip address 10.0.2.2 255.255.255.0
     172FacACore(config-if)# exit
     173FacACore(config)#interface FastEthernet 1/15
     174FacACore(config-if)#switchport mode trunk
     175FacACore(config-if)#switchport trunk encapsulation dot1q
     176FacACore(config-if)#description Core link to CampusCore
     177FacACore(config-if)#exit
     178}}}
     179
     180 - Now let's configure FacBCore
     181{{{
     182FacBCore(config)# vlan 2
     183FacBCore(config-vlan)# name Core
     184FacBCore(config-vlan)# exit
     185FacBCore(config)#interface vlan 2
     186FacBCore(config-if)# ip address 10.0.2.3 255.255.255.0
     187FacBCore(config-if)# exit
     188FacBCore(config)#interface FastEthernet 1/15
     189FacBCore(config-if)#switchport mode trunk
     190FacBCore(config-if)#switchport trunk encapsulation dot1q
     191FacBCore(config-if)#description Core link to CampusCore
     192FacBCore(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{{{
     199ping 10.0.2.1
     200ping 10.0.2.3
     201}}}
     202   * You should get a positive reply with '''"!!"'''
     203
     204==== Distribution Network Layer ====
     205
     206Let'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{{{
     212FacACore(config)# vlan 10
     213FacACore(config-vlan)# name Dept1
     214FacACore(config-vlan)# exit
     215}}}
     216 - Then assign the IP Address to the VLAN interface. Get the IP from the [#point1 table]
     217{{{
     218FacACore(config)#interface vlan 10
     219FacACore(config-if)# ip address 10.0.10.254 255.255.255.0
     220FacACore(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{{{
     225FacACore(config)#interface FastEthernet 1/0
     226FacACore(config-if)#switchport mode trunk
     227}}}
     228    * Define the encapsulation
     229{{{
     230FacACore(config-if)#switchport trunk encapsulation dot1q
     231}}}
     232    * Give the Description of the interface
     233{{{
     234FacACore(config-if)#description link to Dept1Sw
     235FacACore(config-if)#exit
     236}}}
     237 - Follow the same procedure for FacBCore device. VLAN 20 name is dept 2.
     238{{{
     239FacBCore(config)# vlan 20
     240FacBCore(config-vlan)# name Dept2
     241FacBCore(config-vlan)# exit
     242FacBCore(config)#interface vlan 20
     243FacBCore(config-if)# ip address 10.0.20.254 255.255.255.0
     244FacBCore(config-if)# exit
     245FacBCore(config)#interface FastEthernet 1/0
     246FacBCore(config-if)#switchport mode trunk
     247FacBCore(config-if)#switchport trunk encapsulation dot1q
     248FacBCore(config-if)#description link to Dept2Sw
     249FacBCore(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{{{
     255Dept1Sw(config)# vlan 10
     256Dept1Sw(config-vlan)# name Dept1
     257Dept1Sw(config-vlan)# exit
     258}}}
     259 - Next configure fast ethernet interface which connects to the Core device and give a description
     260{{{
     261Dept1Sw(config)#interface FastEthernet 1/15
     262Dept1Sw(config-if)#switchport mode trunk
     263Dept1Sw(config-if)#switchport trunk encapsulation dot1q
     264Dept1Sw(config-if)#description link to FacACore
     265Dept1Sw(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{{{
     269Dept1Sw(config)#interface FastEthernet 1/0
     270Dept1Sw(config-if)#switchport mode access
     271Dept1Sw(config-if)#switchport access vlan 10
     272Dept1Sw(config-if)#description link to Dept1PC
     273Dept1Sw(config-if)#exit
     274}}}
     275 - Follow the same steps for Dept2Sw
     276{{{
     277Dept2Sw(config)# vlan 20
     278Dept2Sw(config-vlan)# name Dept2
     279Dept2Sw(config-vlan)# exit
     280Dept2Sw(config)#interface FastEthernet 1/15
     281Dept2Sw(config-if)#switchport mode trunk
     282Dept2Sw(config-if)#switchport trunk encapsulation dot1q
     283Dept2Sw(config-if)#description link to FacBCore
     284Dept2Sw(config-if)#exit
     285Dept2Sw(config)#interface FastEthernet 1/0
     286Dept2Sw(config-if)#switchport mode access
     287Dept2Sw(config-if)#switchport access vlan 20
     288Dept2Sw(config-if)#description link to Dept2PC
     289Dept2Sw(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{{{
     294ping 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
     301Your 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{{{
     306CampusCore(config)# vlan 255
     307CampusCore(config-vlan)# name Public
     308CampusCore(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{{{
     312CampusCore(config)#interface vlan 255
     313CampusCore(config-if)# ip address 10.0.255.253 255.255.255.0
     314CampusCore(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{{{
     318CampusCore(config)#interface FastEthernet 1/15
     319CampusCore(config-if)#switchport mode access
     320CampusCore(config-if)#switchport access vlan 255
     321CampusCore(config-if)#description link to Border Router
     322CampusCore(config-if)#speed 100
     323CampusCore(config-if)#duplex full
     324CampusCore(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{{{
     336BorderRt(config)#interface fastEthernet 0/0
     337BorderRt(config-if)#ip address 10.0.255.254 255.255.255.0
     338BorderRt(config-if)#description LAN Port connects to CampusCore
     339BorderRt(config-if)#no shutdown
     340BorderRt(config-if)#speed 100
     341BorderRt(config-if)#duplex full
     342BorderRt(config-if)#exit
     343}}}
     344 - Configure the WAN port (fa 0/1)
     345{{{
     346BorderRt(config)#interface fastEthernet 0/1
     347BorderRt(config-if)#ip address x.x.x.x 255.255.255.0
     348BorderRt(config-if)#description WAN Port Bridged with CampusLAN host
     349BorderRt(config-if)#no shutdown
     350BorderRt(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{{{
     355ping 10.0.255.253
     356}}}
     357 - Now Check the routers connectivity in WAN port. Ping to the WAN Gateway
     358{{{
     359ping 192.248.6.254
     360}}}
     361 - Both these ping commands should give you a reply
     362
     363==== Routing ====
     364If 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{{{
     380CampusCore(config)#router ospf 1
     381}}}
     382    * Give the router ID
     383{{{
     384CampusCore(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{{{
     388CampusCore(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{{{
     392CampusCore(config-router)#network 10.0.2.0 0.0.0.255 area 2
     393CampusCore(config-router)#exit
     394}}}
     395    * You are enabling OSPF on VLAN 2. Use this command for that.
     396{{{
     397CampusCore(config)#interface vlan 2
     398CampusCore(config-if)# ip ospf 1 area 2
     399CampusCore(config-if)# exit
     400}}}
     401    * Now you have enable OSPF on !CampusCore Switch. Now lets add the default Route.
     402{{{
     403CampusCore(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{{{
     408FacACore(config)#router ospf 1
     409FacACore(config-router)#router-id 10.0.2.2
     410FacACore(config-router)#redistribute connected subnets
     411FacACore(config-router)#network 10.0.2.0 0.0.0.255 area 2
     412FacACore(config-router)#exit
     413FacACore(config)#interface vlan 2
     414FacACore(config-if)# ip ospf 1 area 2
     415FacACore(config-if)# exit
     416FacACore(config)# ip route 0.0.0.0 0.0.0.0 10.0.2.1
     417}}}
     418    * FacBCore
     419{{{
     420FacBCore(config)#router ospf 1
     421FacBCore(config-router)#router-id 10.0.2.3
     422FacBCore(config-router)#redistribute connected subnets
     423FacBCore(config-router)#network 10.0.2.0 0.0.0.255 area 2
     424FacBCore(config-router)#exit
     425FacBCore(config)#interface vlan 2
     426FacBCore(config-if)# ip ospf 1 area 2
     427FacBCore(config-if)# exit
     428FacBCore(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{{{
     433ping 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{{{
     440BorderRt(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{{{
     444ping 192.248.1.161
     445ping 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{{{
     452Router#show ip route
     453}}}
     454    * To get OSPF routes
     455{{{
     456Router#show ip route ospf
     457}}}
     458    * To get ospf neighbors
     459{{{
     460Router#show ip ospf neighbor
     461}}}
     462    * To reset OSPF process
     463{{{
     464clear ip ospf process
     465}}}
     466   
     467==== Router Configuration ====
     468Now 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{{{
     472BorderRt(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{{{
     476BorderRt(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{{{
     480BorderRt(config)#interface FastEthernet 0/0
     481BorderRt(config-if)#ip nat inside
     482BorderRt(config-if)#exit
     483BorderRt(config)#interface FastEthernet 0/1
     484BorderRt(config-if)#ip nat outside
     485BorderRt(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{{{
     489BorderRt(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{{{
     494Router#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
     501Let's capture some packets and do a analysis.
     502 - Log in to Dept1PC and and start blackbox.
     503{{{
     504sudo 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{{{
     515NO      Time            Source                  Destination     Protocol        Length  Info
     5169       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