Jump to content

Forward port


JamesAdams

Recommended Posts

Hi,

 

i wish nat the port 9000 (used by portainer) on the interface virbr0-lab to br0 but it's don't working...

 

My config:

 

br0: 192.168.1.0/24

virbr0-lab: 

<network>
  <name>virbr0-lab</name>
  <uuid>2741e0bd-4ba1-4ce9-852d-7becc27962e9</uuid>
  <forward mode='nat'>
   <nat>
    <port start='7000' end='10000' />
   </nat>
  </forward>
  <bridge name='virbr0-lab' stp='on' delay='0'/>
  <mac address='52:54:00:09:0f:c1'/>
  <ip address='192.168.0.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.0.2' end='192.168.0.99'/>
    </dhcp>
  </ip>
</network>

 

iptables -A INPUT -i br0 -p tcp --dport 9000 -j ACCEPT

iptables -A INPUT -i virbr0-lab -p tcp --dport 9000 -j ACCEPT

 

iptables -A FORWARD -i br0 -p tcp --dport 9000 -d 192.168.0.100 -j ACCEPT

iptables -A PREROUTING -i br0 -t nat -j DNAT -p tcp --dport 9000 --to-destination 192.168.0.100:9000

 

Thanks for yout help :)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...