Linux Routers and Community Networks Lloren Cerd-Alabern - - PowerPoint PPT Presentation

linux routers and community networks
SMART_READER_LITE
LIVE PREVIEW

Linux Routers and Community Networks Lloren Cerd-Alabern - - PowerPoint PPT Presentation

Summer Course at Mekelle Institute of Technology. July, 2015. Linux Routers and Community Networks Lloren Cerd-Alabern http://personals.ac.upc.edu/llorenc llorenc@ac.upc.edu Universitat Politnica de Catalunya, Barcelona, Spain


slide-1
SLIDE 1

Summer Course at Mekelle Institute of Technology. July, 2015.

Linux Routers and Community Networks

Llorenç Cerdà-Alabern

http://personals.ac.upc.edu/llorenc llorenc@ac.upc.edu

Universitat Politènica de Catalunya, Barcelona, Spain

Revision: 0e36644 (2015-07-09) Llorenç Cerdà-Alabern Linux Routers and Community Networks 1 / 191

slide-2
SLIDE 2

Introduction Where I come from Linux Routers

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Parts I Introduction II Lab 1: Basic Network Configuration III Lab 2: RIP and OSPF IV Lab 3: Firewall configuration V Lab 4: Community Networks VI Lab 5: Network Management

Llorenç Cerdà-Alabern Linux Routers and Community Networks 2 / 191

slide-3
SLIDE 3

Introduction Where I come from Linux Routers

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part I Introduction

Outline Where I come from Linux Routers

Llorenç Cerdà-Alabern Linux Routers and Community Networks 3 / 191

slide-4
SLIDE 4

Introduction Where I come from Linux Routers

Introduction

Where I come from

Mekelle vs. Barcelona

  • Barcelona - Mekelle: 7,660 km

Ethiopia Spain Tigray Catalonia Mekelle Barcelona Area [km2] 1.1 M 0.5 M 41 k 32 k 24.4 803 Population 90 M 47 M 4.3 M∗ 7.5 M 219 k 4.7 M

∗ 2007 Census. Source: Wikipedia. Llorenç Cerdà-Alabern Linux Routers and Community Networks 4 / 191

slide-5
SLIDE 5

Introduction Where I come from Linux Routers

Introduction

Where I come from

A bit of history: Barcino

  • Iberian, Carthaginian and Roman Town, called Barcino 15 BC.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 5 / 191

slide-6
SLIDE 6

Introduction Where I come from Linux Routers

Introduction

Where I come from

Barcelona Eixample Sagrada Familia Barça

Llorenç Cerdà-Alabern Linux Routers and Community Networks 6 / 191

slide-7
SLIDE 7

Introduction Where I come from Linux Routers

Introduction

Where I come from

Universitat Politècnica de Catalunya (UPC)

Campus Nord

  • UPC: Public University of Catalonia, focussed on tech. studies.
  • UPC has 22 Schools in 7 towns.
  • Facultat d’Informàtica de Barcelona (Computer Science) is in

Campus Nord and has around 2,000 students.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 7 / 191

slide-8
SLIDE 8

Introduction Where I come from Linux Routers

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part I Introduction

Outline Where I come from Linux Routers

Llorenç Cerdà-Alabern Linux Routers and Community Networks 8 / 191

slide-9
SLIDE 9

Introduction Where I come from Linux Routers

Introduction

Linux Routers

What is a Router?

  • Devices that use a common protocol: The Internet Protocol, IP.
  • Exchange Datagramans using any kind of physical network

(LAN or WAN).

  • Interconnect IP Networks: Networks of devices having

interfaces with unique addresses, sharing a common netid, or IP prefix (most significant bits of the IP address).

Llorenç Cerdà-Alabern Linux Routers and Community Networks 9 / 191

slide-10
SLIDE 10

Introduction Where I come from Linux Routers

Introduction

Linux Routers

IPv4 address

bits 31 ++++++++++++++++ |netid | hostid| ++++++++++++++++

  • 4 bytes (32 bits)
  • Dotted notation: 10.0.1.1, Mask: 255.255.255.0 or /24.
  • Host loopback network: 127.0.0.0/8.
  • Private add.: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.

netid hostid Class (bytes) (bytes) Codification range A 1 3 0xxxx···x 0.0.0.0 ∼ 127.255.255.255 B 2 2 10xxx···x 128.0.0.0 ∼ 191.255.255.255 C 3 1 110xx···x 192.0.0.0 ∼ 223.255.255.255 D

  • 1110x···x

224.0.0.0 ∼ 239.255.255.255 E

  • 1111x···x

240.0.0.0 ∼ 255.255.255.255

