Labb – DNS och SSH

I denna laboration kommer vi att utforska några nätverkstjänster, inklusive DNS, HTTP, FTP, DHCP och e-post. Vi kommer att fokusera på grundläggande konfigurationer för routrar och switchar samt hantering av nätverkstrafik. Observera att detaljerade grafiska konfigurationer finns i separata avsnitt och kommer inte att inkluderas här.

Nätverkstopologi

Jag fortsätter med samma nätverkstopologi som tidigare, men med några tillägg:

  • Topologin består av två företagsnätverk: DIGINTO och NACKA.
  • Fjärrhantering via SSH kommer att konfigureras till varje domän: diginto.se och nacka.se.
  • Användarkonton och lösenord som anges här är för enkelhets skull, men i verkligheten bör man följa strikta säkerhetsregler.
  • Vi kommer att använda IP-adressering utan att fördjupa oss för mycket i detaljer, men det är viktigt att ha en grundläggande förståelse för IP.

Konfigurationer

  • Switch> enable
  • Switch# configure terminal
  • Switch(config)# hostname DS1
  • DS1(config)# no ip domain-lookup
  • DS1(config)# enable secret enPa55
  • DS1(config)# banner motd #Only authorized access to this device!#
  • DS1(config)# ip domain-name diginto.se
  • DS1(config)# username admin privilege 15 secret ownPa5515
  • DS1(config)# username adminrouters privilege 12 secret ownPa5512
  • DS1(config)#crypto key generate rsa general-keys modulus 1024
  • DS1(config)# ip ssh version 2
  • DS1(config)# line vty 0 4
  • DS1(config-line)# transport input ssh
  • DS1(config-line)# login local
  • DS1(config-line)# loggin syncronuos
  • DS1(config-line)# exit
  • DS1(config)# interface vlan 1
  • DS1(config-if)# description SSH Management
  • DS1(config-if)# ip address 172.16.1.2 255.255.255.0
  • DS1(config-if)# no shutdown
  • DS1(config-if)# exit
  • DS1(config)# ip default-gateway 172.16.1.1
  • DS1(config)# end
  • DS1#

