八月初

天气

今天早上出了大太阳,下午午睡的时候便下起了大雨

不过和往常一样,雨没有下很久,一会儿便停了,又出了太阳,下面引用朋友圈几位的图:

下面这个更稀奇一点,双彩:

我的的确确不是美术生,不过看到彩虹我内心亦然是快乐的,是稀奇的

改造

因为前几天家庭网络的IPv6突然断了,有一些业务访问出现了问题。在和客服交涉的过程中发现家里的宽带是千兆的?(我之前一直以为是百兆

后来下定决心要进行改造

先是联系师傅改了桥接,运营商送的光猫只用来做光信号转换(类似于光模块),之后用我自己手上的一个“软路由”机器进行拨号,这样有以下几个好处:

  • 减小了光猫的负担,我怀疑之前IPv6掉线是光猫的原因
  • 能对家庭网络进行更个性化的处理,比如说内建DNS缓存服务器(可以去看看我前面写的博客
  • 尽可能地压榨带宽,X86软路由的性能远好于光猫,尽可能的避免由于光猫性能而出现的瓶颈

在这里我介绍一下软路由的配置:

软路由

首先是来自联想M910X的准系统,很小

然后是CPU:

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               GenuineIntel
  BIOS Vendor ID:        Intel(R) Corporation
  Model name:            Intel(R) Pentium(R) CPU G4560 @ 3.50GHz
    BIOS Model name:     Intel(R) Pentium(R) CPU G4560 @ 3.50GHz
    CPU family:          6
    Model:               158
    Thread(s) per core:  2
    Core(s) per socket:  2
    Socket(s):           1
    Stepping:            9
    CPU max MHz:         3500.0000
    CPU min MHz:         800.0000
    BogoMIPS:            6999.82
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon 
                         pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_
                         deadline_timer aes xsave rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust 
                         smep erms invpcid mpx rdseed smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
Virtualization features: 
  Virtualization:        VT-x
Caches (sum of all):   
  L1d:                   64 KiB (2 instances)
  L1i:                   64 KiB (2 instances)
  L2:                    512 KiB (2 instances)
  L3:                    3 MiB (1 instance)
Vulnerabilities:     
  Gather data sampling:  Not affected
  Itlb multihit:         KVM: Mitigation: VMX disabled
  L1tf:                  Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
  Mds:                   Mitigation; Clear CPU buffers; SMT vulnerable
  Meltdown:              Mitigation; PTI
  Mmio stale data:       Mitigation; Clear CPU buffers; SMT vulnerable
  Retbleed:              Mitigation; IBRS
  Spec rstack overflow:  Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl and seccomp
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; IBRS, IBPB conditional, STIBP conditional, RSB filling, PBRSB-eIBRS Not affected
  Srbds:                 Mitigation; Microcode
  Tsx async abort:       Not affected

当时图便宜(20块)买的,寒假的时候靠这颗CPU和朋友开MC服务器

内存是两条4G 2400笔记本内存条:

total        used        free      shared  buff/cache   available
Mem:        8077816      655244     5770764      309984     1651808     6997800
Swap:             0           0           0

Openwrt对内存的要求还是很低的,我基本上不跑什么Docker容器

接着是网卡:

00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-LM
01:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
01:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
01:00.2 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
01:00.3 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)

其中 I219-LM是主板上的内置网卡,在Openwrt上作为 WAN

选择 I350作为 PCI-E网卡其实也是权衡之举,因为M910X这个机器空间很小,这张卡也刚好是买机器的商家推荐的,兼容性也不错

路由器

路由器是来自TP-LINKTL-XDR3010易拓版,本身支持千兆和 WIFI-6,也有支持2.5G的版本,不过我家里没有NAS或能内网能跑满2.5G的应用,就没有加钱买

光猫

光猫是移动的 H2-3e,感觉这个机器在网上相关的介绍不是很多,在这里我也不多做赘述

网线

原网线是 CAT5e(超五类线),最高传输速度有 1000M,但是在我实际使用的时候几乎只能跑到 100M,不过考虑到衰减(光猫到路由器网线的距离有20多米,这条网线拉了有十多年)一狠下心还是准备换线

换线准备换六类线:

当时担心自己好久没打水晶头一下买了20个

改造成果

最终还是实现了内网跑满 1Gpbs的愿望,不过不知道为什么上下不对等

外网也跑到了将近 1000Mpbs,不过不知道是我设备的原因还是宽带本来就只有这么快,使用了多个教育站测速最高只有这么多,大多数时候只有大概 500Mpbs,已经准备联系客服了

总结

总的来说,折腾的快乐远远大于使用的乐趣,其实平时日常使用很少很少能跑满带宽

小树,小树!