Llorenç Cerdà-Alabern Linux Routers and Community Networks 10 / 191

slide-11
SLIDE 11

Introduction Where I come from Linux Routers

Introduction

Linux Routers

IPv6 address

bits 127 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | netid | hostid | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  • 16 bytes (128 bits)
  • Notation: ff02:0000:0000:0000:0000:0000:0000:0001/64 (8

quads of 4 nibbles). Simplification: supress leading and group zeroes: ff02::1/64

  • Loopback: ::1/128
  • Link local unicast: fe80::/10.

Interface notation: fe80::4e5e:cff:fee9:fc89%eth0

  • Unique local unicast (ULA): fc00::/7 (equivalent to private IPv4)
  • Global unicast: 2000::/3
  • Multicast: ff00::/8
  • Link local all nodes: ff02::1

Example: IPv6ll of all nodes in eth0: ping6 ff02::1%eth0

  • Link local all routers: ff02::2

Llorenç Cerdà-Alabern Linux Routers and Community Networks 11 / 191

slide-12
SLIDE 12

Introduction Where I come from Linux Routers

Introduction

Linux Routers

How a router works

~# route -n Kernel IP routing table Destination Gateway Genmask Metric Iface 0.0.0.0 10.1.24.97 0.0.0.0 30 eth1.3 10.1.24.96 0.0.0.0 255.255.255.224 30 eth1.3 ~# ip r l default via 10.1.24.97 dev eth1.3 proto static metric 30 10.1.24.96/27 dev eth1.3 proto static scope link metric 30 Llorenç Cerdà-Alabern Linux Routers and Community Networks 12 / 191

slide-13
SLIDE 13

Introduction Where I come from Linux Routers

Introduction

Linux Routers

Commertial routers CISCO Juniper

Llorenç Cerdà-Alabern Linux Routers and Community Networks 13 / 191

slide-14
SLIDE 14

Introduction Where I come from Linux Routers

Introduction

Linux Routers

SOHO routers CISCO Buffalo TP-link Mikrotik Huawei Ubiquiti Zyxel D-link ···

Llorenç Cerdà-Alabern Linux Routers and Community Networks 14 / 191

slide-15
SLIDE 15

Introduction Where I come from Linux Routers

Introduction

Linux Routers

Router Operating Systems

  • CISCO: Internetwork Operating System, IOS.
  • Juniper: Junos OS.
  • Mikrotic: RouterOS.
  • Ubiquiti: AirOS.
  • Zyxel: ZyNOS.
  • Device specific: TP-Link, ···
  • Unix/Linuxa: Alpine, NetBSD, DD-WRT, EdgeOS, FREESCO,

FreeWRT, OpenWrt, Tomato, ···.

aSee Wikipedia: https://en.wikipedia.org/wiki/List_of_router_

and_firewall_distributions

Llorenç Cerdà-Alabern Linux Routers and Community Networks 15 / 191

slide-16
SLIDE 16

Introduction Where I come from Linux Routers

Introduction

Linux Routers

Why OpenWrt?

  • GNU/Linux distribution originally designed for embedded devices.
  • Free, open source.
  • Active web page with a lot of documentationa.
  • Continuously improved by a wide and very active community.
  • Supported by a large number of devicesb.

ahttps://openwrt.org/ bhttp://wiki.openwrt.org/toh/start

Llorenç Cerdà-Alabern Linux Routers and Community Networks 16 / 191

slide-17
SLIDE 17

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Parts I Introduction II Lab 1: Basic Network Configuration III Lab 2: RIP and OSPF IV Lab 3: Firewall configuration V Lab 4: Community Networks VI Lab 5: Network Management

Llorenç Cerdà-Alabern Linux Routers and Community Networks 17 / 191

slide-18
SLIDE 18

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 18 / 191

slide-19
SLIDE 19

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Description

Objectives

  • Basic Linux administration commands.
  • Build a straight-through patch cord.
  • Install OpenWrt.
  • Configuring networking interfaces and static routing.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 19 / 191

slide-20
SLIDE 20

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 20 / 191

slide-21
SLIDE 21

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Directories

  • cd: Change directory.
  • mkdir: make directory, rmdir: remove directory.
  • ls: list directory.
  • rm: remove file, rm -r directory: remove directory and its

contents.

  • chown: change owner file/directory.
  • chmod: change permissions.

Examples: chmod 700 file, chmod ugo+rwx file.

  • cat, more, less: dump file content.
  • df -h: list disk partitions.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 21 / 191

slide-22
SLIDE 22

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Files

  • grep: globally search regular expression (regex) and print,

filter file content using regex.

~# cat network | grep eth.

  • ption ifname ’eth0’
  • ption ifname ’eth1’
  • find: find file. Examples:

