V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  kursk  ›  全部回复第 2 页 / 共 3 页
回复总数  43
1  2  3  
2024-05-17 11:16:48 +08:00
回复了 Jinnrry 创建的主题 DNS 向资深软路由玩家提问,关于 lede 项目 DNS 的设置
另外说一下,server 和 ipset 这两个参数一般不在那个/var/etc/dnsmasq.conf.cfg01411c 配置文件中,但是你查看一下配置文件中的 conf-file 参数对应的目录下,应该有使用 server 和 ipset 的配置文件。

一般使用的是/tmp/dnsmasq.d/
2024-05-17 11:13:32 +08:00
回复了 Jinnrry 创建的主题 DNS 向资深软路由玩家提问,关于 lede 项目 DNS 的设置
简单来说,DNSMASQ 有两个参数 server 和 ipset 发挥的作用

server 的作用是将指定的域名交给指定的域名服务器解析,并将 ip 存入 ipset 中,iptables 再将目标地址为这个 ipset 的 package 转发到科学上网的端口或线路上

你研究一下这个参数的说明

-S, --local, --server=[/[<domain>]/[domain/]][<server>[#<port>]][@<interface>][@<source-ip>[#<port>]]
Specify upstream servers directly. Setting this flag does not suppress reading of /etc/resolv.conf, use --no-resolv to do that. If one or more optional domains are given, that server is used only for those domains and they are queried only using the specified server. This is intended for private nameservers: if you have a nameserver on your network which deals with names of the form xxx.internal.thekelleys.org.uk at 192.168.1.1 then giving the flag --server=/internal.thekelleys.org.uk/192.168.1.1 will send all queries for internal machines to that nameserver, everything else will go to the servers in /etc/resolv.conf. DNSSEC validation is turned off for such private nameservers, UNLESS a --trust-anchor is specified for the domain in question. An empty domain specification, // has the special meaning of "unqualified names only" ie names without any dots in them. A non-standard port may be specified as part of the IP address using a # character. More than one --server flag is allowed, with repeated domain or ipaddr parts as required.
More specific domains take precedence over less specific domains, so: --server=/google.com/1.2.3.4 --server=/www.google.com/2.3.4.5 will send queries for google.com and gmail.google.com to 1.2.3.4, but www.google.com will go to 2.3.4.5

Matching of domains is normally done on complete labels, so /google.com/ matches google.com and www.google.com but NOT supergoogle.com. This can be overridden with a * at the start of a pattern only: /*google.com/ will match google.com and www.google.com AND supergoogle.com. The non-wildcard form has priority, so if /google.com/ and /*google.com/ are both specified then google.com and www.google.com will match /google.com/ and /*google.com/ will only match supergoogle.com.

For historical reasons, the pattern /.google.com/ is equivalent to /google.com/ if you wish to match any subdomain of google.com but NOT google.com itself, use /*.google.com/

The special server address '#' means, "use the standard servers", so --server=/google.com/1.2.3.4 --server=/www.google.com/# will send queries for google.com and its subdomains to 1.2.3.4, except www.google.com (and its subdomains) which will be forwarded as usual.

Also permitted is a -S flag which gives a domain but no IP address; this tells dnsmasq that a domain is local and it may answer queries from /etc/hosts or DHCP but should never forward queries on that domain to any upstream servers. --local is a synonym for --server to make configuration files clearer in this case.

IPv6 addresses may include an %interface scope-id, eg fe80::202:a412:4512:7bbf%eth0.

The optional string after the @ character tells dnsmasq how to set the source of the queries to this nameserver. It can either be an ip-address, an interface name or both. The ip-address should belong to the machine on which dnsmasq is running, otherwise this server line will be logged and then ignored. If an interface name is given, then queries to the server will be forced via that interface; if an ip-address is given then the source address of the queries will be set to that address; and if both are given then a combination of ip-address and interface name will be used to steer requests to the server. The query-port flag is ignored for any servers which have a source address specified but the port may be specified directly as part of the source address. Forcing queries to an interface is not implemented on all platforms supported by dnsmasq.

Upstream servers may be specified with a hostname rather than an IP address. In this case, dnsmasq will try to use the system resolver to get the IP address of a server during startup. If name resolution fails, starting dnsmasq fails, too. If the system's configuration is such that the system resolver sends DNS queries through the dnsmasq instance which is starting up then this will time-out and fail.

https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html#index
2024-01-06 16:18:08 +08:00
回复了 kursk 创建的主题 分享创造 草根云,每个云原生工程师都值得拥有
2024-01-04 08:52:13 +08:00
回复了 kursk 创建的主题 分享创造 草根云,每个云原生工程师都值得拥有
2024-01-04 08:51:52 +08:00
回复了 kursk 创建的主题 分享创造 草根云,每个云原生工程师都值得拥有
2023-12-27 17:19:18 +08:00
回复了 kursk 创建的主题 分享创造 草根云,每个云原生工程师都值得拥有
2023-12-27 14:55:51 +08:00
回复了 kursk 创建的主题 分享创造 草根云,每个云原生工程师都值得拥有
@buffzty 现在哪个云厂商能开出 11 元/月的云主机?如果您可以真希望能提供链接,不要仅仅是煞有其事地泛泛而谈,也让我们也一起薅羊毛
2023-12-26 23:36:16 +08:00
回复了 kursk 创建的主题 分享创造 草根云,每个云原生工程师都值得拥有
@buffzty
1 、你举出这只是理论费用,带宽都没有算进去吧,我自己局域网的带宽可以达到 1000M ,使用云服务能达到么?相应的费用要多少?
2 、我就是要通过搭建过程来理解每个组件的作用,一键脚本简单,但失去了学习的过程。
3 、你没有算云盘费用,相比自己买的 TF 卡可以永久持有,性价比肯定更高。
4 、以后的各种二手 pi 也可以废旧利用上

其实最大的问题是,除了用于学习 K8S 的命令和各种操作,有没有实际的应用功能,比如家庭的什么功能,其实我是有想法的,但是还是要先尝试了再来给各位分享
2023-12-26 23:30:00 +08:00
回复了 kursk 创建的主题 分享创造 草根云,每个云原生工程师都值得拥有
@wsseo 我没有使用离线安装,我把网关变成了透明代理
@shen13176101 非常感谢,我研究一下 ngrok
装翻译插件是一个好事情,如果你对技术感兴趣,一遍看不懂再看第二遍、第三遍,不懂的单词或句子用鼠标选中翻译一下

如果连自己“感兴趣”的英文技术文章都看不懂,或者沉不下心来,问题不在于英文水平,在于不感兴趣,要考虑自己是否适合干这行
2023-12-13 16:12:48 +08:00
回复了 gregy 创建的主题 数据库 有没有大神知道这个描述是哪款国产数据库
@gregy OpenGaussDB 可以本地部署
2023-12-12 09:13:41 +08:00
回复了 suuuch 创建的主题 Kubernetes 自建低成本集群(k8s, Spark)的方式有哪些?
我现在正在用香橙派搭 K8S 带外部 etcd 集群,技术验证完全可行
3 个 OrangePi 3B 作为 etcd 集群
2 个 OrangePi 3 安装 keepalived+haproxy 作为负载均衡
3 个 OrangePi 3B 作为 control plane
再加 3 个 OrangePi 3B 作为 worker node ,或者用台式机上的虚拟机

这样就是一个功能完整的、具备独立 etcd 机器、独立负载均衡、非常廉价的 K8S 集群,而且没有风扇和噪音,适合放在家里。而且 control plane 完全独立,有多余的机器作为 worker node 加入,非常方便。

orangePi 3B 便宜的只要 200 左右,不用买带 eMMC 的,使用 64GB tf 卡,京东的 V3 速率只要 20 多元,没有比这个性价比更低的方案了
我感觉想考高分难,但是考过也很很简单,我教程都没有买,我是这么准备的

上午的客观题,背历年的真题,有 70%左右的一字不改的原题,网上找原题,提前两周开始背,不用提前太早,太早也会忘记。

下午的两门都是主观题,说实话,如果你的工作内容有写 PPT 、设计方案、技术方案的架构设计,这些日常的工作就是备考过程,你把日常这些文档写好,理解业务场景的特点,应该采用什么技术方案,按照领导和用户要求改好,把这些工作习惯养好后,用在下午的考场上,准过!
linux 下使用 dnsmasq + (nftables)iptables + ipset 可以完美解决

dnsmasq 的配置如下

server=/facebook.net/8.8.8.8#53
nftset=/facebook.net/4#inet#wgcross#crs_dst

server=/163.net/223.5.5.5#53
nftset=/163.net/4#inet#wgcross#cn

server 和 nftset 是 dnsmasq 的两个配置项,server 项的作用是收到 dns 请求后进行匹配(可按照域名级别进行匹配),比如上面例子中*.facebook.net 的域名都被转发给 8.8.8.8 解析,并且将解析的 ip 写入 nftables 中的 wgcross 表的 crs_dst set 进行存储,然后路由表当然也要设置,我的例子如下

chain PREROUTING { # handle 2
type nat hook prerouting priority filter; policy accept;
ip daddr { 23.95.146.49, 65.49.219.226, 193.22.152.174 } accept # handle 4
ip daddr { 0.0.0.0/8, 10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.168.0.0/16, 224.0.0.0-255.255.255.255 } accept # handle 6
ip daddr @cn accept # handle 8
ip daddr @crs_dst counter name "cnt_cross" meta mark set 0x00000009 accept # handle 10
}

最后两个路由条目,cn set 针对国内的路由,命中这个 set 中的路由就返回上级 chain(及走国内线路),而另一个 crs_dst set 会 mark 0x9 ,然后在 ip route 中挑出来走海外线路

这个技术路线,必须 DNS\route gateway 的功能集中在一台设备上。
1  2  3  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5617 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 33ms · UTC 03:05 · PVG 11:05 · LAX 20:05 · JFK 23:05
Developed with CodeLauncher
♥ Do have faith in what you're doing.