# \[HELP\] Firewall NAT rules on host1 replaced by host2

**URL:** <https://forums.suse.com/t/help-firewall-nat-rules-on-host1-replaced-by-host2/6090>\
**Category:** Rancher 1.x\
**Created:** [April 7, 2017, 10:51am UTC](https://forums.suse.com/t/help-firewall-nat-rules-on-host1-replaced-by-host2/6090 "2017-04-07T10:51:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsilva4](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rsilva4/32/1438_2.png) [@rsilva4](https://forums.suse.com/u/rsilva4)\
**Post date:** [April 7, 2017, 10:51am UTC](https://forums.suse.com/t/help-firewall-nat-rules-on-host1-replaced-by-host2/6090/1 "2017-04-07T10:51:26Z")

</div>

I have two hosts, both with:

- Docker: 17.03.0-ce
- Kernel Version: 3.19.0-80-generic
- Operating System: Ubuntu 14.04.5 LTS

Also:

- Rancher v1.5.2

First I add _host1_ to a new Rancher Cattle environment, added some stacks with some exposed ports, resulting in a bunch of NAT rules consistent with the ports displayed on the Ports tab in the _host1_ page in the UI. So far so good.

When I add the _host2_ to the environment and add some stack with its own ports **host1 NAT rules are replaced by the rules that belongs to \_host2** \_. _Host2_ table also correctly holds its own rules. 😨 No need to say that _host1_ services no longer are accesible. When I stop _host2_ docker daemon the _host1_ rules return to the right ones. I **tried even restarting the _host2_ server**.

Also **tried restart network-services and scheduler on the Infrastructures stack**

I really don’t have much more information and I can’t mess around too much with these servers since they hold critical services. I manage another four Rancher environments and I never had this issue before.

Any help will be appreciated on trying to pinpoint the cause of this strange behavior.

---

<div class="post-metadata">

**Author:** ![leodotcloud](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/leodotcloud/32/3103_2.png) [@leodotcloud](https://forums.suse.com/u/leodotcloud)\
**Post date:** [April 9, 2017, 6:08am UTC](https://forums.suse.com/t/help-firewall-nat-rules-on-host1-replaced-by-host2/6090/2 "2017-04-09T06:08:29Z")

</div>

@rsilva4 Can you please share more details? Rancher programs various rules depending on services and ports published by them. Do the two stacks have the same ports?

`iptables-save` command output from all the hosts would be very useful.

---

<div class="post-metadata">

**Author:** ![rsilva4](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rsilva4/32/1438_2.png) [@rsilva4](https://forums.suse.com/u/rsilva4)\
**Post date:** [April 10, 2017, 9:55am UTC](https://forums.suse.com/t/help-firewall-nat-rules-on-host1-replaced-by-host2/6090/3 "2017-04-10T09:55:22Z")

</div>

I will try to provide more details. My last try was just adding the second host to the environment no stacks or services associated with it. The result was an immediate change on the NAT rules on the first host and since there were no services on host2 all the rules basically disappear. I can share my current iptables ([https://transfer.sh/xPLt9/host1\_iptables](https://transfer.sh/xPLt9/host1_iptables)) for host1 right now but for host2 I can’t do it right now I will try to make some tests after service hours.

I will also try to collect logs from rancher agent and server, do you suggest collecting anything else during my tests?

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [April 10, 2017, 2:41pm UTC](https://forums.suse.com/t/help-firewall-nat-rules-on-host1-replaced-by-host2/6090/4 "2017-04-10T14:41:04Z")

</div>

How were the hosts created? Is there a VM template or similar involved? (i.e. do they both have the same Rancher uuid on disk because one is a copy of the other)

---

<div class="post-metadata">

**Author:** ![rsilva4](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rsilva4/32/1438_2.png) [@rsilva4](https://forums.suse.com/u/rsilva4)\
**Post date:** [April 10, 2017, 2:59pm UTC](https://forums.suse.com/t/help-firewall-nat-rules-on-host1-replaced-by-host2/6090/5 "2017-04-10T14:59:29Z")

</div>

Hosts are bare metal, I can’t be sure how the original OS installation was made (servers are years old) but i’m pretty confident that they were installed from a Ubuntu ISO.

Both hosts are under Puppet configuration management and share common configs but I don’t find anything relevant to this problem.

How can I check for the same Rancher uuid on disk?

---

<div class="post-metadata">

**Author:** ![rsilva4](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rsilva4/32/1438_2.png) [@rsilva4](https://forums.suse.com/u/rsilva4)\
**Post date:** [April 10, 2017, 10:14pm UTC](https://forums.suse.com/t/help-firewall-nat-rules-on-host1-replaced-by-host2/6090/6 "2017-04-10T22:14:36Z")

</div>

So I test against this issue again with the steps described bellow:

- Exported IP tables from both hosts before adding host2 to rancher.
- Docker is already running in host2 just need to add Rancher Agent.
- Added Rancher Agent. Node shows up on UI.
- Exported IP tables again.
- Also collected logs for:
  - Rancher Agent
  - Syslog (docker daemon)

@vincent @leodotcloud I’m more confortable in sharing those via PM. Sending now.

---

<div class="post-metadata">

**Author:** ![rsilva4](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rsilva4/32/1438_2.png) [@rsilva4](https://forums.suse.com/u/rsilva4)\
**Post date:** [April 13, 2017, 2:24pm UTC](https://forums.suse.com/t/help-firewall-nat-rules-on-host1-replaced-by-host2/6090/7 "2017-04-13T14:24:28Z")

</div>

Can you point me to the code that affects the host Iptables? I was looking around rancher and cattle repos but I can’t find anything…

---

<div class="post-metadata">

**Author:** ![leodotcloud](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/leodotcloud/32/3103_2.png) [@leodotcloud](https://forums.suse.com/u/leodotcloud)\
**Post date:** [April 18, 2017, 5:37pm UTC](https://forums.suse.com/t/help-firewall-nat-rules-on-host1-replaced-by-host2/6090/8 "2017-04-18T17:37:14Z")

</div>

As mentioned in the private chat @rsilva4 your iptables custom rules are dropping the traffic before they hit the `CATTLE_FORWARD` chain.