~# find . -name network ./config/network ./init.d/network ~# find /etc -name \*.conf -exec grep nameserver {} \; -print nameserver 127.0.0.1 /etc/resolv.conf

  • sed: stream editor.

~# sed ’s/day/night/’ <old >new ~# iw wlan1 scan | sed -n /^BSS/,/SSID/p BSS 02:ca:ff:ee:ba:be(on wlan1) -- joined TSF: 0 usec (0d, 00:00:00) freq: 5825 ... last seen: 1687530 ms ago SSID: qMp Llorenç Cerdà-Alabern Linux Routers and Community Networks 22 / 191

slide-23
SLIDE 23

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Processes

  • ps, top: show running processes.
  • kill pid: kill process with process id pid.
  • killall cmd: kill command cmd.

~# top Mem: 25404K used, 3608K free, 0K shrd, 964K buff, 4600K cached CPU: 1% usr 1% sys 0% nic 96% idle 0% io 0% irq 0% sirq Load average: 0.05 0.09 0.12 1/51 377 PID PPID USER STAT VSZ %VSZ %CPU COMMAND 8432 1 root S 2056 7% 1% /usr/sbin/bmx6 -f /etc/config/bmx6 -d 3 2 root SW 0% 0% [ksoftirqd/0] 27482 2 root SW 0% 0% [kworker/u2:2] 32763 32510 root R 1364 5% 0% top 1200 1 root S 1360 5% 0% /usr/sbin/ntpd -n -p 0.openwrt.pool.n 32476 867 root S 1220 4% 0% /usr/sbin/dropbear -F -P /var/run/dro 923 1 root S 816 3% 0% /usr/bin/mini_snmpd -c public -d /jff ... ^C Llorenç Cerdà-Alabern Linux Routers and Community Networks 23 / 191

slide-24
SLIDE 24

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Basic editing with vi

  • Two modes of operation:
  • insert mode: enter text.
  • command mode: issue editing commands.
  • To switch into insert mode:

i insert before cursor. I insert beginning of line. a append after cursor. A append at end of line.

  • To switch into command mode, press ESC.
  • Saving and exiting:

:q

quit.

:q! quit discarding changes. :w

save file. After each change, it is recommended to save (there is no

undo). To abort changes and quit :q!. :w file write to file.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 24 / 191

slide-25
SLIDE 25

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Basic editing with vi

  • Deleting:

x

character.

dw word. dd line.

  • Copy paste:

yy yank (copy) line yw yank word v

starting point for yank (y) or delete (d).

p paste word after cursor, or line below. P paste word before cursor, or line above.

  • Moving:

beginning of line.

$

end of line.

gg beginning of file. G

end of file.

:n go to line n.

  • Repeat command, e.g. remove 3 characters: 3x.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 25 / 191

slide-26
SLIDE 26

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

ssh session to configure the router OpenWrt Dropbear ssh server

ssh and scp

  • Configuration files:

~# ls ~/.ssh authorized_keys config id_rsa id_rsa.pub known_hosts

  • Generates key pair (id_rsa, id_rsa.pub):

~# ssh-keygen -t rsa

  • Connect to IP 192.168.1.1, user root:

~# ssh 192.168.1.1 -l root

  • ssh key pair can be used to connect without password appending

id_rsa.pub to remote file .ssh/authorized_keys:

~# cat id_rsa.pub | ssh root@192.168.1.1 ’cat - >> .ssh/authorized_keys’

  • Recursively copy to remote host:

~# scp -r config root@192.168.1.1:/tmp Llorenç Cerdà-Alabern Linux Routers and Community Networks 26 / 191

slide-27
SLIDE 27

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Linux basic networking configuration

  • List all interfaces:

~# ifconfig -a

  • Assign IP address:

~# ifconfig eth0 102.168.1.2 netmask 255.255.255.240

  • List routing table:

~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.2.1 0.0.0.0 UG 0 wlan0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 br-lan

  • Add a default route:

~# route add default gw 192.168.2.1

  • Add/delete a static route:

~# route add -net 10.0.0.0 netmask 255.255.255.0 gw 192.168.2.1 ~# route del -net 10.0.0.0 netmask 255.255.255.0 gw 192.168.2.1 Llorenç Cerdà-Alabern Linux Routers and Community Networks 27 / 191

slide-28
SLIDE 28

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

ip command

  • Replaces and add functionalities to ifconfig and route.

