Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3127287
  • 博文数量: 710
  • 博客积分: 14546
  • 博客等级: 上将
  • 技术积分: 6738
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-30 10:20
文章分类

全部博文(710)

文章存档

2016年(1)

2014年(7)

2013年(22)

2012年(227)

2011年(322)

2009年(119)

2008年(12)

分类: LINUX

2011-07-18 18:30:13

  1. #!/bin/sh
  2. #
  3. # filename: ifdown-ipv6
  4. #
  5. # RedHat 6.2
  6. # directory: /etc/sysconfig/network-scripts
  7. #
  8. # permissions: 755
  9. #
  10. # description: Brings down IPv6 for an interface
  11. #
  12. # (P) & (C) 2000 by Peter Bieringer <pb@bieringer.de>
  13. #
  14. # This script is now explicitly GPL'ed (20001125, Peter Bieringer)
  15. #
  16. #
  17. # Suggestions, comments and improvements are welcome!
  18. #
  19. # You will find more information in the IPv6-HowTo for Linux at
  20. #
  21. #
  22. # Changes to:
  23. # 20000703: initial for a new layout
  24. # 20000704: add test for static route file
  25. # 20000723: fix bug in static route selection
  26. # 20000731: fix misnamed function 'forwarding-ipv6-route' -> 'forwarding-ipv6'
  27. # 20000816: fix because "network-functions-ipv6" function names are changed
  28. # 20001125: explicitly GPL'ed
  29. # 20001130: remove not needed copyright reference to RedHat

  30. #set -x

  31. . /etc/sysconfig/network

  32. cd /etc/sysconfig/network-scripts
  33. . network-functions

  34. CONFIG=$1
  35. [ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
  36. source_config

  37. # Test if IPv6 configuration is enabled
  38. if [ ! "$IPV6INIT" = "yes" ]; then
  39.         # not enabled, stop here
  40.         exit 0
  41. fi
  42.   
  43. # Test if IPv6 is up
  44. if [ "${NETWORKING_IPV6}" = "yes" ]; then
  45.         if [ ! -f /etc/sysconfig/network-scripts/network-functions-ipv6 ]; then
  46.                 echo -e "\a You have enabled IPv6 in '/etc/sysconfig/network'"
  47.                 echo " by setting 'NETWORKING_IPV6' to 'yes', but"
  48.                 echo " file '/etc/sysconfig/network-scripts/network-functions-ipv6"
  49.                 echo " is missing -> disabling it!"
  50.                 NETWORKING_IPV6=no
  51.         else
  52.                 . /etc/sysconfig/network-scripts/network-functions-ipv6

  53.         # Delete additional static IPv6 routes on specified interface
  54.                 if [ -f /etc/sysconfig/static-routes-ipv6 ]; then
  55.             grep "^$DEVICE" /etc/sysconfig/static-routes-ipv6 | while read device args; do
  56.          if [ "$device" = "$DEVICE" ]; then
  57.                             ifdown_ipv6_route $args $DEVICE
  58.                 fi
  59.             done
  60.         fi

  61.         # Switch off forwarding per device (packets received on this
  62.         # interface aren

阅读(1410) | 评论(0) | 转发(1) |
0

上一篇:linux bonding 配置

下一篇:linux关闭IPV6

给主人留下些什么吧!~~