# NAT/MASQ just plain won't work.

## dixtow

Posting this from links, SSHed into my would-be router...

I'm at my wit's end here.  I'm using the same old scripts and documentation that I've always used to set up a router box (gentoo home router howto).  Not like I've never done this before.  I'm not even sure where to start in asking for help.  I've set up router boxes at least 30 times.

NAT/MASQ just doesn't work, even though I'm doing nothing wrong.  I've gone nuts recompiling every known router related option in the kernel.

dnsmasq is working great tho.  ping requests display the translated ip, but no traffic...  I've tried even the most basic rule sets, nothing works.

I know it's not a hardware issue, as I am using a client machine to ssh into the LAN side of the router, and then using links to post this very message.  All communication is working, dnsmasq is working, but the damn thing just plain refuses to NAT/MASQUERADE.  I think it hates me...

Someone post a .config from a 2.6.23-gentoo-r9  kernel?  Maybe I'm missing something that menuconfig is not showing me?

----------

## cyrillic

Did you remember this part ?

 */etc/sysctl.conf wrote:*   

> net.ipv4.ip_forward = 1 

 

----------

## dixtow

Yup, I simply can't find anything wrong at all.  I'm starting to think there's a bug in the kernel. Is anyone successfully using 2.6.23-gentoo-r9 to NAT/Masquerade?

I'm "this close" to just giving up on computers altogether.  It's just plain impossible.

----------

## Dagger

can you please post:

```

sudo iptables -L -n

cat /proc/sys/net/ipv4/ip_forward

```

----------

## cyrillic

My router is running fine with 2.6.24.2 (vanilla), but I was using a 2.6.23.x kernel previously, without any problem.

----------

## Hu

Never use iptables -L -n to diagnose a problem.  It omits too much important information.  Use iptables-save -c.  This will produce a human readable dump of the exact state of your firewall.

----------

## theholymac

cyrillic, did you ever solve your problem?  I'm having the same maddening issue.  

I have a Gentoo router that was working *perfectly*.  I shut it down to install a serial card, and when I booted it back up, MASQ was broken.  DNS queries work fine, the computers on the LAN "see" the internet, but no packets get through.  I've triple checked every single config file I can think of, looked through recent installs/upgrades (the only network-related emerge since the previous reboot was dhcpcd-5.2.7), and looked through every "gentoo home router guide" google can find for me.  I've even gone back and removed the serial card I installed, on the of chance that it magically breaks something.

Everything is as it should be, but it still fails to work.

I am at my wits end.

EDIT: This is going to sound really stupid, but...  Apparently it was the dhcpcd upgrade's fault?  After beating my head against this issue for upwards of 24 hours, I went and downgraded dhcpcd (I was going to one-by-one downgrade/install/uninstall my way to the configuration it was in at the last "working" boot) and, well, it works again.  I notice that 5.2.7 is also no longer in the stable tree?  I have no idea how the dhcp client could have broken my network, but apparently it did...

----------

