From: Pascal Hambourg <pascal@plouf.fr.eu.org>
To: Vijay Viswanathan <vijay.vishy@gmail.com>
Cc: Netfilter Users Mailing list <netfilter@vger.kernel.org>
Subject: Re: eth - NAT - Bridge - veth
Date: Fri, 27 Jun 2014 19:51:35 +0200 [thread overview]
Message-ID: <53ADAF27.5070505@plouf.fr.eu.org> (raw)
In-Reply-To: <CALPbv1-ur2xyv9MUe4UWR1ZeGZwaqgA40-J-8+H_vC58ie20bw@mail.gmail.com>
Vijay Viswanathan a écrit :
> I cannot use the host network for container/veth IPs, so it looks like
> I need a NAT.
Indeed.
Enable IP forwarding on the host (sysctl net.ipv4.ip_forward=1).
Set default route in the container (seems to be set already).
Set port forwarding (DNAT) on the host to the container.
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 2300 \
-j DNAT --to 192.168.10.2:2300
Optionally, set masquerading (SNAT) on the host for the containers.
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.10.0/24 \
-j MASQUERADE
next prev parent reply other threads:[~2014-06-27 17:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-27 4:51 eth - NAT - Bridge - veth Vijay Viswanathan
2014-06-27 10:44 ` Pascal Hambourg
2014-06-27 15:54 ` Vijay Viswanathan
2014-06-27 17:51 ` Pascal Hambourg [this message]
2014-06-27 18:29 ` Vijay Viswanathan
2014-06-27 19:18 ` Pascal Hambourg
2014-06-27 20:08 ` Vijay Viswanathan
2014-06-27 20:23 ` Vijay Viswanathan
2014-06-27 21:38 ` Pascal Hambourg
2014-06-27 23:09 ` Vijay Viswanathan
2014-06-27 20:39 ` Neal Murphy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53ADAF27.5070505@plouf.fr.eu.org \
--to=pascal@plouf.fr.eu.org \
--cc=netfilter@vger.kernel.org \
--cc=vijay.vishy@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.