Ubuntu reseau
Bonjour,
Avec Linux pas de problèmes. Depuis que j'ai installé FEDORA j'ai eu un probleme de configuration Reseau. Maintenant que j'ai UBUNTO j'ai le meme probleme qui est le suivant.
J'ai deux cartes reseaux dans la machine où tourne UBUNTO. Les deux cartes sont de marque REALTECK. L'une ETH0 avec une adresse IP dynamic et l'autre ETH1 avec une adresse IP statique pour mon reseau interne. Pour pouvoir me connecter sur internet je dois desactiver la carte ETH1 et pour pouvoir fair un ping sur ma carte reseau ETH1 d'un autre PC de mon reseau je dois desactiver ETH0. Les deux simultanemant ne me permer ni de faire un ping et de me connecter sur internet.
Merci pour une solution enventuelle.
Avec Linux pas de problèmes. Depuis que j'ai installé FEDORA j'ai eu un probleme de configuration Reseau. Maintenant que j'ai UBUNTO j'ai le meme probleme qui est le suivant.
J'ai deux cartes reseaux dans la machine où tourne UBUNTO. Les deux cartes sont de marque REALTECK. L'une ETH0 avec une adresse IP dynamic et l'autre ETH1 avec une adresse IP statique pour mon reseau interne. Pour pouvoir me connecter sur internet je dois desactiver la carte ETH1 et pour pouvoir fair un ping sur ma carte reseau ETH1 d'un autre PC de mon reseau je dois desactiver ETH0. Les deux simultanemant ne me permer ni de faire un ping et de me connecter sur internet.
Merci pour une solution enventuelle.
Configuration: K7S5A, 1000 Mhz, 256 memoire, UBUNTO 6.06
35 réponses
Résumé de la discussion
Le problème central concerne une machine Ubuntu avec deux cartes réseau Realtek, eth0 en DHCP et eth1 en IP statique, où l’accès à Internet nécessite de désactiver l’une et l’autre carte pour les pings. Plusieurs répondants préconisent de configurer un pare-feu (iptables, shorewall) et de le faire démarrer au démarrage, afin de maîtriser les flux entre eth0 et eth1 et prévenir les accès non souhaités. D’autre part, certains échanges suggèrent de vérifier la configuration des interfaces réseau et les routes par défaut, notamment en s’assurant qu’un seul routeur ou passerelle est utilisé pour l’accès Internet.
-
ModérateurDésolée pour windows cf le forum windows ou google, mais au feeling je dirais
- default plutôt que defaut. Pour plus d'infos :route /help
- tu peux a priori tout configurer directement via le panneau de configuration (connexions réseau)
Bonne chance -
Bonjour,
Je vais essayer de mettre en place le pont mais la commande pour mettre une route par defaut ne marche pas sous windows chez moi :(
C'est pas route ADD defaut MASK 255.255.255.0 192.168.10.1 ?
Merci pour ton aide -
ModérateurBen il faut faire ce que je t'ai dit, un pont réseau avec brctl au niveau de ton portable. Tu relies le portable et le fixe avec un cable ethernet croisé.
Au niveau du fixe : Tu configures de manière statique ta carte réseau, et tu mets route par défaut l'ip de la carte ethernet de ton portable.
Au niveau du portable : tu configures le wifi et tu construis un pont avec brctl entre ton interface ethernet et wifi.
https://linux.die.net/man/8/brctl
Bonne chance -
Bonjour,
Je ne suis pas sur le réseau de mon voisin, je capte un réseau Wifi de mon école dans ma résidence. L'acces à ce réseau est tout ce qu'il y a de plus légal. Je cherche juste à partager cette connexion vers mon fixe.
Merci -
ModérateurLe problème c'est que si tu te connectes sur le wifi de ton voisin à son insu tu comprendras décemment que je ne peux pas te répondre :/ brctl, câble croisé, j'en ai trop dit...
Bonne chance -
Justement je ne peux pas ;)
Je capte ce réseau wifi sur lequel je peux me connecter. Cependant, je n'ai pas de récepteur wifi sur mon fixe. Je n'en ai que sur mon portable.
La seule solution est donc de me connecter grace au portable et de partager la connexion par rj45 jusqu'au fixe...
J'espère que vous pourrez m'aider.
Merci encore,
Pirquessa -
ModérateurHum mais si c'est ton réseau wifi pourquoi ne pas simplement brancher directement ton fixe en ethernet ou en USB sur le routeur ? En plus ça t'éviterait de devoir allumer ton portable si tu veux te connecter au Net avec ton fixe.
Bonne chance -
Bonjour,
J'ai le meme type de problème. Je capte un réseau wifi sur mon portable sous ubuntu et j'aimerais partager cette connexion à mon portable. Schéma de ce que je voudrait obtenir :WEB | | Wifi | PORTABLE | 192.168.10.1 | RJ 45 | 192.168.10.2 FIXE
Je ne sais pas trop comment réaliser la connexion entre mon fixe et mon portable en parallèle de la connexion wifi du portable. Une fois cette connexion configuré, il faudrait ajouter un pont pour partager la connexion du portable au fixe.
Merci à vous :)
Pirquessa -
ModérateurRe,
il faut lire avec plus d'attention.
Dans mon message 30 après la création de fichier j'ai continué avec
chmod -v 0755 /home/gerard/fw_gerard.sh
étape que tu as sautée
Ca ne marche pas puisqu'il n'y a pas des droits d'exécutions sur ton script
-rw-r--r-- 1 root root 1099 2006-08-13 19:39 /etc/init.d/firewall_sh
Fait chmod -v 0755 /etc/init.d/firewall_sh et ensuite tu veras que la commande
ls -l /etc/init.d/firewall_sh va afficher-rwxr-xr-x 1 root root 1099 2006-08-13 19:39 /etc/init.d/firewall_sh
lami20j-
bonjour,
ca fonctionne maintenant mais figures toi que je l'avais fait mais au redemarrage je pensais qu'il s'etait planté et j'ai réinstallé ubunto alors hier j'ai laissé faire et ça fonctionne maintenant.
Lorsque je modifi le fichier firewall dois je chaque fois rebooter la machine pour qu'il le prenne en consideration ou y a t il une fonction à lancer?
Existe t il un anti-virus?
merci -
Modérateur@gerard2656Salut,
Lorsque je modifi le fichier firewall dois je chaque fois rebooter la machine pour qu'il le prenne en consideration ou y a t il une fonction à lancer?
Si tu modifies le fichier (le script) tu n'as qu'à l'exécuter à la main en tant que root.sudo /etc/init.d/firewall_sh
Existe t il un anti-virus?
clamav
lami20j -
@lami20jsalut,
Le firewall se met bien en route mais plus rien ne passe.
Dis moi dans 'iptables -A INPUT -i eth0 -d xxx.xxx.xxx.xxx -m state --state ESTABLISHED,RELATED -j ACCEPT' je dois remplacer les 'X' par l'adresse IP de mon belkin? si c'est le cas ça ne fonctionne pas. Pour info ETH0 est bien la carte reliée au net (a mon belikn quoi).
GRRRRRRRRRR, je crois que je vais finir par laissé tomber.
-
-
ModérateurDans ta commande find je vois
/etc/init.d/firewall_sh
donc faitcat /etc/init.d/firewall_sh
et aussils -l /etc/init.d/firewall_sh
lami20j-
cat /etc/init.d/firewall_sh
#! /bin/sh
#
# Description: configuration de firewall netfilter/iptables
#
# Initialization de la table FILTER
#
iptables -F
iptables -X
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP # les 3 cmd = debranchement des cables
# Initialization de la table NAT
#
iptables -t nat -F
iptables -t nat -X
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
#
# Initialisation de la table MANGLE
#
iptables -t mangle -F
iptables -t mangle -X
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P INPUT ACCEPT
iptables -t mangle -P OUTPUT ACCEPT
iptables -t mangle -P FORWARD ACCEPT
iptables -t mangle -P POSTROUTING ACCEPT
# interface lo
# iptables -A INPUT -i lo -s '0.0.0.0/0' -d '0.0.0.0/0' -j ACCEPT
# iptables -A OUTPUT -o lo -s '0.0.0.0/0' -d '0.0.0.0/0' -j ACCEPT
# table FILTER
# iptables -A INPUT -i eth0 -d xxx.xxx.xxx.xxx -m state --state ESTABLISHED,RELATED -j ACCEPT
# iptables -A OUTPUT -o eth0 -m state --state ! INVALID -j ACCEPT
ls -l /etc/init.d/firewall_sh
-rw-r--r-- 1 root root 1099 2006-08-13 19:39 /etc/init.d/firewall_sh
Les '#" sont fait expres pour l'instant pour voir si il se connecte sans parametres qui pourraient l'empecher
-
-
comprend pas alors. Il est pourtant bien present. Entre le nom du fichier et l'extention c'est un '_" ou un '.'?
Pour l'executer c'est bein #! /bin/sh ? -
ModérateurC'est
firewall.sh ou firewall_sh
?cat /etc/init.d/firewall_sh
lami20j -
ModérateurSalut,
il a disparu....
Ben, non. C'est plutôt toi qui l'a supprimé ou deplacé.
Mais pourquoi le mettre dans /etc/init.d/ ?
Mets le quelque part dans /home/utilisateur/script par exemple.
lami20j
P.S. Peut être c'est bien qu'on est arrivé là.
Comme ça tu as compris commentcamarche ;) -
ModérateurRe,
affiche cat /etc/init.d/firewall.sh
lami20j -
find / -name 'firewall_sh'
find: /var/lock/lvm: Permission non accordée
find: /var/run/sudo: Permission non accordée
find: /var/run/cups/certs: Permission non accordée
find: /var/cache/setup-tool-backends/debug: Permission non accordée
find: /var/cache/setup-tool-backends/backup: Permission non accordée
find: /var/lib/gdm: Permission non accordée
find: /var/lib/slocate: Permission non accordée
find: /var/spool/cron/atjobs: Permission non accordée
find: /var/spool/cron/atspool: Permission non accordée
find: /var/spool/cron/crontabs: Permission non accordée
find: /var/spool/cups: Permission non accordée
/etc/init.d/firewall_sh
find: /etc/ssl/private: Permission non accordée
find: /proc/tty/driver: Permission non accordée
find: /proc/1/task/1/fd: Permission non accordée
find: /proc/1/fd: Permission non accordée
find: /proc/2/task/2/fd: Permission non accordée
find: /proc/2/fd: Permission non accordée
find: /proc/3/task/3/fd: Permission non accordée
find: /proc/3/fd: Permission non accordée
find: /proc/4/task/4/fd: Permission non accordée
find: /proc/4/fd: Permission non accordée
find: /proc/5/task/5/fd: Permission non accordée
find: /proc/5/fd: Permission non accordée
find: /proc/6/task/6/fd: Permission non accordée
find: /proc/6/fd: Permission non accordée
find: /proc/8/task/8/fd: Permission non accordée
find: /proc/8/fd: Permission non accordée
find: /proc/9/task/9/fd: Permission non accordée
find: /proc/9/fd: Permission non accordée
find: /proc/109/task/109/fd: Permission non accordée
find: /proc/109/fd: Permission non accordée
find: /proc/110/task/110/fd: Permission non accordée
find: /proc/110/fd: Permission non accordée
find: /proc/112/task/112/fd: Permission non accordée
find: /proc/112/fd: Permission non accordée
find: /proc/111/task/111/fd: Permission non accordée
find: /proc/111/fd: Permission non accordée
find: /proc/699/task/699/fd: Permission non accordée
find: /proc/699/fd: Permission non accordée
find: /proc/1788/task/1788/fd: Permission non accordée
find: /proc/1788/fd: Permission non accordée
find: /proc/1824/task/1824/fd: Permission non accordée
find: /proc/1824/fd: Permission non accordée
find: /proc/1900/task/1900/fd: Permission non accordée
find: /proc/1900/fd: Permission non accordée
find: /proc/2127/task/2127/fd: Permission non accordée
find: /proc/2127/fd: Permission non accordée
find: /proc/2913/task/2913/fd: Permission non accordée
find: /proc/2913/fd: Permission non accordée
find: /proc/3020/task/3020/fd: Permission non accordée
find: /proc/3020/fd: Permission non accordée
find: /proc/3723/task/3723/fd: Permission non accordée
find: /proc/3723/fd: Permission non accordée
find: /proc/3756/task/3756/fd: Permission non accordée
find: /proc/3756/fd: Permission non accordée
find: /proc/3836/task/3836/fd: Permission non accordée
find: /proc/3836/fd: Permission non accordée
find: /proc/3862/task/3862/fd: Permission non accordée
find: /proc/3862/fd: Permission non accordée
find: /proc/3864/task/3864/fd: Permission non accordée
find: /proc/3864/fd: Permission non accordée
find: /proc/4187/task/4187/fd: Permission non accordée
find: /proc/4187/fd: Permission non accordée
find: /proc/4203/task/4203/fd: Permission non accordée
find: /proc/4203/fd: Permission non accordée
find: /proc/4221/task/4221/fd: Permission non accordée
find: /proc/4221/fd: Permission non accordée
find: /proc/4230/task/4230/fd: Permission non accordée
find: /proc/4230/task/4244/fd: Permission non accordée
find: /proc/4230/fd: Permission non accordée
find: /proc/4234/task/4234/fd: Permission non accordée
find: /proc/4234/fd: Permission non accordée
find: /proc/4281/task/4281/fd: Permission non accordée
find: /proc/4281/fd: Permission non accordée
find: /proc/4304/task/4304/fd: Permission non accordée
find: /proc/4304/fd: Permission non accordée
find: /proc/4319/task/4319/fd: Permission non accordée
find: /proc/4319/fd: Permission non accordée
find: /proc/4320/task/4320/fd: Permission non accordée
find: /proc/4320/fd: Permission non accordée
find: /proc/4325/task/4325/fd: Permission non accordée
find: /proc/4325/fd: Permission non accordée
find: /proc/4381/task/4381/fd: Permission non accordée
find: /proc/4381/fd: Permission non accordée
find: /proc/4392/task/4392/fd: Permission non accordée
find: /proc/4392/fd: Permission non accordée
find: /proc/4393/task/4393/fd: Permission non accordée
find: /proc/4393/fd: Permission non accordée
find: /proc/4471/task/4471/fd: Permission non accordée
find: /proc/4471/fd: Permission non accordée
find: /proc/4476/task/4476/fd: Permission non accordée
find: /proc/4476/fd: Permission non accordée
find: /proc/4486/task/4486/fd: Permission non accordée
find: /proc/4486/fd: Permission non accordée
find: /proc/4499/task/4499/fd: Permission non accordée
find: /proc/4499/fd: Permission non accordée
find: /proc/4533/task/4533/fd: Permission non accordée
find: /proc/4533/fd: Permission non accordée
find: /proc/4546/task/4546/fd: Permission non accordée
find: /proc/4546/fd: Permission non accordée
find: /proc/4623/task/4623/fd: Permission non accordée
find: /proc/4623/fd: Permission non accordée
find: /proc/4624/task/4624/fd: Permission non accordée
find: /proc/4624/fd: Permission non accordée
find: /proc/4625/task/4625/fd: Permission non accordée
find: /proc/4625/fd: Permission non accordée
find: /proc/4626/task/4626/fd: Permission non accordée
find: /proc/4626/fd: Permission non accordée
find: /proc/4627/task/4627/fd: Permission non accordée
find: /proc/4627/fd: Permission non accordée
find: /proc/4628/task/4628/fd: Permission non accordée
find: /proc/4628/fd: Permission non accordée
find: /proc/4681/task/4681/fd: Permission non accordée
find: /proc/4681/fd: Permission non accordée
find: /proc/4771/task/4771/fd: Permission non accordée
find: /proc/4771/fd: Permission non accordée
find: /proc/4792/task/4792/fd: Permission non accordée
find: /proc/4792/fd: Permission non accordée
find: /root/.gnome2: Permission non accordée
find: /root/.gnome2_private: Permission non accordée
find: /root/.gconf: Permission non accordée
find: /root/.gconfd: Permission non accordée -
ModérateurRe,
affiche aussifind / -name 'firewall_sh'
lami20j -
ls -l /etc/init.d/rc.local
-rwxr-xr-x 1 root root 546 2006-08-13 18:32 /etc/init.d/rc.local
find /etc/rc* -name '*rc.local'
/etc/rc2.d/S99rc.local
/etc/rc3.d/S99rc.local
/etc/rc4.d/S99rc.local
/etc/rc5.d/S99rc.local
/etc/rc.local
cat /etc/init.d/rc.local
#! /bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions
do_start() {
if [ -x /etc/rc.local ]; then
log_begin_msg "Running local boot scripts (/etc/rc.local)"
/etc/rc.local
log_end_msg $?
fi
}
case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
/etc/init.d/firewall_sh -
Salut,
C'est vrai que je t'avais dis que je ne t'ennuirais plus, mais j'ai oublié une question à te poser tout à l'heure (sourire....). Mon firewall ne se lance pas au démarrage, c'est ça le probleme. SNIFFFF -
ModérateurRe,
essaie de respecter les étapes que je t'ai écrit dans ubuntu reseau#30
aussi de compredre la structure de ma config.
ensuite tu n'as qu'à adapter.
Bien sûr je ne t'ai pas donné la configuration complète de mon netfilter mais t'as le minimum pour pouvoir te connecter et être protegé (c'est une configuration minimale pour un client net)
lami20j -
ModérateurSalut,
je veux surtout pas t'ennuyer
Ca c'est faux ;)
comment voir si mon firewall fonctionne?
la commande iptables -v -L -n t'affiche ce que ton firewall filtre
mon portable ne parvient pas à ce connecter sur le net via ubuntu et pourta,t j'ai rajoué ' echo 1 > /proc/sys/net/ipv4/ip_forward
comme je t'ai dit dans mes messages précedentes si tu veux te connecter sur net via un pc (ton cas ubuntu) alors Il faut configurer pour ça le forwarding, la chaîne FORWARD de la table Filter et la table NAT
lami20j
Voilà mon cas.web | freebox | routeur Netgear:10.0.0.254 | debian (passerelle défaut: 10.0.0.254) DNS1:212.27.32.xxx DNS2:212.27.32.yyy | | eth0:10.0.0.2/24 (wan) eth1:192.168.1.1/24 (LAN) | WinXP | Lan:192.168.1.2 (passerelle défaut: 10.0.0.254) DNS1:212.27.32.xxx DNS2:212.27.32.yyy
Et voilà mon firewall (donc win va sur net via debian) - à adapter dans ton cas#! /bin/sh # # Description: configuration de firewall netfilter/iptables # # Initialization de la table FILTER # iptables -F iptables -X iptables -P INPUT DROP iptables -P OUTPUT DROP iptables -P FORWARD DROP # les 3 cmd presque la debranchement des cables # Initialization de la table NAT # iptables -t nat -F iptables -t nat -X iptables -t nat -P PREROUTING ACCEPT iptables -t nat -P POSTROUTING ACCEPT iptables -t nat -P OUTPUT ACCEPT # # Initialisation de la table MANGLE # iptables -t mangle -F iptables -t mangle -X iptables -t mangle -P PREROUTING ACCEPT iptables -t mangle -P INPUT ACCEPT iptables -t mangle -P OUTPUT ACCEPT iptables -t mangle -P FORWARD ACCEPT iptables -t mangle -P POSTROUTING ACCEPT # interface lo iptables -A INPUT -i lo -s '0.0.0.0/0' -d '0.0.0.0/0' -j ACCEPT iptables -A OUTPUT -o lo -s '0.0.0.0/0' -d '0.0.0.0/0' -j ACCEPT # table FILTER # chaine INPUT iptables -A INPUT -i eth0 -d 10.0.0.2 -m state --state ESTABLISHED,RELATED -j ACCEPT # chaine FORWARD iptables -A FORWARD -i eth0 -o eth1 -s 0.0.0.0/0 -d 192.168.1.2 -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i eth1 -o eth0 -s 192.168.1.2 -d 10.0.0.0/0 -m state --state ! INVALID -j ACCEPT # chaine OUTPUT iptables -A OUTPUT -o eth0 -m state --state ! INVALID -j ACCEPT iptables -A OUTPUT -o eth1 -m state --state ! INVALID -j ACCEPT # table NAT iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.2 -j SNAT --to-source 10.0.0.2
Pour ne pas être obligé de récrire ça
echo 1 > /proc/sys/net/ipv4/ip_forward tu as 2 posibilités :
- écrire cette ligne dans /etc/init.d/rc.local
- ajouter dans le fichier /etc/sysctl.conf la lignenet.ipv4.ip_forward=1
lami20j-
Voilà ce que àa me donne losque je fais iptables -v -L -n
Chain INPUT (policy ACCEPT 646 packets, 428K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 603 packets, 68981 bytes)
pkts bytes target prot opt in out source destination
Je regarderais dans les differents sites que tu m'as donné.
Merci encore
Gerard -
Modérateur@gerard2656Salut,
quand tu vois ça alors sache que ton firewall n'est pas configurer correctement (au moins d'après le script que je t'ai donné)
Voilà chez moi
table filterChain INPUT (policy DROP 8 packets, 1224 bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 4301 380K ACCEPT all -- eth0 * 0.0.0.0/0 10.0.0.2 state RELATED,ESTABLISHED Chain FORWARD (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 32266 36M ACCEPT all -- eth0 eth1 0.0.0.0/0 192.168.1.2 state RELATED,ESTABLISHED 25534 2256K ACCEPT all -- eth1 eth0 192.168.1.2 0.0.0.0/0 state NEW,RELATED,ESTABLISHED,UNTRACKED Chain OUTPUT (policy DROP 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 34 2944 ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0 8189 11M ACCEPT all -- * eth0 0.0.0.0/0 0.0.0.0/0 state NEW,RELATED,ESTABLISHED,UNTRACKED 196K 9151K ACCEPT all -- * eth1 0.0.0.0/0 0.0.0.0/0 state NEW,RELATED,ESTABLISHED,UNTRACKED
table nat
avec la commande iptables -t nat -v -L -nChain PREROUTING (policy ACCEPT 1944 packets, 102K bytes) pkts bytes target prot opt in out source destination 0 0 DNAT all -- eth1 * 10.0.0.1 0.0.0.0/0 to:192.168.1.2 Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 1701 82524 SNAT all -- * eth0 192.168.1.2 0.0.0.0/0 to:10.0.0.2 Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination
lami20j
P.S. Tu remarques la politique DROP dans la table FILTER?
-
- 1
- 2
Suivant