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.

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