# list IPv6 addresses root@OpenWrt:~# ip -6 a l 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000 inet6 fe80::12fe:edff:feaf:635e/64 scope link valid_lft forever preferred_lft forever # assign an ip address root@OpenWrt:~# ip a a 192.168.50.5 dev eth1 # delete an ip address root@OpenWrt:~# ip a d 192.168.50.5 dev eth1 # list routing table root@OpenWrt:~# ip r l default via 147.83.34.2 dev eth1 default via 147.83.34.2 dev eth1 proto static metric 1024 147.83.34.0/24 dev eth1 proto kernel scope link src 147.83.34.125 192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.10 # add a routing table entry root@OpenWrt:~# ip r a 10.10.20.0/24 via 192.168.1.1 dev eth0 # delete a routing table entry root@OpenWrt:~# ip r d 10.10.20.0/24 via 192.168.1.1 dev eth0 # add default route root@OpenWrt:~# ip r a default via 192.168.1.1 Llorenç Cerdà-Alabern Linux Routers and Community Networks 28 / 191

slide-29
SLIDE 29

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

arp

  • List stations from the network with whom datagrams have

been exchanged:

# legacy arp command ~# arp IP address HW type Flags HW address Mask Device 192.168.1.234 0x1 0x2 00:24:e8:2c:74:e2 * br-lan 192.168.2.1 0x1 0x2 d4:ca:6d:a1:dc:e0 * wlan0 192.168.2.20 0x1 0x2 dc:9f:db:28:81:cd * wlan0 # using ip ~# ip neigh l 192.168.1.234 dev br-lan lladdr 00:24:e8:2c:74:e2 STALE 192.168.2.1 dev wlan0 lladdr d4:ca:6d:a1:dc:e0 STALE 192.168.2.20 dev wlan0 lladdr dc:9f:db:28:81:cd STALE Llorenç Cerdà-Alabern Linux Routers and Community Networks 29 / 191

slide-30
SLIDE 30

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Check for connectivity: ping, traceroute, mtr

  • List stations from the network with whom datagrams have

been exchanged:

~# ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8): 56 data bytes 64 bytes from 8.8.8.8: seq=0 ttl=45 time=54.281 ms 64 bytes from 8.8.8.8: seq=1 ttl=45 time=58.195 ms ^C

  • -- 8.8.8.8 ping statistics ---

2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max = 54.281/56.238/58.195 ms ~# traceroute -n 8.8.8.8 traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 38 byte packets 1 10.228.205.1 5.807 ms 2.924 ms 2.875 ms 2 * * * 3 10.253.4.22 5.145 ms 6.577 ms 6.800 ms 4 62.115.43.113 8.434 ms 7.654 ms 4.084 ms 5 80.91.254.120 22.554 ms 80.91.253.97 22.552 ms 80.91.247.14 48.658 ms 6 62.115.143.210 34.897 ms 62.115.139.59 48.477 ms 80.91.246.182 46.697 ms 7 62.115.134.65 67.621 ms 80.91.249.89 55.958 ms 213.155.134.114 54.432 ms 8 80.91.253.54 48.835 ms 213.155.135.87 49.264 ms 213.155.135.83 47.000 ms 9 213.248.85.118 45.592 ms 45.500 ms 50.965 ms 10 72.14.233.127 48.323 ms 54.649 ms 44.920 ms 11 8.8.8.8 45.559 ms 44.919 ms 45.512 ms Llorenç Cerdà-Alabern Linux Routers and Community Networks 30 / 191

slide-31
SLIDE 31

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Domain Name System, DNS

  • File /etc/hosts:

~# cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 tramuntana.local tramuntana 192.168.1.1 tp-link

  • File resolv.conf:

~# cat /etc/resolv.conf search lan nameserver 192.168.1.1

  • File resolv.conf.auto:

~# cat /tmp/resolv.conf.auto # Interface wwan nameserver 212.68.193.110 nameserver 212.68.193.196

  • Asking the resolver with nslookup:

~# nslookup > set type=MX > cisco.com ... Llorenç Cerdà-Alabern Linux Routers and Community Networks 31 / 191

slide-32
SLIDE 32

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

WiFi Review

  • Use the Industrial Scientific and Medical (ISM) band: 2.4 GHz

and 5 GHz.

  • Basic Service Set (BSS): Set of stations communicating with

each other. If the network is composed of more than 1 BSS it is called Extended Service Set (ESS).

  • BSS are identified by: (i) a Service Set identifier (SSID), or

Network name: String with <32 characters; and (ii) a BSS Identifier (BSSID): 48 bits number.

Infrastructure BSS (infrastructure mode). Independent BSS, IBSS (ad-hoc mode).

Llorenç Cerdà-Alabern Linux Routers and Community Networks 32 / 191

slide-33
SLIDE 33

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

WiFi Commands

  • Connected stations: iwinfo:

