[internet] Partage connexion infructueux (entièrement résolu)

Applications, problèmes de configuration réseau
avi3000
Chu Ko Nu
Messages : 405
Inscription : dim. 19 juin 2011, 18:53
Localisation : dans le neuf trois

[internet] Partage connexion infructueux (entièrement résolu)

Message par avi3000 »

Bonjour,

Suite à un écrasement de ligne je me suis connecté en wifi chez un voisin. Je voudrais partager cette connexion entre mon netbook et le fixe.
Le ping et le ssh fonctionne bien entre les 2 ordis, mais les ping sur google.fr ou sur 216.58.209.163 depuis le client sont sans réponse.
Que dois-je faire, docteur ?

Serveur

Code : Tout sélectionner

scl restart systemd-networkd;scl status systemd-networkd;echo;ip addr
● systemd-networkd.service - Network Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
   Active: active (running) since sam. 2016-08-13 12:42:31 CEST; 10ms ago
     Docs: man:systemd-networkd.service(8)
 Main PID: 1062 (systemd-network)
   Status: "Processing requests..."
    Tasks: 1 (limit: 512)
   CGroup: /system.slice/systemd-networkd.service
           └─1062 /usr/lib/systemd/systemd-networkd
août 13 12:42:31 ux31a systemd-networkd[1062]: wlan0: Gained IPv6LL
août 13 12:42:31 ux31a systemd-networkd[1062]: Enumeration completed
août 13 12:42:31 ux31a systemd-networkd[1062]: eth0: IPv6 enabled for interface: Success
août 13 12:42:31 ux31a systemd-networkd[1062]: wlan0: found matching network '/etc/systemd/network/wlan0.network', based on potentially unpredictable ifname

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether c4:85:08:10:c6:88 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::c685:8ff:fe10:c688/64 scope link 
       valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 9c:eb:e8:07:4e:6c brd ff:ff:ff:ff:ff:ff
    inet 172.16.0.1/16 brd 172.16.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::9eeb:e8ff:fe07:4e6c/64 scope link tentative 
       valid_lft forever preferred_lft forever

ip route show
default via 192.168.0.254 dev wlan0  proto dhcp  src 192.168.0.35  metric 1024 
172.16.0.0/16 dev eth0  proto kernel  scope link  src 172.16.0.1 
192.168.0.0/24 dev wlan0  proto kernel  scope link  src 192.168.0.35 
192.168.0.254 dev wlan0  proto dhcp  scope link  src 192.168.0.35  metric 1024 

sysctl -a|grep forw
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.eth0.forwarding = 1
net.ipv4.conf.eth0.mc_forwarding = 0
net.ipv4.conf.lo.forwarding = 1
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.wlan0.forwarding = 1
net.ipv4.conf.wlan0.mc_forwarding = 0
net.ipv4.ip_forward = 1
net.ipv4.ip_forward_use_pmtu = 0
sysctl: net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.all.mc_forwarding = 0
lecture de la clé « net.ipv6.conf.all.stable_secret »
sysctl: lecture de la clé « net.ipv6.conf.default.stable_secret »
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.default.mc_forwarding = 0
sysctl: lecture de la clé « net.ipv6.conf.eth0.stable_secret »
net.ipv6.conf.eth0.forwarding = 1
net.ipv6.conf.eth0.mc_forwarding = 0
sysctl: lecture de la clé « net.ipv6.conf.lo.stable_secret »net.ipv6.conf.lo.forwarding = 1
net.ipv6.conf.lo.mc_forwarding = 0
sysctl: lecture de la clé « net.ipv6.conf.wlan0.stable_secret »
net.ipv6.conf.wlan0.forwarding = 1
net.ipv6.conf.wlan0.mc_forwarding = 0
Client

Code : Tout sélectionner

scl restart systemd-networkd.service;scl status systemd-networkd.service;echo;ip addr 
● systemd-networkd.service - Network Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
   Active: active (running) since sam. 2016-08-13 13:45:09 CEST; 4ms ago 
     Docs: man:systemd-networkd.service(8)
 Main PID: 1342 (systemd-network)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/systemd-networkd.service
           └─1342 /usr/lib/systemd/systemd-networkd
août 13 13:45:09 asus4570 systemd-networkd[1342]: Enumeration completed
août 13 13:45:09 asus4570 systemd-networkd[1342]: eth0: IPv6 enabled for interface: Success

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether ac:22:0b:c5:68:0b brd ff:ff:ff:ff:ff:ff
    inet 172.16.0.2/16 brd 172.16.255.255 scope global eth0
       valid_lft forever preferred_lft forever

ip route show
default via 172.16.0.1 dev eth0  proto static 
172.16.0.0/16 dev eth0  proto kernel  scope link  src 172.16.0.2    
Dernière modification par avi3000 le sam. 13 août 2016, 19:12, modifié 1 fois.
Je suis sur devuan avec sysvinit et kbwm
Avatar de l’utilisateur
benjarobin
Maître du Kyudo
Messages : 17632
Inscription : sam. 30 mai 2009, 15:48
Localisation : Lyon

Re: [internet] Partage connexion infructueux

Message par benjarobin »

Bonjour,
C'est déjà normal que cela ne fonctionne pas. Il manque la partie NAT coté "serveur" : https://wiki.archlinux.org/index.php/Internet_sharing
Zsh | KDE | PC fixe : AMD Ryzen 9900X, Radeon RX 7700 XT
Titre d'un sujet : [Thème] Sujet (état) / Règles du forum
avi3000
Chu Ko Nu
Messages : 405
Inscription : dim. 19 juin 2011, 18:53
Localisation : dans le neuf trois

Re: [internet] Partage connexion infructueux

Message par avi3000 »

J'avais fait ceci.

Code : Tout sélectionner

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

Code : Tout sélectionner

# Generated by iptables-save v1.6.0 on Sat Aug 13 16:54:43 2016
*filter
:INPUT ACCEPT [9917:5090950]
:FORWARD ACCEPT [525:31230]
:OUTPUT ACCEPT [9008:1151033]
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT
# Completed on Sat Aug 13 16:54:43 2016
# Generated by iptables-save v1.6.0 on Sat Aug 13 16:54:43 2016
*nat
:PREROUTING ACCEPT [2318:240356]
:INPUT ACCEPT [1505:100731]
:OUTPUT ACCEPT [654:39753]
:POSTROUTING ACCEPT [903:54256]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Sat Aug 13 16:54:43 2016
Je suis sur devuan avec sysvinit et kbwm
Avatar de l’utilisateur
benjarobin
Maître du Kyudo
Messages : 17632
Inscription : sam. 30 mai 2009, 15:48
Localisation : Lyon

Re: [internet] Partage connexion infructueux

Message par benjarobin »

Si tu te trompes entre eth0 et wlan0 cela ne marchera pas... Inverse
Zsh | KDE | PC fixe : AMD Ryzen 9900X, Radeon RX 7700 XT
Titre d'un sujet : [Thème] Sujet (état) / Règles du forum
avi3000
Chu Ko Nu
Messages : 405
Inscription : dim. 19 juin 2011, 18:53
Localisation : dans le neuf trois

Re: [internet] Partage connexion infructueux

Message par avi3000 »

c'est là qu'on voit la différence entre ceux qui font du réseau en comprenant et ceux qui n'y comprennent pas grand chose.

posté depuis le fixe.

Merci
Je suis sur devuan avec sysvinit et kbwm
Répondre