V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  gearfox  ›  全部回复第 1 页 / 共 21 页
回复总数  401
1  2  3  4  5  6  7  8  9  10 ... 21  
@qiaofanxing 我手贱用 TR069 给光猫 NTP 对时了后,通用密码就登不进去了
30 天前
回复了 icemanpro 创建的主题 Ubuntu ubuntu 24.04 下如何安装 vnc server?
别安装这个,直接安装 nomachine
链接 https://downloads.nomachine.com/linux/?id=1
搜了几个教程,汇总成如下,请各位大神看看有没有问题,没有敢运行,怕有问题影响生产。
[安装组件]
yum install ipset iptables-services iptables-devel ipset-service -y

[下载 ip 段做 ipset]
wget http://www.ipdeny.com/ipblocks/data/countries/cn.zone
for i in `cat cn.zone`; do echo "ipset add china $i" >>ipset_result.sh; done
chmod +x ipset_result.sh
ipset create china hash:net hashsize 10000 maxelem 1000000
sh ipset_result.sh

ipset add china 10.0.0.0/8
ipset add china 172.16.0.0/12
ipset add china 192.168.0.0/16
ipset list china | wc -l
ipset test china 192.168.1.0
ipset save china > /etc/ipset.conf

chmod +x /etc/rc.d/rc.local
echo "ipset restore < /etc/ipset.conf" >> /etc/rc.d/rc.local

[iptables 脚本]
#!/bin/bash
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/tcp_syncookies

service iptables restart

iptables -F
iptables -X
iptables -Z
iptables -F -t nat
iptables -X -t nat
iptables -Z -t nat

modprobe iptable_filter
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
modprobe ip_tables
modprobe iptable_nat

iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

IP1=111.111.111.111
LAN1=192.168.1.0/24

iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

iptables -A INPUT -m set --match-set china src -j ACCEPT
iptables -A FORWARD -m set --match-set china src -j ACCEPT

iptables -A INPUT -s $LAN1 -j ACCEPT
iptables -A FORWARD -s $LAN1 -j ACCEPT

iptables -t nat -A PREROUTING -p tcp -m set --match-set china src -d $IP1 --dport 80 -j DNAT --to-destination 192.168.1.10:80
iptables -t nat -A PREROUTING -p tcp -m set --match-set china src -d $IP1 --dport 443 -j DNAT --to-destination 192.168.1.10:443
iptables -t nat -A PREROUTING -p tcp -m set --match-set china src -d $IP1 --dport 58000 -j DNAT --to-destination 192.168.1.10:58000

iptables -A INPUT -p tcp --dport 57000 -j ACCEPT #本机 SSH
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 192.168.1.0/24 -j SNAT --to-source 192.168.1.254
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

sysctl -w net.ipv4.tcp_keepalive_time=600
sysctl -w net.ipv4.tcp_synack_retries=1
sysctl -w net.ipv4.tcp_syn_retries=1
sysctl -w net.ipv4.tcp_max_syn_backlog=16384
sysctl -w net.nf_conntrack_max=655360

[持久化规则]
iptables-save > /etc/sysconfig/iptables
echo "/usr/sbin/iptables-restore < /etc/sysconfig/iptables" >> /etc/rc.d/rc.local
群晖 威联通这 2 家里选一个即可,别再胡买了
48 天前
回复了 siya 创建的主题 程序员 一个炫酷的个人网站
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.
60 天前
回复了 oldersnail 创建的主题 硬件 XDM,推荐张显卡,轻度游戏
我几乎不玩游戏,4060
京东上买山泽、TP 的 6 类线即可,我买过用过很多箱,给企业做布线
67 天前
回复了 YostGray 创建的主题 宽带症候群 怎么找穿网线、光纤的师傅?
咸鱼 app 也可以找本地的换线人员上门
@xiaoshancom 向日葵免费版比 todesk 还卡
73 天前
回复了 yaott2020 创建的主题 NAS 有人用 OMV7 吗?感觉怎样?
web 界面依旧不美观
@pota 好的,我去试试
@diivL 同样懵逼了
@titanium98118 你好,刚好借这个主题我想咨询一个问题。
一共有 3 个阿里云 ECS 服务器,第一个用 nginx 做的负载均衡,其他两个做 webserver 。现在想使用 certbot 直接在负载均衡 nginx 上自动每月申请 ssl 免费证书。
但是运行 certbot 命令,提示非要指定--webroot ,如果在第一个 ECS 上面创建了 mkdir -p /usr/local/nginx/html/.well-known/acme-challenge/,但是 Let's Encrypt 自动验证访问又说 404 ,估计是访问到后端的 webserver 上了。
这个的问题该如何解决呢?
使用的命令如下
certbot certonly --webroot \
-w /usr/local/nginx/html -d work.123.com \
--nginx-server-root /usr/local/nginx/conf \
--register-unsafely-without-email \
--agree-tos \
--preferred-challenges http
@justest123 是的
@mouyase 是啊
96 天前
回复了 Moierby 创建的主题 问与答 你都见过哪些非常稀少的姓氏?
曾经有 2 个同事,叱干、母
1  2  3  4  5  6  7  8  9  10 ... 21  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4869 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 38ms · UTC 07:43 · PVG 15:43 · LAX 00:43 · JFK 03:43
Developed with CodeLauncher
♥ Do have faith in what you're doing.