I intend to pass Internet from openSUSE Leap 15.1 to CentOS 7:

  • openSUSE Leap 15.1 machine with access to Internet through a wireless router
  • CentOS 7 machine without access to Internet due to lack of proper wireless chip driver

I connect openSUSE machine to CentOS by an Ethernet cable. My understanding is that I should have two different sub-nets:

  • openSUSE
    • Has static IP address of
    • Has DHCP IP address of
      • Access to Internet through
  • CentOS
    • Has static IP address of


  • Inside CentOS I can ping openSUSE
  • Inside CentOS I can ping openSUSE
  • Inside CentOS I can not ping internet router
  • Inside CentOS I can not ping
  • Inside CEntOS I do not have access to Internet

Routing on openSUSE

> ip route
default via dev wlan0 proto dhcp metric 600 dev docker0 proto kernel scope link src linkdown dev wlan0 proto kernel scope link src metric 600 dev eth0 proto kernel scope link src metric 100


I cannot figure out what is wrong with routing. It's strange that from CentOS I can ping openSUSE on both sub-nets, but I cannot ping internet router!

  • 1
    You want openSUSE to act as a router. This requires it to forward traffic that is not destined to itself. Most Linux distros are configured to ignore such traffic. Ensure that IP forwarding is enabled. Use sysctl to enable it permanently. – berndbausch Mar 13 at 3:12
  • @berndbausch When I check with sudo sysctl net.ipv4.ip_forward I'm getting net.ipv4.ip_forward = 1. I think IP forwarding is enabled. – user3405291 Mar 13 at 14:09
  • 1
    Yes it is. A different thought: What's the routing table on Centos? – berndbausch Mar 13 at 14:32
  • @berndbausch CentOS ip route output summary is default via and and src – user3405291 Mar 13 at 14:58
  • 1
    That's the problem. There is no connectivity to the default router. Make the default. I don't understand the rest of your routing table; can't you just add ip route to the question? – berndbausch Mar 13 at 15:03

The problem is that your internet router does not know about the network The openSUSE machine knows that network and therefore answers even when accessed with the other address.

If you have access to the internet router and the address is a fixed DHCP lease, you could add a route at the internet router pointing to via

A probably easier way would be to add masquerading to the wifi interface of the openSUSE machine like in this question at superuser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.