~# iwinfo wlan0 ESSID: "gubia" Access Point: 0C:82:68:CD:A1:06 Mode: Client Channel: 11 (2.462 GHz) Tx-Power: 20 dBm Link Quality: 36/70 Signal: -74 dBm Noise: unknown Bit Rate: 48.0 MBit/s ...

  • Configuration and scanning: iw:

~# iw wlan0 scan BSS 0c:82:68:cd:a1:06(on wlan0) -- associated TSF: 60669050681 usec (0d, 16:51:09) freq: 2462 beacon interval: 100 TUs capability: ESS Privacy ShortPreamble ShortSlotTime (0x0431) signal: -72.00 dBm last seen: 420 ms ago Information elements from Probe Response frame: SSID: gubia ... Llorenç Cerdà-Alabern Linux Routers and Community Networks 33 / 191

slide-34
SLIDE 34

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Troubleshooting

  • tcpdump of a TCP segment:

src IP address src port dst IP address dst port seq number flags TCP seq number next segment payload length (bytes) advertized window MSS SACK timestamp window scale TCP options timestamp 16:43:02.126531 147.83.34.125.2628 > 147.83.30.137.80: S 903489440:903489440(0) win 5840 <mss 1460,sackOK,timestamp 2533519233 0,nop,wscale 2>

  • Checking activity in eth0:

~# tcpdump -ni eth0 tcpdump: WARNING: eth0: no IPv4 address assigned tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes 14:06:21.986572 IP 192.168.1.232.22 > 192.168.1.234.57951: Flags [P.], seq 3522875745:3522875797, ^C

  • Capturing dhcp packets in verbose mode:

~# tcpdump -vni br-lan port 67 tcpdump: listening on br-lan, link-type EN10MB (Ethernet), capture size 65535 bytes 14:24:56.571518 IP (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 328) 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 10:fe:ed:af:63:5e, length 300, xid ... Llorenç Cerdà-Alabern Linux Routers and Community Networks 34 / 191

slide-35
SLIDE 35

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Troubleshooting

  • System logs. In OpenWrt:

~# logread Tue Jun 9 13:25:41 2015 daemon.notice netifd: Interface ’wwan’ is enabled Tue Jun 9 13:25:41 2015 kern.info kernel: [ 1003.250000] wlan0: authenticate with 0c:82:68:cd:a1:06 ...

  • netperf. Throughput of a link using the IPv6 link local with a

1 s test:

~# netperf -l 1 -H fe80::12fe:edff:feaf:635e%eth0 MIGRATED TCP STREAM TEST from ::0 (::) port 0 AF_INET6 to fe80::12fe:edff:feaf:635e%eth0 () port Recv Send Send Socket Socket Message Elapsed Size Size Size Time Throughput bytes bytes bytes secs. 10^6bits/sec 87380 16384 16384 1.05 92.75 Llorenç Cerdà-Alabern Linux Routers and Community Networks 35 / 191

slide-36
SLIDE 36

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Unix basic commands

Gnu screen

  • Allows multiplexing a physical terminal in different windows.

Gnu screen initialization file:

~# echo ’caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %LD %d %%LM - %c"’ > .screenrc

  • The screen basic commands are the following (C-a c means

type Control and a simultaneously, release and type c): C-a c create new window. C-d

close window.

C-a 0 change to window number 0 (likewise for windows 0-9). C-a p change to previous window. C-a n change to next window. C-a k kill current window. C-a A rename current window.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 36 / 191

slide-37
SLIDE 37

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 37 / 191

slide-38
SLIDE 38

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Lab set up

Objectives:

  • We want to set up

this network.

  • Using static

routing.

  • Following the

guidelines in the next slides.

10.1.3.0/24 10.1.2.0/24 10.1.1.0/24 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 10.2.1.0/24 10.2.2.0/24 10.2.3.0/24 10.3.1.0/24 10.3.2.0/24 10.3.3.0/24 10.4.3.0/24 10.4.2.0/24 10.4.1.0/24 10.5.3.0/24 10.5.2.0/24 10.5.1.0/24 10.6.3.0/24 10.6.2.0/24 10.6.1.0/24 10.7.3.0/24 10.7.2.0/24 10.7.1.0/24 10.8.3.0/24 10.8.2.0/24 10.8.1.0/24 10.9.3.0/24 10.9.2.0/24 10.9.1.0/24 10.10.3.0/24 10.10.2.0/24 10.10.1.0/24 192.168.1.0/24 192.168.5.0/24 192.168.4.0/24 192.168.3.0/24 192.168.2.0/24 .1 .2 .3 .3 .4 .4 .5 .5 192.168.6.0/24 192.168.7.0/24 .1 200.0.0.0/24 .1 .1 .2 AP ST AP ST AP ST AP ST .1 .2 .1 .2 .1 .2 .1 .2 ST AP AP AP ST ST ST ST ST ST ST ST PC3 PC2 PC1 G1 PC3 PC2 PC1 PC3 PC3 PC3 PC2 PC2 PC2 PC1 PC1 PC1 PC3 PC2 PC1 PC3 PC2 PC1 G2 PC3 PC2 PC1 G3 PC3 PC2 PC1 G4 PC3 PC2 PC1 G5 G6 G8 G9 G10 G7 CH1 CH6 CH132 CH100 CH108 CH116 CH124 R1 R2 R10 R9 R3 R8 R4 R7 R5 R6 .2 Internet

