iptables_init.sh

来自「很小的linux下的upnp服务器端代码适合嵌入式系统」· Shell 代码 · 共 20 行

SH
20
字号
#! /bin/sh# $Id: iptables_init.sh,v 1.3 2006/11/23 12:32:57 nanard Exp $IPTABLES=iptables#change this parameters :EXTIF=eth0EXTIP="`LC_ALL=C /sbin/ifconfig $EXTIF | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`"echo "External IP = $EXTIP"#adding the MINIUPNPD chain for nat$IPTABLES -t nat -N MINIUPNPD#adding the rule to MINIUPNPD$IPTABLES -t nat -A PREROUTING -d $EXTIP -i $EXTIF -j MINIUPNPD#adding the MINIUPNPD chain for filter$IPTABLES -t filter -N MINIUPNPD#adding the rule to MINIUPNPD$IPTABLES -t filter -A FORWARD -i $EXTIF -o ! $EXTIF -j MINIUPNPD

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?