mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

174 lines
5.5 KiB

  1. ROCKNET [by Clifford Wolf]
  2. ===========================
  3. The idea of ROCKNET is to make the network configuration more flexible and
  4. allow integration of simple firewalling rules, multiple interfaces, multiple
  5. IPs per interface and multiple profiles. It should be easy to setup very
  6. complex and very simple setups, should "feel good" when working directly
  7. with an ASCII editor on the config files and should be easy to integrate in
  8. a more or less colored configuration GUI (such as stone).
  9. Configuration File
  10. ------------------
  11. The network configuration is stored in /etc/network/config. All filenames
  12. in this file are relative to /etc/network/ if they don't begin with a slash.
  13. An example /etc/network/config follows:
  14. auto eth0 eth1
  15. forward
  16. interface eth0
  17. ip 192.168.1.1/24
  18. ip 192.168.2.1/24
  19. interface eth1
  20. ip 192.168.100.99/24
  21. gw 192.168.100.1
  22. Or another /etc/network/config:
  23. auto eth0
  24. interface eth0
  25. dhcp
  26. script dyndns.sh # update dyndns
  27. allow ip 10.10.0.0/24 # office
  28. allow ip 192.168.0.0/24 # home
  29. allow tcp 80 # webserver is open
  30. deny all
  31. Or one using profiles:
  32. auto eth0 eth1(office)
  33. interface eth0(home)
  34. ip 192.168.69.15/24
  35. interface eth0(office)
  36. allow ip 10.10.0.0/16 tcp ssh
  37. deny all
  38. dhcp
  39. interface eth1(office)
  40. essid 'Blubb'
  41. keyc 'I@mCo0l'
  42. deny all
  43. dhcp
  44. So there are commands with optional parameter lists. The following commands
  45. are allowed in the config file:
  46. auto
  47. Lists those interfaces which should be set up automatically at
  48. boot up (list evaluated from left to right) and shut down on system
  49. shutdown (from right to left). All interfaces not listed here must
  50. be set up or shut down manually using 'ifup' and 'ifdown'.
  51. Must be used before the first 'interface' directive.
  52. forward
  53. If used, forwarding between interfaces will be activated at boot up
  54. and the host may be used as gateway between two networks.
  55. Must be used before the first 'interface' directive.
  56. interface
  57. Everything after that statement and before the next interface statement
  58. is the configuration for that specific interface. All directives within
  59. an interface section are executed from the first to the last when
  60. setting up the interface and the reversed order when shutting it down.
  61. dhcp
  62. Configure the interface using the DHCP protocol.
  63. script
  64. Execute the specified script with the given parameters. The parameter
  65. "up" is inserted as first parameter when the interface is set up and
  66. the parameter "down" is inserted when the interface is shut down.
  67. run-up, run-down
  68. Run the given command when the interface is set up or shut down
  69. respectively.
  70. ip, gw
  71. Set the given ip(s) and gateway when the interface is set up, remove
  72. all IPs from the interface when the interface is shut down.
  73. allow, deny
  74. Add the given simple firewalling rules. Those statements are executed
  75. before the other statements in the interface section when setting up
  76. the interface and are executed after the other statements when
  77. shutting down the interface. See section "Simple Firewall" below for
  78. details.
  79. Profiles
  80. --------
  81. Interface names in the 'auto' and the 'interface' statement can be followed
  82. by a coma-separated list of profile names in parentheses.
  83. In case of the 'auto' statement, only those interfaces are used which do
  84. have the current profile specified or no profile at all.
  85. In case of the 'interface' statement, an interface section is used if it has
  86. no profile specified or the current profile is given in the profile list.
  87. An non-existing interface section will be handled as it would be an empty
  88. interface section. Empty interface sections are silently ignored by "ifup"
  89. and "ifdown".
  90. The current profile is stored in /etc/network/profile.
  91. Command-line Tools
  92. ------------------
  93. There are two simple command line tools for working with ROCKNET: "ifup"
  94. and "ifdown". The first parameter is the name of the interface which should
  95. be set up, the second parameter (which is optional) is the profile name to be
  96. used while reading the configuration. If the 2nd parameter is missing, the
  97. content of /etc/network/profile is used.
  98. Simple Firewall
  99. ---------------
  100. When there are any 'allow' or 'deny' statements in an interface section, the
  101. ifup script automatically adds a chain named 'simple-firewall-<ifname>' to
  102. the iptables 'filter' table and links that chain into the INPUT chain using
  103. the incoming interface as condition.
  104. All 'allow' and 'deny' statements add rules to that chain. 'Allow' links
  105. to the netfilter 'ACCEPT' target and 'deny' to the netfilter 'REJECT' (and
  106. not 'DROP') target.
  107. When shutting down the interface, the chain 'simple-firewall-<ifname>' is
  108. simply flushed and removed from the iptables configuration.
  109. Tricking with pseudo-interfaces
  110. -------------------------------
  111. It's possible to define non-existing interfaces such as 'iptables' in the
  112. configuration file. It would result to errors if e.g. the 'ip' statement
  113. would be used in those interface sections - but it is possible to use the
  114. 'script' statement in those pseudo-interfaces and so e.g. link a complex
  115. firewall setup into the ROCKNET framework.
  116. Compatibility
  117. -------------
  118. The program names "ifup" and "ifdown" are used on many distributions for small
  119. helpers to set up or shut down interfaces.
  120. The file /etc/network/config has a very similar "feeling" as debians
  121. /etc/network/interfaces and so it should be pretty easy especially for debian
  122. users to get used to ROCK Linux based distributions network configuration.
  123. The whole thing is very different from RedHats /etc/sysconfig/network/ and is
  124. likely to also be different from whatever SuSE is using for the same purpose.