Switch> enable
Switch# configure terminal
Switch(config)# hostname DS2
DS2(config)# no ip domain-lookup
DS2(config)# enable secret enPa55
DS2(config)# banner motd #Only authorized access to this device!#
DS2(config)# ip domain-name diginto.se
DS2(config)# username admin privilege 15 secret ownPa5515
DS2(config)# username adminrouters privilege 12 secret ownPa5512
DS2(config)#crypto key generate rsa general-keys modulus 1024
DS2(config)# ip ssh version 2
DS2(config)# line vty 0 4
DS2(config-line)# transport input ssh
DS2(config-line)# login local
DS2(config-line)# loggin syncronuos
DS2(config-line)# exit
DS2(config)# interface vlan 1
DS2(config-if)# description SSH Management
DS2(config-if)# ip address 172.16.10.2 255.255.255.0
DS2(config-if)# no shutdown
DS2(config-if)# exit
DS2(config)# ip default-gateway 172.16.10.1
DS2(config)# end
DS2#

  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname DR1
  • DR1(config)# no ip domain-lookup
  • DR1(config)# enable secret enPa55
  • DR1(config)# banner #Only authorized access to this device!#
  • DR1(config)# ip domain-name diginto.se
  • DR1(config)# username admin privilege 15 secret ownPa5515
  • DR1(config)# username adminrouters privilege 15 secret rouPa5515
  • DR1(config)# crypto key generate rsa general-keys modulus 1024
  • DR1(config)# ip ssh version 2
  • DR1(config)# line vty 0 4
  • DR1(config-line)# transport input ssh
  • DR1(config-line)# login local
  • DR1(config-line)# loggin synchronuos
  • DR1(config-line)# exit
  • DR1(config)# interface Gig0/0
  • DR1(config-if)# description Connected to LAN CoreNet
  • DR1(config-if)# ip address 172.16.1.1 255.255.255.0
  • DR1(config-if)# no shutdown
  • DR1(config-if)# exit
  • DR1(config)# interface Gig0/1
  • DR1(config-if)# description Connected to LAN AccessNet
  • DR1(config-if)# ip address 172.16.10.1 255.255.255.0
  • DR1(config-if)# ip helper-address 172.16.1.6
  • DR1(config-if)# no shutdown
  • DR1(config-if)# exit
  • DR1(config)# interface Se0/0/0
  • DR1(config-if)# description Connected to ISP
  • DR1(config-if)# ip address 32.64.8.1 255.255.255.252
  • DR1(config-if)# no shutdown
  • DR1(config-if)# exit
  • DR1(config)# ip route 0.0.0.0 0.0.0.0 32.64.8.2
  • DR1(config)#end
  • DR1#
  • Switch> enable
  • Switch# configure terminal
  • Switch(config)# hostname NS1
  • NS1(config)# no ip domain-lookup
  • NS1(config)# enable secret enackPa55
  • NS1(config)# banner motd #Only authorized access to this device!#
  • NS1(config)# ip domain-name nacka.se
  • NS1(config)# username thor privilege 15 secret nackAPa5515
  • NS1(config)# username oden privilege 15 secret nackRPa5515
  • NS1(config)# crypto key generate rsa general-keys modulus 1024
  • NS1(config)#ip ssh version 2
  • NS1(config)# line vty 0 4
  • NS1(config-line)# transport input ssh
  • NS1(config-line)# login local
  • NS1(config-line)# loggin syncronuos
  • NS1(config-line)# exit
  • NS1(config)# interface vlan 1
  • NS1(config-if)# description SSH Management
  • NS1(config-if)# ip address 192.168.1.2 255.255.255.0
  • NS1(config-if)# no shutdown
  • NS1(config-if)# exit
  • NS1(config)# ip default-gateway 192.168.1.1
  • NS1(config)# end
  • NS1#
  • Switch> enable
  • Switch# configure terminal
  • Switch(config)# hostname NS2
  • NS2(config)# no ip domain-lookup
  • NS2(config)# enable secret enackPa55
  • NS2(config)# banner motd #Only authorized access to this device!#
  • NS2(config)# ip domain-name nacka.se
  • NS2(config)# username thor privilege 15 secret nackAPa5515
  • NS2(config)# username oden privilege 15 secret nackRPa5515
  • NS2(config)# crypto key generate rsa general-keys modulus 1024
  • NS2(config)#ip ssh version 2
  • NS2(config)# line vty 0 4
  • NS2(config-line)# transport input ssh
  • NS2(config-line)# login local
  • NS2(config-line)# loggin syncronuos
  • NS2(config-line)# exit
  • NS2(config)# interface vlan 1
  • NS2(config-if)# description SSH Management
  • NS2(config-if)# ip address 192.168.10.2 255.255.255.0
  • NS2(config-if)# no shutdown
  • NS2(config-if)# exit
  • NS2(config)# ip default-gateway 192.168.10.1
  • NS2(config)# end
  • NS2#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname NR1
  • NR1(config)# no ip domain-lookup
  • NR1(config)# enable secret enackPa55
  • NR1(config)# banner #Only authorized access to this device!#
  • NR1(config)# ip domain-name nacka.se
  • NR1(config)# username thor privilege 15 secret nackAPa5515
  • NR1(config)# username oden privilege 15 secret nackRPa5515
  • NR1(config)# crypto key generate rsa general-keys modulus 1024
  • NR1(config)# ip ssh version 2
  • NR1(config)# line vty 0 4
  • NR1(config-line)# transport input ssh
  • NR1(config-line)# login local
  • NR1(config-line)# loggin synchronuos
  • NR1(config-line)# exit
  • NR1(config)# interface Gig0/0
  • NR1(config-if)# description Connected to LAN ServerNet
  • NR1(config-if)# ip address 192.168.1.1 255.255.255.0
  • NR1(config-if)# no shutdown
  • NR1(config-if)# exit
  • NR1(config)# interface Gig0/1
  • NR1(config-if)# description Connected to LAN ClientNet
  • NR1(config-if)# ip address 192.168.10.1 255.255.255.0
  • NR1(config-if)# ip helper-address 172.16.1.6
  • NR1(config-if)# no shutdown
  • NR1(config-if)# exit
  • NR1(config)# interface Se0/0/1
  • NR1(config-if)# description Connected to ISP
  • NR1(config-if)# ip address 19.32.4.1 255.255.255.252
  • NR1(config-if)# no shutdown
  • NR1(config-if)# exit
  • NR1(config)# ip route 0.0.0.0 0.0.0.0 19.32.4.2
  • NR1(config)#end
  • NR1#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname ISP
  • ISP(config)# no ip domain-lookup
  • ISP(config)# enable secret enackPa55
  • ISP(config)# banner #Only authorized access to this device!#
  • ISP(config)# ip domain-name google.se
  • ISP(config)# username teadmin privilege 15 secret goAPa5515
  • ISP(config)# username tetech privilege 15 secret goRPa5515
  • ISP(config)# crypto key generate rsa modulus 1024
  • ISP(config)# ip ssh version 2
  • ISP(config)# line vty 0 4
  • ISP(config-line)# transport input ssh
  • ISP(config-line)# login local
  • ISP(config-line)# loggin synchronuos
  • ISP(config-line)# exit
  • ISP(config)# interface Gig0/1
  • ISP(config-if)# description Connected to GoogleNet
  • ISP(config-if)# ip address 8.8.8.1  255.255.255.0
  • ISP(config-if)# no shutdown
  • ISP(config-if)# exit
  • ISP(config)# interface Se0/0/0
  • ISP(config-if)# description DCE Connected to DR1
  • ISP(config-if)# clock rate 2000000
  • ISP(config-if)# ip address 38.64.8.2  255.255.255.252
  • ISP(config-if)# no shutdown
  • ISP(config-if)# exit
  • ISP(config)# interface Se0/0/0
  • ISP(config-if)# description DCE Connected to NR1
  • ISP(config-if)# clock rate 2000000
  • ISP(config-if)# ip address 19.32.4.2  255.255.255.252
  • ISP(config-if)# no shutdown
  • ISP(config-if)# exit
  • ISP(config)# ip route 172.16.0.0  255.255.240.0 38.64.8.1
  • ISP(config)# ip route 192.168.0.0  255.255.240.0 19.32.4.1
  • ISP(config)#end
  • ISP#