Llorenç Cerdà-Alabern Linux Routers and Community Networks 38 / 191

slide-39
SLIDE 39

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 39 / 191

slide-40
SLIDE 40

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Building a patch cord

1 3 4 8 7 6 5 2

Building a straight-through patch cord

Pin Pair Cable Color 1 2 1 white/orange 2 2

  • range

3 3 1 white/green 4 1 2 blue 5 1 white/blue 6 3 2 green 7 4 1 white/brown 8 2 brown Table: RJ45 EIA/TIA-568B pinout.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 40 / 191

slide-41
SLIDE 41

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 41 / 191

slide-42
SLIDE 42

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Flashing OpenWrt

eth0 TL−WDR4300 router 192.168.0.2/24 192.168.0.1/24

Flashing OpenWrt into TL-WDR4300

1 Download the OpenWrt image:

https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/

  • penwrt-ar71xx-generic-tl-wdr4300-v1-squashfs-factory.bin

2 Assign the IP address to the PC. 3 Log into the WDR4300 at 192.168.0.1 using admin:admin 4 System Tools -> Firmware Upgrade. 5 Browse -> select the firmware. 6 Upgrade -> OK. 7 You will then see the firmware upgrade in progress. 8 After a couple of minutes this should switch to Software Upgraded

Successfully! and restart.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 42 / 191

slide-43
SLIDE 43

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 43 / 191

slide-44
SLIDE 44

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Accessing OpenWrt

ssh session to configure the router OpenWrt Dropbear ssh server

Finding the local link local IPv6

1 Check the IPv6 link local of the local interface eth0:

~# ip -6 a l dev eth0 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000 inet6 fe80::250:daff:fec9:6ec7/64 scope link valid_lft forever preferred_lft forever

2 If no IPv6 link local is assigned, check that the kernel variable

net.ipv6.conf.eth0.disable_ipv6 is set to 0:

~# sysctl -a | grep net.ipv6.conf.eth0.disable_ipv6 net.ipv6.conf.eth0.disable_ipv6 = 1 ~# sysctl -w net.ipv6.conf.eth0.disable_ipv6=0 Llorenç Cerdà-Alabern Linux Routers and Community Networks 44 / 191

slide-45
SLIDE 45

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Accessing OpenWrt

Finding the OpenWrt router link local IPv6

1 ping to IPv6 multicast all hosts.

~# ping6 -c 2 ff02::1%eth0 PING ff02::1%eth0(ff02::1) 56 data bytes 64 bytes from fe80::250:daff:fec9:6ec7: icmp_seq=1 ttl=64 time=0.027 ms 64 bytes from fe80::12fe:edff:feaf:635e: icmp_seq=1 ttl=64 time=0.279 ms (DUP!) 64 bytes from fe80::250:daff:fec9:6ec7: icmp_seq=2 ttl=64 time=0.029 ms

  • -- ff02::1%eth0 ping statistics ---

2 packets transmitted, 2 received, +1 duplicates, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.027/0.111/0.279/0.118 ms

2 You can try to ping to IPv6 multicast all routers.

~# ping6 ff02::02%eth0 PING ff02::02%eth0(ff02::2) 56 data bytes 64 bytes from fe80::12fe:edff:feaf:635e: icmp_seq=1 ttl=64 time=0.627 ms 64 bytes from fe80::12fe:edff:feaf:635e: icmp_seq=2 ttl=64 time=0.333 ms ^C

  • -- ff02::02%eth0 ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.333/0.480/0.627/0.147 ms Llorenç Cerdà-Alabern Linux Routers and Community Networks 45 / 191

slide-46
SLIDE 46

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Accessing OpenWrt

Assign a password to the OpenWrt router

1 Assign a password to the OpenWrt router using telnet:

