20200107_jeffrey - silenceuncrio/diary GitHub Wiki

0900

review


base on gre_keepalive_06.c 繼續前進

1000

gre_keepalive_07.c 已經能搭配 libpcap 抓取到 gre tunnel keepalive response

讓程式可以吃參數吧

把需要的參數列出來

  • device
  • tunnel device
  • local address
  • remote address
  • period
    • <0-32767> Keepalive period (default 10 seconds)
  • retries
    • <1-255> Keepalive retries (default 3 times)

1420

寫得差不多了

還差 keepalive retries 機制

還有去控制 tunnel device 的 up/down 狀態

1510

gre_keepalive_08.c 已經達到目前我想要的樣子

可以開始設計 icos 的模組了

1530

繼續前進之前先上 code 吧


m330[release/v0.08] - implement grek - GRE Tunnel Keepalive

commit 50ee4f03840e2b3c16eb2dcd1c1bfb178c5b1d9d
Refs: [release/v0.08], {origin/release/v0.08}
Author: jeffrey <[email protected]>
Date:   Tue Jan 7 15:32:54 2020 +0800

    implement grek - GRE Tunnel Keepalive
    - follow cisco spec

    root@(none):/tmp# ./grek -h
    Usage: ./grek [OPTIONS]

    GRE Tunnel Keepalive

        -d DEVICE   Device to issue keepalive
        -t TUNNLE   Tunnel name
        -l LOCAL    Local address of the tunnel
        -r REMOTE   Remote address of the tunnel
        -p Period   <0-32767> Keepalive period  (default 10 seconds)
        -n Retries  <1-255> Keepalive retries (default 3 times)

 proscend/prosrc/icos/greK/Makefile |  10 +-
 proscend/prosrc/icos/greK/main.c   | 557 +++++++++++++++++++++++++++++++++++++
 2 files changed, 562 insertions(+), 5 deletions(-)

找一台其他家的來對測一下

直接去隔壁搬一台 cisco 來做測試

1610

幫 jessy 加一下 web ui

build 一份 m330[release/v0.08] 最新的 code

  • Vendor/Products = GENERIC/1_GENERIC_WIFI

m330[release/v0.08] - add 'Country Code' field at 'WAN > WiFi STA' web page

commit c9cb5fd112c14be2acef7470bc6dd131712bc1c6
Refs: [release/v0.08], {origin/release/v0.08}
Author: jeffrey <[email protected]>
Date:   Tue Jan 7 16:23:54 2020 +0800

    add 'Country Code' field at 'WAN > WiFi STA' web page

 proscend/prosrc/webcgi/wifi_sta.c             | 3 +++
 proscend/prosrc/www/app/feature/wifi_sta.html | 8 ++++++++
 proscend/prosrc/www/app/feature/wifi_sta.js   | 9 ++++++++-
 3 files changed, 19 insertions(+), 1 deletion(-)

1650

從 shin 那邊借了一台 cisco 2800

網路線插上標示著 FE 0/0 的接頭

Router>show interface
FastEthernet0/0 is up, line protocol is up
  Hardware is MV96340 Ethernet, address is 0013.1aa4.64a8 (bia 0013.1aa4.64a8)
  Internet address is 192.168.2.28/24
  ...
FastEthernet0/1 is up, line protocol is down
...

利用 show interface 會發現 FastEthernet0/0 is up, line protocol is up

先把該 interface 的 ip 改成適合我環境需要的

t errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 192.168.1.200 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router#show interfaces FastEthernet0/0
FastEthernet0/0 is up, line protocol is up
  Hardware is MV96340 Ethernet, address is 0013.1aa4.64a8 (bia 0013.1aa4.64a8)
  Internet address is 192.168.1.200/24
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 100Mb/s, 100BaseTX/FX
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:02:40, output 00:00:06, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     2 packets input, 120 bytes
     Received 2 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog
     0 input packets with dribble condition detected
     147 packets output, 11733 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 unknown protocol drops
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
Router#

試著從 m330 - 192.168.1.11 來 ping cisco 2800 - 192.168.1.200

root@(none):~# ping 192.168.1.200
PING 192.168.1.200 (192.168.1.200): 56 data bytes
64 bytes from 192.168.1.200: seq=0 ttl=255 time=0.882 ms
64 bytes from 192.168.1.200: seq=1 ttl=255 time=0.904 ms
64 bytes from 192.168.1.200: seq=2 ttl=255 time=0.999 ms
64 bytes from 192.168.1.200: seq=3 ttl=255 time=1.022 ms

--- 192.168.1.200 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.882/0.951/1.022 ms
root@(none):~#

可以來建 gre tunnel 了

1755

連最基本的 gre tunnel 都建不起來...

明天繼續

⚠️ **GitHub.com Fallback** ⚠️