dns1 i CoreNet har registrerade DNS poster så här:

  • NS record: dns1.diginto.se 172.16.1.5
  • A record: dns1.diginto.se 172.16.1.5
  • A record: www.diginto.se 172.16.1.5
  • A record: dms1.diginto.se 172.16.1.6
  • A record: smtp.diginto.se 172.16.1.6
  • A record: pop.diginto.se 172.16.1.6
  • A record: smtp.nacka.se 192.168.1.6
  • A record: pop.nacka.se 192.168.1.6
  • A record: www.nacka.se 192.168.1.5
  • A record: www.google.se 8.8.8.9

nns1 i ServerNet har registrerade DNS poster så här:

  • NS record: nns1.nacka.se 192.168.1.5
  • A record: nns1.nacka.se 192.168.1.5
  • A record: www.nacka.se 192.168.1.5
  • A record: nms1.nacka.se 192.168.1.6
  • A record: smtp.nacka.se 192.168.1.6
  • A record: pop.nacka.se 192.168.1.6
  • A record: smtp.diginto.se 172.16.1.6
  • A record: pop.diginto.se 172.16.1.6
  • A record: www.diginto.se 172.16.1.5
  • A record: www.google.se 8.8.8.9

ns1 i GoogleNet har registrerade DNS poster så här:

  • NS record: gns1.google.se 8.8.8.8
  • A record: gns1.google.se 8.8.8.8
  • A record: www.google.se 8.8.8.9
  • A record: www.diginto.se 172.16.1.5
  • A record: www.nacka.se 192.168.1.5
  • A record: smtp.diginto.se 172.16.1.6
  • A record: pop.diginto.se 172.16.1.6
  • A record: smtp.nacka.se 192.168.1.6
  • A record: pop.nacka.se 192.168.1.6