~# telnet fe80::12fe:edff:feaf:635e%eth0 root@OpenWrt:/# passwd Changing password for root New password: 13f Bad password: too short Retype password: 13f Password for root changed by root root@OpenWrt:/# ^D root@OpenWrt:/# Connection closed by foreign host. Llorenç Cerdà-Alabern Linux Routers and Community Networks 46 / 191

slide-47
SLIDE 47

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Accessing OpenWrt

Accessing the OpenWrt router with the command line interface (CLI) and web interface (WI)

1 We need to forward ports with ssh to access with the WI.

~# ssh -L 8080:[::1]:80 fe80::12fe:edff:feaf:635e%eth0 -l root The authenticity of host ’fe80::12fe:edff:feaf:635e%eth0 (fe80::12fe:edff:feaf:635e%eth0)’ can’t RSA key fingerprint is b1:b5:d3:f0:1b:03:5c:dc:ff:bd:2a:c5:14:45:c3:76. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added ’fe80::12fe:edff:feaf:635e%eth0’ (RSA) to the list of known hosts. root@fe80::12fe:edff:feaf:635e%eth0’s password: 13f

2 Use the URL http://localhost:8080 to access the WI with the

browser.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 47 / 191

slide-48
SLIDE 48

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Accessing OpenWrt

Disable the firewall using the WI

System -> Startup -> firewall -> Enable & Stop

Configure the router name

System -> Hostname -> Save & Apply

Llorenç Cerdà-Alabern Linux Routers and Community Networks 48 / 191

slide-49
SLIDE 49

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 49 / 191

slide-50
SLIDE 50

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Installing packages

1 Connect the Internet Ethernet port of the router to the Internal

  • network. The router should be configured by DHCP and have

access to the Internet.

2 Install the packages: tcpdump, ip, netperf and screen.

System -> Software -> Update list -> Find

3 Activate the netperf server: System -> Startup...

Llorenç Cerdà-Alabern Linux Routers and Community Networks 50 / 191

slide-51
SLIDE 51

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 51 / 191

slide-52
SLIDE 52

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

OpenWrt Net. Interfaces

Linux kernel distinguishes two type of interfaces

1 Physical Network Interfaces: As soon as the device driver is

loaded into the Kernel a corresponding physical network interface becomes present, e.g. eth0, wlan0, etc.

2 Virtual Network Interfaces: Introduced for the sake of flexibility.

Associated with a physical network interface, another virtual interface, or be stand alone such as the loopback interface lo.

  • The Unified Configuration Interface, UCI, is a small C utility

designed to centralize configuration in OpenWrt.

  • /etc/config/network is the network configuration file.
  • /etc/config/wireless is the wireless configuration file.
  • UCI creates an abstraction layer for configuring network interfaces:

In /etc/config/network you allocate a name like lan or wan. Then this name is consistently used through the entire UCI configuration.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 52 / 191

slide-53
SLIDE 53

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 53 / 191

slide-54
SLIDE 54

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Configure VLANs

What are VLANs?

  • Each port belongs to a VLAN.
  • The switch isolates different VLANs: Each VLAN is equivalent

to a different physical switch. A router is needed to send traffic to a different VLAN.

  • The port configured as trunk belongs to several VLANs.
  • The traffic sent in one VLAN is also sent to the trunk the VLAN

belongs to. A tagging mechanism is used in the trunk to discriminate the traffic from different VLANs.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 54 / 191

slide-55
SLIDE 55

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Configure VLANs

Default TP-Link TL-WDR4300 VLAN configuration

not used eth0.1 eth0.2

Llorenç Cerdà-Alabern Linux Routers and Community Networks 55 / 191

slide-56
SLIDE 56

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Configure VLANs

1 Using the WI, configure Ethernet ports 1, 2, 3, 4 of the router in

VLANs 1, 2, 3, 4, and the Internet port in VLAN 5. Note that

  • riginally the Internet port of the router is configured in VLAN 2.

Network -> Switch -> Add -> ··· -> Save & Apply

Llorenç Cerdà-Alabern Linux Routers and Community Networks 56 / 191

slide-57
SLIDE 57

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Configure VLANs

Create Interfaces for the VLANS

1 Using the WI, create the virtual interfaces LAN1, LAN2, LAN3,

LAN3 associated with physical interfaces eth0.1, eth0.2, eth0.3, eth0.4. Configure them with unmanaged protocol. Associate the wan interface with eth0.5. In the end, delete the LAN interface, reboot and connect again. The new interfaces should show up configured only with IPv6 link local addresses:

