Bonjour
J'installé samba pour partager mes fichiers et ma connexion adsl. Pour cela j'ai supprimé toutes les sécurité dans applications-parametres de systeme-niveau de sécurite.
Là tout marche.
Donc j'ai mis en place un firewall avec iptables, et là plus de connection internet.
Voici ce que j'ai fait
[color=CC0000]début[/color]
[root@bruno bruno]# service squid start
Démarrage de squid :. [ OK ]
[root@bruno bruno]# service smb start
Démarrage des services SMB : [ OK ]
Démarrage des services NMB : [ OK ]
[root@bruno bruno]# startadsl
[root@bruno bruno]# ping -c 2 216.239.59.104
PING 216.239.59.104 (216.239.59.104) 56(84) bytes of data.
64 bytes from 216.239.59.104: icmp_seq=0 ttl=239 time=88.0 ms
64 bytes from 216.239.59.104: icmp_seq=1 ttl=239 time=79.1 ms
--- 216.239.59.104 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 79.127/83.608/88.089/4.481 ms, pipe 2
[root@bruno bruno]# iptables -F
[root@bruno bruno]# iptables -X
[root@bruno bruno]# iptables -P INPUT DROP
[root@bruno bruno]# iptables -P OUTPUT DROP
[root@bruno bruno]# iptables -P FORWARD DROP
[root@bruno bruno]# iptables -t nat -F
[root@bruno bruno]# iptables -t nat -X
[root@bruno bruno]# iptables -t nat -P PREROUTING ACCEPT
[root@bruno bruno]# iptables -t nat -P POSTROUTING ACCEPT
[root@bruno bruno]# iptables -t nat -P OUTPUT ACCEPT
[root@bruno bruno]# iptables -t mangle -F
[root@bruno bruno]# iptables -t mangle -X
[root@bruno bruno]# iptables -t mangle -P PREROUTING ACCEPT
[root@bruno bruno]# iptables -t mangle -P INPUT ACCEPT
[root@bruno bruno]# iptables -t mangle -P OUTPUT ACCEPT
[root@bruno bruno]# iptables -t mangle -P FORWARD ACCEPT
[root@bruno bruno]# iptables -t mangle -P POSTROUTING ACCEPT
[root@bruno bruno]# iptables -A INPUT -i lo -j ACCEPT
[root@bruno bruno]# iptables -A OUTPUT -o lo -j ACCEPT
[root@bruno bruno]# iptables -A INPUT -i eth0 -j ACCEPT
[root@bruno bruno]# iptables -A OUTPUT -o eth0 -j ACCEPT
[root@bruno bruno]# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o ppp0 -j MASQUERADE
[root@bruno bruno]# iptables -A FORWARD -i eth0 -o ppp0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
[root@bruno bruno]# iptables -A FORWARD -i ppp0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
[root@bruno bruno]# iptables -A OUTPUT -o ppp0 -p tcp --dport 53 -m state --state ! INVALID -j ACCEPT
[root@bruno bruno]# iptables -A INPUT -i ppp0 -p tcp --sport 53 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
[root@bruno bruno]# iptables -A OUTPUT -o ppp0 -p udp --dport 53 -m state --state ! INVALID -j ACCEPT
[root@bruno bruno]# iptables -A INPUT -i ppp0 -p udp --sport 53 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
[root@bruno bruno]# ping -c 2 216.239.59.104
PING 216.239.59.104 (216.239.59.104) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
--- 216.239.59.104 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1000ms
[color=CC0000]essai de modif[/color]
[root@bruno bruno]# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
[root@bruno bruno]# ping -c 2 216.239.59.104
PING 216.239.59.104 (216.239.59.104) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
--- 216.239.59.104 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms
[root@bruno bruno]# cat /proc/sys/net/ipv4/ip_forward
0
[root@bruno bruno]# echo 1 > cat /proc/sys/net/ipv4/ip_forward
[root@bruno bruno]# cat /proc/sys/net/ipv4/ip_forward
0
[root@bruno bruno]# ping -c 2 216.239.59.104
PING 216.239.59.104 (216.239.59.104) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
--- 216.239.59.104 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms
[root@bruno bruno]# ifconfig
eth0 Lien encap:Ethernet HWaddr 00:11:11:B5:4B:70
inet adr:192.168.1.2 Bcast:192.168.1.255 Masque:255.255.255.0
adr inet6: fe80::211:11ff:feb5:4b70/64 Scope:Lien
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:63 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:0 (0.0 b) TX bytes:7550 (7.3 KiB)
eth1 Lien encap:Ethernet HWaddr 00:60:4C:15:96:75
adr inet6: fe80::260:4cff:fe15:9675/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:65535 Metric:1
RX packets:202 errors:0 dropped:0 overruns:0 frame:0
TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:12689 (12.3 KiB) TX bytes:6084 (5.9 KiB)
lo Lien encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1517 errors:0 dropped:0 overruns:0 frame:0
TX packets:1517 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:1525595 (1.4 MiB) TX bytes:1525595 (1.4 MiB)
ppp0 Lien encap:Protocole Point-à-Point
inet adr:83.193.59.122 P-t-P:193.253.160.3 Masque:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:191 errors:0 dropped:0 overruns:0 frame:0
TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:3
RX bytes:12173 (11.8 KiB) TX bytes:4188 (4.0 KiB)
[root@bruno bruno]#
[color=CC0000]fin[/color]
Pouvez vous me dire où je fais une erreur (ou plusieurs)
Merci par avance de votre aide
Bruno
J'installé samba pour partager mes fichiers et ma connexion adsl. Pour cela j'ai supprimé toutes les sécurité dans applications-parametres de systeme-niveau de sécurite.
Là tout marche.
Donc j'ai mis en place un firewall avec iptables, et là plus de connection internet.
Voici ce que j'ai fait
[color=CC0000]début[/color]
[root@bruno bruno]# service squid start
Démarrage de squid :. [ OK ]
[root@bruno bruno]# service smb start
Démarrage des services SMB : [ OK ]
Démarrage des services NMB : [ OK ]
[root@bruno bruno]# startadsl
[root@bruno bruno]# ping -c 2 216.239.59.104
PING 216.239.59.104 (216.239.59.104) 56(84) bytes of data.
64 bytes from 216.239.59.104: icmp_seq=0 ttl=239 time=88.0 ms
64 bytes from 216.239.59.104: icmp_seq=1 ttl=239 time=79.1 ms
--- 216.239.59.104 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 79.127/83.608/88.089/4.481 ms, pipe 2
[root@bruno bruno]# iptables -F
[root@bruno bruno]# iptables -X
[root@bruno bruno]# iptables -P INPUT DROP
[root@bruno bruno]# iptables -P OUTPUT DROP
[root@bruno bruno]# iptables -P FORWARD DROP
[root@bruno bruno]# iptables -t nat -F
[root@bruno bruno]# iptables -t nat -X
[root@bruno bruno]# iptables -t nat -P PREROUTING ACCEPT
[root@bruno bruno]# iptables -t nat -P POSTROUTING ACCEPT
[root@bruno bruno]# iptables -t nat -P OUTPUT ACCEPT
[root@bruno bruno]# iptables -t mangle -F
[root@bruno bruno]# iptables -t mangle -X
[root@bruno bruno]# iptables -t mangle -P PREROUTING ACCEPT
[root@bruno bruno]# iptables -t mangle -P INPUT ACCEPT
[root@bruno bruno]# iptables -t mangle -P OUTPUT ACCEPT
[root@bruno bruno]# iptables -t mangle -P FORWARD ACCEPT
[root@bruno bruno]# iptables -t mangle -P POSTROUTING ACCEPT
[root@bruno bruno]# iptables -A INPUT -i lo -j ACCEPT
[root@bruno bruno]# iptables -A OUTPUT -o lo -j ACCEPT
[root@bruno bruno]# iptables -A INPUT -i eth0 -j ACCEPT
[root@bruno bruno]# iptables -A OUTPUT -o eth0 -j ACCEPT
[root@bruno bruno]# iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o ppp0 -j MASQUERADE
[root@bruno bruno]# iptables -A FORWARD -i eth0 -o ppp0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
[root@bruno bruno]# iptables -A FORWARD -i ppp0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
[root@bruno bruno]# iptables -A OUTPUT -o ppp0 -p tcp --dport 53 -m state --state ! INVALID -j ACCEPT
[root@bruno bruno]# iptables -A INPUT -i ppp0 -p tcp --sport 53 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
[root@bruno bruno]# iptables -A OUTPUT -o ppp0 -p udp --dport 53 -m state --state ! INVALID -j ACCEPT
[root@bruno bruno]# iptables -A INPUT -i ppp0 -p udp --sport 53 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
[root@bruno bruno]# ping -c 2 216.239.59.104
PING 216.239.59.104 (216.239.59.104) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
--- 216.239.59.104 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1000ms
[color=CC0000]essai de modif[/color]
[root@bruno bruno]# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
[root@bruno bruno]# ping -c 2 216.239.59.104
PING 216.239.59.104 (216.239.59.104) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
--- 216.239.59.104 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms
[root@bruno bruno]# cat /proc/sys/net/ipv4/ip_forward
0
[root@bruno bruno]# echo 1 > cat /proc/sys/net/ipv4/ip_forward
[root@bruno bruno]# cat /proc/sys/net/ipv4/ip_forward
0
[root@bruno bruno]# ping -c 2 216.239.59.104
PING 216.239.59.104 (216.239.59.104) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
--- 216.239.59.104 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms
[root@bruno bruno]# ifconfig
eth0 Lien encap:Ethernet HWaddr 00:11:11:B5:4B:70
inet adr:192.168.1.2 Bcast:192.168.1.255 Masque:255.255.255.0
adr inet6: fe80::211:11ff:feb5:4b70/64 Scope:Lien
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:63 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:0 (0.0 b) TX bytes:7550 (7.3 KiB)
eth1 Lien encap:Ethernet HWaddr 00:60:4C:15:96:75
adr inet6: fe80::260:4cff:fe15:9675/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:65535 Metric:1
RX packets:202 errors:0 dropped:0 overruns:0 frame:0
TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:12689 (12.3 KiB) TX bytes:6084 (5.9 KiB)
lo Lien encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1517 errors:0 dropped:0 overruns:0 frame:0
TX packets:1517 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:1525595 (1.4 MiB) TX bytes:1525595 (1.4 MiB)
ppp0 Lien encap:Protocole Point-à-Point
inet adr:83.193.59.122 P-t-P:193.253.160.3 Masque:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:191 errors:0 dropped:0 overruns:0 frame:0
TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:3
RX bytes:12173 (11.8 KiB) TX bytes:4188 (4.0 KiB)
[root@bruno bruno]#
[color=CC0000]fin[/color]
Pouvez vous me dire où je fais une erreur (ou plusieurs)
Merci par avance de votre aide
Bruno