20200108_jeffrey - silenceuncrio/diary GitHub Wiki
昨天跟 cisco gre 對測失敗
今天沉住氣再好好測一次
測試的架設如下
+-------+ +-------+
| | lan | |
| m330 +-------------------+---------------------------+ m330 |
| | 192.168.1.11 | 192.168.1.13 | |
+-------+ | +-------+
|
+---+-------+ +---------------+
| | 192.168.1.113 | |
| switch +-------------------+ CISCO 2811 |
| | fastEthernet 0/0 | |
+-----------+ +---------------+
先設定 CISCO 2811 的 fastEthernet 0/0 interface
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 192.168.1.200 255.255.255.0
Router(config-if)#exit
Router(config)#exit
Router#show interfaces fastEthernet 0/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
...
再利用 ping 來確認 m330 - 192.168.1.11 與 CISCO - 192.168.1.200 之間的 connection
m330 - 192.168.1.11
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=2.973 ms
64 bytes from 192.168.1.200: seq=1 ttl=255 time=0.856 ms
64 bytes from 192.168.1.200: seq=2 ttl=255 time=2.130 ms
64 bytes from 192.168.1.200: seq=3 ttl=255 time=0.961 ms
--- 192.168.1.200 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.856/1.730/2.973 ms
CISCO - 192.168.1.200
Router#ping 192.168.1.11
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.11, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
確認無誤
再來是 gre 的設定 - 先不管 keepalive
m330 - 192.168.1.11
root@(none):~# ip tunnel add gre1 mode gre remote 192.168.1.200 local 192.168.1.11 ttl 255
root@(none):~# ifconfig gre1 mtu 1400
root@(none):~# ifconfig gre1 mtu 1400
root@(none):~# ip link set gre1 up
root@(none):~# ip addr add 10.0.0.11/24 dev gre1
root@(none):~# echo 1 > /proc/sys/net/ipv4/conf/gre1/accept_local
root@(none):~# ifconfig gre1
gre1 Link encap:UNSPEC HWaddr C0-A8-01-0B-7F-46-00-00-00-00-00-00-00-00-00-00
inet addr:10.0.0.11 P-t-P:10.0.0.11 Mask:255.255.255.0
inet6 addr: fe80::5efe:c0a8:10b/64 Scope:Link
UP POINTOPOINT RUNNING NOARP MTU:1400 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
CISCO - 192.168.1.200
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#no interface tunnel 0
Router(config)#interface tunnel 0
Router(config-if)#ip address 10.0.0.200 255.255.255.0
Router(config-if)#tunnel source fastEthernet 0/0
Router(config-if)#tunnel destination 192.168.1.11
Router(config-if)#exit
Router(config)#exit
Router#show interfaces tunnel 0
Tunnel0 is up, line protocol is up
Hardware is Tunnel
Internet address is 10.0.0.200/24
MTU 1514 bytes, BW 9 Kbit, DLY 500000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation TUNNEL, loopback not set
Keepalive not set
Tunnel source 192.168.1.200 (FastEthernet0/0), destination 192.168.1.11
Tunnel protocol/transport GRE/IP
Key disabled, sequencing disabled
Checksumming of packets disabled
Tunnel TTL 255
Fast tunneling enabled
Tunnel transmit bandwidth 8000 (kbps)
Tunnel receive bandwidth 8000 (kbps)
Last input never, output never, 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/0 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
試著透過 gre tunnel 利用 ping 互相確認對方的 tunnel ip
昨天光這一步就失敗了
m330 - 192.168.1.11
root@(none):~# ping 10.0.0.200
PING 10.0.0.200 (10.0.0.200): 56 data bytes
64 bytes from 10.0.0.200: seq=0 ttl=255 time=2.778 ms
64 bytes from 10.0.0.200: seq=1 ttl=255 time=1.146 ms
64 bytes from 10.0.0.200: seq=2 ttl=255 time=1.192 ms
64 bytes from 10.0.0.200: seq=3 ttl=255 time=1.198 ms
--- 10.0.0.200 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 1.146/1.578/2.778 ms
CISCO - 192.168.1.200
Router#ping 10.0.0.11
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.11, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
成功 - 確認無誤
再來先開啟 CISCO - 192.168.1.200 的 keepalive 並使用 debug 確認有無收到 keepalive response
Router#enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface tunnel 0
Router(config-if)#keepalive ?
<0-32767> Keepalive period (default 10 seconds)
<cr>
Router(config-if)#keepalive 5
Router(config-if)#exit
Router(config)#exit
Router#debug tunnel keepalive
Tunnel keepalive debugging is on
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#logging console
Router(config)#
*Nov 25 17:58:59.903: Tunnel0: sending keepalive, 192.168.1.11->192.168.1.200 (len=24 ttl=255), counter=1
*Nov 25 17:58:59.903: Tunnel0: keepalive received, 192.168.1.11->192.168.1.200 (len=24 ttl=253), resetting counter
*Nov 25 17:59:04.903: Tunnel0: sending keepalive, 192.168.1.11->192.168.1.200 (len=24 ttl=255), counter=1
*Nov 25 17:59:04.903: Tunnel0: keepalive received, 192.168.1.11->192.168.1.200 (len=24 ttl=253), resetting counter
*Nov 25 17:59:09.903: Tunnel0: sending keepalive, 192.168.1.11->192.168.1.200 (len=24 ttl=255), counter=1
*Nov 25 17:59:09.903: Tunnel0: keepalive received, 192.168.1.11->192.168.1.200 (len=24 ttl=253), resetting counter
*Nov 25 17:59:14.903: Tunnel0: sending keepalive, 192.168.1.11->192.168.1.200 (len=24 ttl=255), counter=1
*Nov 25 17:59:14.903: Tunnel0: keepalive received, 192.168.1.11->192.168.1.200 (len=24 ttl=253), resetting counter
*Nov 25 17:59:19.903: Tunnel0: sending keepalive, 192.168.1.11->192.168.1.200 (len=24 ttl=255), counter=1
*Nov 25 17:59:19.903: Tunnel0: keepalive received, 192.168.1.11->192.168.1.200 (len=24 ttl=253), resetting counter
...
再來就是見證奇蹟的時刻了 - 我自己 implement 的 grek
root@(none):~# cd /tmp/
root@(none):/tmp# tftp -g -r grek 192.168.1.113
root@(none):/tmp# chmod 755 grek
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)
上吧
root@(none):/tmp# grek -d lan -t gre1 -l 192.168.1.11 -r 192.168.1.200 -p 5
DEVICE: "lan"
TUNNEL: "gre1"
Local address: "192.168.1.11"
Remote address: "192.168.1.200"
Keepalive period: 5 seconds
Use the default keepalive retries: 3 times
a raw socket with GRE protocol is created.
checksum: 0xf683
Timer ID: 7434248 ()
filter expression: src host 192.168.1.200 && ip proto gre && ip[22:2] = 0
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 0)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 0)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 0)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 0)
...
成功了
把 CISCO - 192.168.1.200 的網路線拔掉
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 0)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 1)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 2)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 3)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 4)
system cmd: ifconfig gre1 down
(Tunnel_interface_up, Tunnel_keepalive_counter) = (0, 5)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (0, 6)
...
m330 - 192.168.1.11 行為正常
再把 CISCO - 192.168.1.200 的網路線接回去
...
(Tunnel_interface_up, Tunnel_keepalive_counter) = (0, 22)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (0, 23)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (0, 0)
system cmd: ifconfig gre1 up
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 0)
(Tunnel_interface_up, Tunnel_keepalive_counter) = (1, 0)
...
非常好
可以來改 icos 了
目前 gre keepalive 可以延到下個禮拜 - 因為其他的同仁的某功能這禮拜做不完
我先解一下 web ui 的 issue
- 0000859: when WAN priority is WiFi only, it should show "WiFi mode", not "LTE Net mode"
m330[release/v0.08] - suitable label for different priority at 'WAN > Priority' web page
commit 7044202064178ed4471914ddb97a7399b781ff2c
Refs: [release/v0.08], {origin/release/v0.08}
Author: jeffrey <[email protected]>
Date: Wed Jan 8 10:50:28 2020 +0800
suitable label for different priority at 'WAN > Priority' web page
proscend/prosrc/www/app/locale-en.json | 2 ++
proscend/prosrc/www/app/locale-fr.json | 2 ++
proscend/prosrc/www/app/locale-zh-tw.json | 2 ++
proscend/prosrc/www/src/app/feature/wanPriority.html.src | 7 ++++---
4 files changed, 10 insertions(+), 3 deletions(-)
後續 gre icos module 的修改先不要上 code
切換到 M300 做事
M300
- P1 - Can you give us a check box where we can turn OFF the startup wizard
build 個最新的 M300[release/v2.02]
- Products/Vendor = M300/0_GENERIC
M300[release/v2.02] - offer a checkbox to control whether auto show the setting wizard at 'Management > Administration' page
commit 5f26f3cd3ed35a4ecb39f7299e15b1194a4e8820
Refs: [release/v2.02], {origin/release/v2.02}
Author: jeffrey <[email protected]>
Date: Wed Jan 8 14:57:51 2020 +0800
offer a checkbox to control whether auto show the setting wizard at 'Management > Administration' page
- default is auto show the setting wizard after login if the wizard has not been finished
proscend/prosrc/webcgi/wizard.c | 48 ++++++++++++++++++++--
proscend/prosrc/www/app/feature/administration.js | 21 +++++++++-
proscend/prosrc/www/app/feature/login.js | 6 +--
proscend/prosrc/www/app/locale-en.json | 2 +
proscend/prosrc/www/app/locale-fr.json | 2 +
proscend/prosrc/www/app/locale-zh-tw.json | 2 +
proscend/prosrc/www/app/services/icos.service.js | 6 +++
.../www/src/app/feature/administration.html.src | 9 ++++
8 files changed, 87 insertions(+), 9 deletions(-)
等待明天 m330 release 之後再繼續 icos gre module 吧
休息一下 發個懶
關心一下 m330 的 issue
- 0000880: [upgrade] upgrade firmware to 95% and hang up
目前 try 了快十次都沒能複製出來