2 ====================================
3 Services Configuration File Examples
4 ====================================
16 ================ ====================================================
18 ================ ====================================================
19 ``domain_name`` Domain name
21 ``dns_2`` Secondary DNS
22 ``net_address`` Network address where the DHCP service will run
23 ``net_mask`` Network mask
24 ``net_start`` Start address for the dynamic address range
25 ``net_end`` End address for the dynamic address range
26 ``net_gateway`` Network gateway
27 ================ ====================================================
33 ================ ====================================================
35 ================ ====================================================
36 ``host1_name`` Host name
37 ``host1_mac`` Host MAC Address (for example ``00:00:12:34:56:78``)
38 ``host1_ip`` Host IP Address
39 ================ ====================================================
48 ddns-update-style none;
50 option domain-name %(domain_name);
51 option domain-name-servers %(dns_1), %(dns_2);
57 subnet %(net_address) netmask %(net_mask) {
58 range %(net_start) %(net_end);
59 option routers %(net_gateway);
64 fixed-address %(host1_ip);
65 hardware ethernet %(host1_mac);
78 ================ ====================================================
80 ================ ====================================================
81 ``isp_dns1`` ISP's DNS server (can have multiple values)
82 ``bind_addr1`` IP Address where the server will listen (can have \
84 ``zone1`` *Zone* (or domain) that the server will manage \
85 (can have multiple values)
86 ================ ====================================================
95 directory "/var/bind";
103 listen-on-v6 { none; };
109 pid-file "/var/run/named/named.pid";
117 zone "localhost" IN {
119 file "pri/localhost.zone";
120 allow-update { none; };
124 zone "127.in-addr.arpa" IN {
127 allow-update { none; };
134 file "pri/%(zone1).zone";
135 allow-update { none; };
141 file "pri/%(zone1).zone.ptr";
142 allow-update { none; };
156 List rules from a table
157 +++++++++++++++++++++++
161 # iptables -t ${table} -L -v
163 Remove a rule from a table
164 ++++++++++++++++++++++++++
168 # iptables -t ${table} -D ${chain} ${num}
170 Remove all rules from a table
171 +++++++++++++++++++++++++++++
175 # iptables -t ${table} -F
177 Remove all rules of a specific *chain* from a table
178 +++++++++++++++++++++++++++++++++++++++++++++++++++
182 # iptables -t ${table} -F ${chain}
194 # iptables -t filter -L -v
201 # iptables -t filter -I ${chain} ${pos} -j ${target} \
202 [-s ${src_ip}/${src_ip_prefix_length}] \
203 [-d ${dest_ip}/${dst_ip_prefix_length}] \
206 If ``protocol`` (``-p`` option) is ``udp`` or ``tcp``, source and target ports
209 # iptables -t filter -I ${chain} ${num} -j ${target} \
210 [-s ${src_ip}/${src_ip_prefix_length}] \
211 [-d ${dest_ip}/${dst_ip_prefix_length}] \
212 [-p ${protocol}] -m ${protocolo} \
213 [--sport ${src_port}] [--dport ${dst_port}]
217 * ``${chain}`` is ``INPUT``, ``OUTPUT`` or ``FORWARD``
218 * ``${pos}`` is the index of the rule inside de table
219 * ``${protocol}`` is ``udp``, ``tcp``, ``icmp`` or ``all``
220 * ``${target}`` is ``DROP``, ``ACCEPT`` or ``REJECT``
232 # iptables -t nat -L -v
239 # iptables -t nat -I PREROUTING ${pos} -i ${dev} \
240 -j DNAT --to ${nat_dst_ip}[:${nat_dst_port}] \
241 -p <tcp|udp> --dport ${port} \
242 [-s ${src_ip}/${src_ip_prefix_length}] \
243 [-d ${dest_ip}/${dst_ip_prefix_length}]
250 # iptables -t nat -I POSTROUTING ${pos} -o ${dev} \
251 -j MASQUERADE -s ${src_ip}/${src_ip_prefix_length}
258 # iptables -t nat -I POSTROUTING ${pos} -o ${dev} \
259 -j SNAT --to ${nat_src_ip} \
260 -s ${src_ip}/${src_ip_prefix_length}
264 .. vim: set et sw=3 sts=3 tw=78 :