wukercheng的个人空间 https://blog.eetop.cn/122094 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

拨号脚本

已有 525 次阅读| 2011-9-14 13:30

        # add route
        /sbin/ifconfig | /usr/bin/tail -n 10 | /bin/grep 'inet addr:' > ./tfile
        /bin/sed 's/inet addr://g' ./tfile > ./tfile1
        ip=`/bin/cat ./tfile1 | /usr/bin/awk '{print $1}'`
        # /sbin/route add -net $server_ip gw $ip netmask 255.255.0.0
        # /sbin/route delete mue
        /sbin/route add default gateway $ip
        rm ./tfile
        rm ./tfile1
        echo $ip
        # enable NAT
        echo "1" > /proc/sys/net/ipv4/ip_forward
        /sbin/iptables -F
        /sbin/iptables -P INPUT ACCEPT
        /sbin/iptables -P FORWARD ACCEPT
#        /sbin/iptables -t nat -A PREROUTING -d $ip -j DNAT --to-destination 192.168.1.100
#        /sbin/iptables -t nat -A PREROUTING -d $ip -p tcp --dport 8000 -j DNAT --to-destination 192.168.1.100:8000
        /sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

点赞

全部作者的其他最新日志

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 1

    粉丝
  • 0

    好友
  • 0

    获赞
  • 5

    评论
  • 215

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-3 06:46 , Processed in 0.015814 second(s), 13 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部