root@OpenWrt:~# reboot; exit ~# ssh -L 8080:[fe80::12fe:edff:feaf:635e%eth0]:80 fe80::12fe:edff:feaf:635e%eth0 -l root root@OpenWrt:~# ip a l ... 5: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 10:fe:ed:af:63:5e brd ff:ff:ff:ff:ff:ff inet6 fe80::12fe:edff:feaf:635e/64 scope link valid_lft forever preferred_lft forever 6: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 10:fe:ed:af:63:5e brd ff:ff:ff:ff:ff:ff inet6 fe80::12fe:edff:feaf:635e/64 scope link valid_lft forever preferred_lft forever 7: eth0.3@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 10:fe:ed:af:63:5e brd ff:ff:ff:ff:ff:ff inet6 fe80::12fe:edff:feaf:635e/64 scope link valid_lft forever preferred_lft forever 8: eth0.4@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default link/ether 10:fe:ed:af:63:5e brd ff:ff:ff:ff:ff:ff inet6 fe80::12fe:edff:feaf:635e/64 scope link valid_lft forever preferred_lft forever Llorenç Cerdà-Alabern Linux Routers and Community Networks 57 / 191

slide-58
SLIDE 58

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 58 / 191

slide-59
SLIDE 59

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Configure WiFi

Configuring a WiFi AP

  • 1. Network -> wifi -> Edit
  • 2. Advanced Settings
  • 3. Save & Apply, Enable

See appendix A for channels.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 59 / 191

slide-60
SLIDE 60

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Configure WiFi

Configuring a wifi station

  • 1. Network -> wifi
  • 2. scan
  • 3. Join Network
  • 4. submit.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 60 / 191

slide-61
SLIDE 61

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Summer Course at Mekelle Institute of Technology.

Linux Routers and Community Networks

Part II Lab 1: Basic Network Configuration

Outline Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Llorenç Cerdà-Alabern Linux Routers and Community Networks 61 / 191

slide-62
SLIDE 62

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Static Routing

Configuration of IP addresses and routing tables

1 Use the CLI to configure the IP addresses and router table

  • entries. Try with traditional commands (ifconfig, route), and

ip command.

2 Configure the PCs manually (with ip command), setting the

router where they are connected as default gateway.

3 Each router must end up with the 37 networks and a default

route towards the laptop that represents the Internet. All hosts must be reachable.

4 Convection for the gateways: a router in the same column to

reach networks in the same side, a router in the same row to reach networks in the opposite side. For instance, R1 chooses R5 to reach 10.5.1.0/24, and R10 to reach 10.6.1.0/24.

Llorenç Cerdà-Alabern Linux Routers and Community Networks 62 / 191

slide-63
SLIDE 63

Lab 1: Basic Network Configuration Description Unix basic commands Lab set up Building a patch cord Flashing OpenWrt Accessing OpenWrt Installing packages OpenWrt Net. Interfaces Configure VLANs Configure WiFi Static Routing

Lab 1: Basic Network Configuration

Static Routing

Objectives:

  • We want to set up

this network.

  • Using static

routing.

10.1.3.0/24 10.1.2.0/24 10.1.1.0/24 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 .1 .1 .1 .2 .2 .2 10.2.1.0/24 10.2.2.0/24 10.2.3.0/24 10.3.1.0/24 10.3.2.0/24 10.3.3.0/24 10.4.3.0/24 10.4.2.0/24 10.4.1.0/24 10.5.3.0/24 10.5.2.0/24 10.5.1.0/24 10.6.3.0/24 10.6.2.0/24 10.6.1.0/24 10.7.3.0/24 10.7.2.0/24 10.7.1.0/24 10.8.3.0/24 10.8.2.0/24 10.8.1.0/24 10.9.3.0/24 10.9.2.0/24 10.9.1.0/24 10.10.3.0/24 10.10.2.0/24 10.10.1.0/24 192.168.1.0/24 192.168.5.0/24 192.168.4.0/24 192.168.3.0/24 192.168.2.0/24 .1 .2 .3 .3 .4 .4 .5 .5 192.168.6.0/24 192.168.7.0/24 .1 200.0.0.0/24 .1 .1 .2 AP ST AP ST AP ST AP ST .1 .2 .1 .2 .1 .2 .1 .2 ST AP AP AP ST ST ST ST ST ST ST ST PC3 PC2 PC1 G1 PC3 PC2 PC1 PC3 PC3 PC3 PC2 PC2 PC2 PC1 PC1 PC1 PC3 PC2 PC1 PC3 PC2 PC1 G2 PC3 PC2 PC1 G3 PC3 PC2 PC1 G4 PC3 PC2 PC1 G5 G6 G8 G9 G10 G7 CH1 CH6 CH132 CH100 CH108 CH116 CH124 R1 R2 R10 R9 R3 R8 R4 R7 R5 R6 .2 Internet

Llorenç Cerdà-Alabern Linux Routers and Community Networks 63 / 191