start_gateway.sh

来自「可运行于linux平台的自组织网络协议」· Shell 代码 · 共 37 行

SH
37
字号
#!/bin/shGWVER=2.2echo -e "\n\nLoading AODV Gateway version $GWVER...\n"IPTABLES=/sbin/iptablesKERNEL_AODV=kernel_aodvEXTIF="eth0"  #interface to use for gatewayingINTIF="wlan0"   #interface to connect to AODV Network# The node will assume all destinations that are not in INTIF's# subnet are on the internet and not part of the AODV subnet.# Because of this you may have to alter INTIF's subent to match# the subnet that all of the other AODV nodes are one.echo "	Gateway Interface: $EXTIF"echo "	AODV Interface: $INTIF"echo "	Enabling IP forwarding"echo "1" > /proc/sys/net/ipv4/ip_forwardecho "  Zero MIN_DELAY for routing table changes"echo "0" > /proc/sys/net/ipv4/route/min_delay$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPTecho "	Enabling Masquerading on $EXTIF"$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADEecho "	Starting Kernel AODV..."echoinsmod $KERNEL_AODV use_dev=$INTIF aodv_gateway=1

⌨️ 快捷键说明

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