Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Witam mam skonfigurowany mały serwer z dostępem do internetu, wszystko fajnie działa, oto ustawienia :
/etc/network/interfaces
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 83.19.28.220 netmask 255.255.255.248 gateway 83.19.28.217 network 83.19.28.0 broadcast 83.19.28.255 auto eth1 iface eth1 inet static address 10.0.0.1 netmask 255.0.0.0
/etc/dhcp3/dhcpd.conf
ddns-update-style none; option domain-name-servers 194.204.159.1, 194.204.152.34; default-lease-time 600; max-lease-time 7200; subnet 10.0.0.0 netmask 255.0.0.0 { option subnet-mask 255.0.0.0; option routers 10.0.0.1; option broadcast-address 10.0.0.255; ignore unknown-clients; #Admin host Ja { hardware ethernet 00:30:4F:79:9A:03; fixed-address 10.0.0.3; } #Olga host P102_1 { hardware ethernet 00:03:0D:84:30:6A; fixed-address 10.1.2.1; } #Basia host P102_2 { hardware ethernet 00:03:0D:82:82:41; fixed-address 10.1.2.2; } #Ola host P103_1 { hardware ethernet 00:23:8B:CD:30:0F; fixed-address 10.1.3.1; } #Ada host P104_1 { hardware ethernet 00:1D:72:01:36:C6; fixed-address 10.1.4.1; } #Zielonka host P107_1 { hardware ethernet 00:26:2D:7C:10:6D; fixed-address 10.1.7.1; } #Marta host P108_1 { hardware ethernet 00:0E:2E:8C:C7:5D; fixed-address 10.1.8.1; } }
/etc/init.d/firewall
# wlaczenie w kernelu forwardowania echo 1 > /proc/sys/net/ipv4/ip_forward # czyszczenie starych regul iptables -F iptables -X iptables -t nat -X iptables -t nat -F iptables -t mangle -F iptables -t mangle -X # ustawienie domyslnej polityki iptables -P INPUT ACCEPT iptables -P FORWARD DROP iptables -P OUTPUT ACCEPT # utrzymanie polaczen nawiazanych iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED iptables -A FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED iptables -A OUTPUT -j ACCEPT -m state --state ESTABLISHED,RELATED # udostepniaie internetu w sieci lokalnej iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -j MASQUERADE iptables -I FORWARD -s 10.0.0.3 -m mac --mac-source 00:30:4F:79:9A:03 -j ACCEPT iptables -I FORWARD -s 10.1.2.1 -m mac --mac-source 00:03:0D:84:30:6A -j ACCEPT #P102 Olga iptables -I FORWARD -s 10.1.2.2 -m mac --mac-source 00:03:0D:82:82:41 -j ACCEPT #P102 Basia iptables -I FORWARD -s 10.1.3.1 -m mac --mac-source 00:23:8B:CD:30:0F -j ACCEPT #P103 Ola iptables -I FORWARD -s 10.1.4.1 -m mac --mac-source 00:1D:72:01:36:C6 -j ACCEPT #P104 Ada iptables -I FORWARD -s 10.1.7.1 -m mac --mac-source 00:26:2D:7C:10:6D -j ACCEPT #P107 Zielonka iptables -I FORWARD -s 10.1.8.1 -m mac --mac-source 00:0E:2E:8C:C7:5D -j ACCEPT #P108 Marta iptables -I FORWARD -s 10.1.9.1 -m mac --mac-source 00:0B:6A:75:A7:91 -j ACCEPT #P109 Rafal iptables -I FORWARD -s 10.1.9.2 -m mac --mac-source 00:26:18:5E:DA:55 -j ACCEPT #P109 Angela iptables -I FORWARD -s 10.1.10.1 -m mac --mac-source 90:E6:BA:A0:EE:79 -j ACCEPT #P110 Jacel iptables -I FORWARD -s 10.2.5.1 -m mac --mac-source 40:61:86:19:64:BA -j ACCEPT #P205 Sandra iptables -I FORWARD -s 10.2.5.2 -m mac --mac-source E0:CB:4E:34:5F:72 -j ACCEPT #P205 Marta iptables -I FORWARD -s 10.2.6.1 -m mac --mac-source 00:0C:76:E5:46:15 -j ACCEPT #P206 Jezus iptables -I FORWARD -s 10.2.7.1 -m mac --mac-source 40:61:86:3E:03:B6 -j ACCEPT #P207 Ogor iptables -I FORWARD -s 10.2.7.2 -m mac --mac-source 00:03:0D:82:72:C4 -j ACCEPT #P207 Henry iptables -I FORWARD -s 10.2.10.1 -m mac --mac-source 00:0C:76:6A:A5:68 -j ACCEPT #P210 Ania l2 iptables -I FORWARD -s 10.3.2.1 -m mac --mac-source 00:26:9E:10:47:F3 -j ACCEPT #P302 Kamil iptables -I FORWARD -s 10.3.5.1 -m mac --mac-source 00:16:36:48:C6:89 -j ACCEPT #P305 Ula iptables -I FORWARD -s 10.3.5.2 -m mac --mac-source 00:24:1D:D4:85:18 -j ACCEPT #P305 Martyna iptables -I FORWARD -s 10.3.6.1 -m mac --mac-source 00:16:44:99:E8:47 -j ACCEPT #P306 Artur iptables -I FORWARD -s 10.3.6.2 -m mac --mac-source 00:C0:A8:D9:F7:DB -j ACCEPT #P306 Tomek iptables -I FORWARD -s 10.3.7.1 -m mac --mac-source 00:23:54:54:49:A2 -j ACCEPT #P307 Wojtek iptables -I FORWARD -s 10.3.9.1 -m mac --mac-source 00:1E:33:C7:4F:51 -j ACCEPT #P306 Alina
Chciał bym teraz wprowadzić ograniczenia na transfer dla danego hosta np. dla hosta #P102 Olga ograniczenie max download 120 kb. Czy mógłby mi ktoś z tym pomóc ??
Offline
Było, było, było.
http://stary.dug.net.pl/texty/htb.php
http://www.przybytek.net/download/2.4routing.pdf
Ostatnio edytowany przez Jacekalex (2010-11-08 23:41:03)
Offline
idąc na łatwiznę: niceshaper
Offline
Time (s) | Query |
---|---|
0.00009 | SET CHARSET latin2 |
0.00004 | SET NAMES latin2 |
0.00092 | SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='13.59.134.65' WHERE u.id=1 |
0.00063 | REPLACE INTO punbb_online (user_id, ident, logged) VALUES(1, '13.59.134.65', 1732597109) |
0.00045 | SELECT * FROM punbb_online WHERE logged<1732596809 |
0.00064 | SELECT topic_id FROM punbb_posts WHERE id=157598 |
0.00118 | SELECT id FROM punbb_posts WHERE topic_id=17669 ORDER BY posted |
0.00074 | SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=17669 AND t.moved_to IS NULL |
0.00005 | SELECT search_for, replace_with FROM punbb_censoring |
0.00084 | SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=17669 ORDER BY p.id LIMIT 0,25 |
0.00089 | UPDATE punbb_topics SET num_views=num_views+1 WHERE id=17669 |
Total query time: 0.00647 s |