Comments (5)
尝试使用自定义vlan网段功能 7-3-3
from shellclash.
早知道早点来提问,问一下果然有收获,我大概不过我没怎么看明白,是不是和mac不能同时处理,就是说我在配置了mac白名单的同时,不能再配置ip规则了对吗?
#tcp&udp分别进代理链
proxy_set() {
if [ "$3" = 'PREROUTING' ] && [ "$macfilter_type" = "白名单" ] && [ -s "$CRASHDIR"/configs/mac ]; then
for mac in $(cat "$CRASHDIR"/configs/mac); do
$1 -t $2 -A $4 -p $5 -m mac --mac-source $mac -j $JUMP
done
else
for ip in $HOST_IP; do #仅限指定网段流量
$1 -t $2 -A $4 -p $5 -s $ip -j $JUMP
echo $1 -t $2 -A $4 -p $5 -s $ip -j $JUMP
done
fi
#将所在链指定流量指向shellcrash表
$1 -t $2 -I $3 -p $5 $ports -j $4
[ "$dns_mod" != "redir_host" ] && [ "$common_ports" = "已开启" ] && [ "$1" = iptables ] && $1 -t $2 -I $3 -p $5 -d 198.18.0.0/16 -j $4
}
[ "$5" = "tcp" -o "$5" = "all" ] && proxy_set $1 $2 $3 $4 tcp
[ "$5" = "udp" -o "$5" = "all" ] && proxy_set $1 $2 $3 $4 udp
这里的判断只会加mac规则
if [ "$3" = 'PREROUTING' ] && [ "$macfilter_type" = "白名单" ] && [ -s "$CRASHDIR"/configs/mac ]; then
from shellclash.
还有个问题
#if [ "$replace_default_host_ipv4" == "未禁用" ]; then
if [ "$replace_default_host_ipv4" == "已启用" ]; then
host_ipv4="$cust_host_ipv4"
else
host_ipv4="$host_ipv4$cust_host_ipv4"
fi
我看界面已经不再用“未禁用”了,而是“已启用”,所以匹配不到覆盖了。
from shellclash.
早知道早点来提问,问一下果然有收获,我大概不过我没怎么看明白,是不是和mac不能同时处理,就是说我在配置了mac白名单的同时,不能再配置ip规则了对吗?
#tcp&udp分别进代理链 proxy_set() { if [ "$3" = 'PREROUTING' ] && [ "$macfilter_type" = "白名单" ] && [ -s "$CRASHDIR"/configs/mac ]; then for mac in $(cat "$CRASHDIR"/configs/mac); do $1 -t $2 -A $4 -p $5 -m mac --mac-source $mac -j $JUMP done else for ip in $HOST_IP; do #仅限指定网段流量 $1 -t $2 -A $4 -p $5 -s $ip -j $JUMP echo $1 -t $2 -A $4 -p $5 -s $ip -j $JUMP done fi #将所在链指定流量指向shellcrash表 $1 -t $2 -I $3 -p $5 $ports -j $4 [ "$dns_mod" != "redir_host" ] && [ "$common_ports" = "已开启" ] && [ "$1" = iptables ] && $1 -t $2 -I $3 -p $5 -d 198.18.0.0/16 -j $4 } [ "$5" = "tcp" -o "$5" = "all" ] && proxy_set $1 $2 $3 $4 tcp [ "$5" = "udp" -o "$5" = "all" ] && proxy_set $1 $2 $3 $4 udp这里的判断只会加mac规则
if [ "$3" = 'PREROUTING' ] && [ "$macfilter_type" = "白名单" ] && [ -s "$CRASHDIR"/configs/mac ]; then
我试过把else去掉,就是执行mac的同时把ip也加入,这样是可以的😂。不知道这样是不是有问题。
修改如下:
--- ori.sh
+++ start.sh
@@ -194,7 +194,7 @@
sleep 1 && i=$((i + 1))
done
#添加自定义ipv4局域网网段
- if [ "$replace_default_host_ipv4" == "未禁用" ]; then
+ if [ "$replace_default_host_ipv4" == "已启用" ]; then
host_ipv4="$cust_host_ipv4"
else
host_ipv4="$host_ipv4$cust_host_ipv4"
@@ -930,7 +930,7 @@
for mac in $(cat "$CRASHDIR"/configs/mac); do
$1 -t $2 -A $4 -p $5 -m mac --mac-source $mac -j $JUMP
done
- else
+ #else
for ip in $HOST_IP; do #仅限指定网段流量
$1 -t $2 -A $4 -p $5 -s $ip -j $JUMP
done
@@ -972,7 +972,7 @@
$1 -t nat -A $3 -p tcp -m mac --mac-source $mac -j REDIRECT --to-ports $dns_port
$1 -t nat -A $3 -p udp -m mac --mac-source $mac -j REDIRECT --to-ports $dns_port
done
- else
+ #else
for ip in $HOST_IP; do #仅限指定网段流量
$1 -t nat -A $3 -p tcp -s $ip -j REDIRECT --to-ports $dns_port
$1 -t nat -A $3 -p udp -s $ip -j REDIRECT --to-ports $dns_port
from shellclash.
@bsdcpp 白名单当然只会允许名单内通过
from shellclash.
Related Issues (20)
- [Feature] `Mihomo`内核`DNS`增加`mix混合模式` HOT 1
- [Bug] 安装后 /etc/passwd里,自动增加了一个root用户?? HOT 2
- [Bug] LXC下 Tproxy 无法启用 HOT 1
- [Bug] 启动服务iptables chain_add failed HOT 3
- [Bug] SingBox内核,设置里vmess节点的tls里insecure=true,依然无法联网。 HOT 3
- [Bug] 清理shellcrash自建表在清理调用之前,导致sc退出后,几个chian还在 HOT 3
- [Bug] Unraid安装并启动之后,丢失ipv6 HOT 2
- [Bug] telegram改了个名被bot给ban了🤣 HOT 1
- [Bug] openwrt 安装shellcrash 启用tun模式 有时提示“找不到tun模块,放弃启动tun相关防火墙规则!” HOT 1
- [Bug] 卸载后不会一起删除网卡,导致服务器DNS被劫持 HOT 1
- support for juicity HOT 1
- [question] 怎么手动添加分流策略呢 HOT 1
- [Bug] YACD面板无法显示内存信息 HOT 2
- [Bug] ax9000上一直报错 HOT 1
- [Bug] Xiaomi Router R2D Failed After Restarting HOT 1
- Singbox-p内核,在lxc容器中无法使用tproxy和tun模式 HOT 5
- [Bug] 每次重启之后SSH的公钥都被重置了 HOT 4
- [Bug] 华硕天选路由器redict模式连接不进入核心
- [Feature] 如何修改 fake-ip 的网段? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shellclash.