<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/20 Ola Lundqvist <span dir="ltr">&lt;<a href="mailto:ola@inguza.com" target="_blank">ola@inguza.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Could be so. I do not know the answer. <a href="mailto:users@openvz.org">users@openvz.org</a><br>
or the forum may know.<br></blockquote><div><br></div><div><a href="mailto:users@openvz.org">users@openvz.org</a> is already copied here.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
However if you have two interfaces I actually think your<br>
messages go through the venet interface. I may be wrong<br>
however.<br></blockquote><div><br></div><div>I&#39;ve tested through lo device in VE without any additional veth devices or venet IP addresses.<br><br></div><div>But I guess lo is going through venet0 as well in VE?<br> <br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I mean to 202 192.168.203.* is in another network and<br>
would be routed to the venet if. And the other way around.<br>
As you have ip_forwarding enabled it would then route it<br>
to the other network.<br>
<br>
Network isolation on the same machine can be tricky.<br>
<br>
In any case, you may find better answers on the forum.<br>
<br>
Also you probabably need to use wireshark or tcpdump to<br>
find out what actually happens. :-)<br></blockquote><div><br></div><div>Thanks for the tip.<br><br></div><div>Actually its bit weird what I&#39;m getting through lo device:<br><br># ip r<br>default dev lo  scope link <br>
<br># ping 1.2.3.4<br>PING 1.2.3.4 (1.2.3.4) 56(84) bytes of data.<br>64 bytes from <a href="http://1.2.3.4">1.2.3.4</a>: icmp_req=1 ttl=64 time=0.036 ms<br>64 bytes from <a href="http://1.2.3.4">1.2.3.4</a>: icmp_req=2 ttl=64 time=0.027 ms<br>
^C<br>--- 1.2.3.4 ping statistics ---<br>2 packets transmitted, 2 received, 0% packet loss, time 999ms<br>rtt min/avg/max/mdev = 0.027/0.031/0.036/0.007 ms<br><br># ping 3.3.3.3<br>PING 3.3.3.3 (3.3.3.3) 56(84) bytes of data.<br>
64 bytes from <a href="http://3.3.3.3">3.3.3.3</a>: icmp_req=1 ttl=64 time=0.037 ms<br>^C<br>--- 3.3.3.3 ping statistics ---<br>1 packets transmitted, 1 received, 0% packet loss, time 0ms<br>rtt min/avg/max/mdev = 0.037/0.037/0.037/0.000 ms<br>
<br></div><div>It means if I ping _ANY_ IP through lo device it gives me answer back? why?<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
// Ola<br>
<div class="im"><br>
On Tue, Aug 20, 2013 at 01:23:29AM +0400, spameden wrote:<br>
&gt;    The problem here is actually much wider..<br>
&gt;    I can access any of the venet0 assigned IP address from the container<br>
&gt;    via lo interface.<br>
&gt;    E.g. if I have another container with an IP address of 1.2.3.4 I can<br>
&gt;    access it through lo interface from this container.<br>
&gt;<br>
</div>&gt;    2013/8/20 spameden &lt;[1]<a href="mailto:spameden@gmail.com">spameden@gmail.com</a>&gt;<br>
&gt;<br>
&gt;    2013/8/20 Ola Lundqvist &lt;[2]<a href="mailto:ola@inguza.com">ola@inguza.com</a>&gt;<br>
<div class="im">&gt;<br>
&gt;      Hi<br>
&gt;      It all depends on how you have done things. There are a few things<br>
&gt;      that is not fully clear that you should probably add in a forum<br>
&gt;      question.<br>
&gt;      You mention that you use both venet and veth devices. It<br>
&gt;      is not clear what you use in this situation.<br>
&gt;      (To my knowledge only veth makes sense to use with vzbr).<br>
&gt;<br>
&gt;    Yes, I&#39;m using both devices.<br>
&gt;    I&#39;ve added veth device to the vzbr201 device with private IP address,<br>
&gt;    e.g. 192.168.201.2.<br>
&gt;    venet0 is used for public internet address, e.g. 1.2.3.4<br>
&gt;<br>
&gt;      It is also not clear how you add veth to the bridge.<br>
&gt;<br>
&gt;    I&#39;m adding it via /etc/vz/vznet.conf:<br>
&gt;    #!/bin/bash<br>
&gt;    EXTERNAL_SCRIPT=&quot;/usr/sbin/vznetaddbr&quot;<br>
&gt;<br>
&gt;      I guess you have read this article:<br>
</div>&gt;      [3]<a href="http://openvz.org/Virtual_Ethernet_device" target="_blank">http://openvz.org/Virtual_Ethernet_device</a><br>
<div class="im">&gt;<br>
&gt;    Did already.<br>
&gt;<br>
&gt;      Also it may be so that even though you have added them to<br>
&gt;      different bridges, then the bridges may be connected to something<br>
&gt;      common. It is not clear from the text below.<br>
&gt;<br>
&gt;    How bridges can be connected to the same thing if they are different?<br>
&gt;<br>
&gt;      Hope this helps for your forum question.<br>
&gt;      Cheers,<br>
&gt;      // Ola<br>
&gt;<br>
&gt;    On Tue, Aug 20, 2013 at 12:53:23AM +0400, spameden wrote:<br>
&gt;    &gt;    Yes, I have forwarding turned on.<br>
&gt;    &gt;    # sysctl -a 2&gt;/dev/null|grep ip_forward<br>
&gt;    &gt;    net.ipv4.ip_forward = 1<br>
&gt;    &gt;    Surely, I can try to ban this via iptables, but it&#39;s so much<br>
&gt;    hassle to<br>
&gt;    &gt;    ban each time.<br>
&gt;    &gt;    I thought it should &quot;work out out of the box&quot;..<br>
&gt;    &gt;    Anyways, thanks for your point, I will try to post this on forums.<br>
&gt;    &gt;<br>
&gt;<br>
</div>&gt;      &gt;    2013/8/20 Ola Lundqvist &lt;[1][4]<a href="mailto:opal@debian.org">opal@debian.org</a>&gt;<br>
<div class="im">&gt;<br>
&gt;    &gt;<br>
&gt;    &gt;      Hi<br>
&gt;    &gt;      This kind of question belong more on the openvz forum<br>
&gt;<br>
</div>&gt;      &gt;      [2][5]<a href="http://forum.openvz.org/" target="_blank">http://forum.openvz.org/</a>.<br>
<div><div class="h5">&gt;<br>
&gt;    &gt;      Please ask there.<br>
&gt;    &gt;      However I think it is not worwarded through &quot;lo&quot;, instead I<br>
&gt;    guess<br>
&gt;    &gt;      you<br>
&gt;    &gt;      have IP forwarding turned on in the kernel and as the kernel<br>
&gt;    gets<br>
&gt;    &gt;      aware<br>
&gt;    &gt;      of those datagrams it will forward it to the correct place. To<br>
&gt;    &gt;      prevent<br>
&gt;    &gt;      that I guess you have to add some firewalling rules (see<br>
&gt;    iptables).<br>
&gt;    &gt;      But again, this better belong on the forum, and I may be totally<br>
&gt;    &gt;      wrong.<br>
&gt;    &gt;      Cheers,<br>
&gt;    &gt;      // Ola<br>
&gt;    &gt;<br>
&gt;    &gt;    On Tue, Aug 20, 2013 at 12:04:42AM +0400, spameden wrote:<br>
&gt;    &gt;    &gt;    Hi, list.<br>
&gt;    &gt;    &gt;    I&#39;m sorry for copying 2 lists, but I really want to know what<br>
&gt;    I&#39;m<br>
&gt;    &gt;    doing<br>
&gt;    &gt;    &gt;    wrong.<br>
&gt;    &gt;    &gt;    I&#39;m using Debian 6 Squeeze and OpenVZ CentOS kernel<br>
&gt;    (converted<br>
&gt;    &gt;    from rpm<br>
&gt;    &gt;    &gt;    to deb).<br>
&gt;    &gt;    &gt;    I&#39;m using veth as well as venet devices for networking.<br>
&gt;    &gt;    &gt;    To isolate multiple containers from each other I&#39;m using<br>
&gt;    vzbrXXX<br>
&gt;    &gt;    &gt;    devices on debian like this:<br>
&gt;    &gt;    &gt;    auto vzbr203<br>
&gt;    &gt;    &gt;    iface vzbr203 inet static<br>
&gt;    &gt;    &gt;            address 192.168.203.1<br>
&gt;    &gt;    &gt;            netmask       255.255.255.0<br>
&gt;    &gt;    &gt;            broadcast       192.168.203.255<br>
&gt;    &gt;    &gt;            bridge_ports none<br>
&gt;    &gt;    &gt;            bridge_fd 0<br>
&gt;    &gt;    &gt;            bridge_maxwait 0<br>
&gt;    &gt;    &gt;    auto vzbr202<br>
&gt;    &gt;    &gt;    iface vzbr202 inet static<br>
&gt;    &gt;    &gt;            address 192.168.202.1<br>
&gt;    &gt;    &gt;            netmask       255.255.255.0<br>
&gt;    &gt;    &gt;            broadcast       192.168.202.255<br>
&gt;    &gt;    &gt;            bridge_ports none<br>
&gt;    &gt;    &gt;            bridge_fd 0<br>
&gt;    &gt;    &gt;            bridge_maxwait 0<br>
&gt;    &gt;    &gt;    The problem I&#39;m facing that in VE (for example with CTID 202)<br>
&gt;    I<br>
&gt;    &gt;    can<br>
&gt;    &gt;    &gt;    ping or query 192.168.203.1 which is on HN of course, but I<br>
&gt;    &gt;    thought it<br>
&gt;    &gt;    &gt;    shouldn&#39;t be reachable.<br>
&gt;    &gt;    &gt;    Here is route table and ifconfig on CTID 202:<br>
&gt;    &gt;    &gt;    # ip r<br>
&gt;    &gt;    &gt;    default dev lo  scope link<br>
&gt;    &gt;    &gt;    # ifconfig -a<br>
&gt;    &gt;    &gt;    lo        Link encap:Local Loopback<br>
&gt;    &gt;    &gt;              inet addr:127.0.0.1  Mask:255.0.0.0<br>
&gt;    &gt;    &gt;              inet6 addr: ::1/128 Scope:Host<br>
&gt;    &gt;    &gt;              UP LOOPBACK RUNNING  MTU:16436  Metric:1<br>
&gt;    &gt;    &gt;              RX packets:84021 errors:0 dropped:0 overruns:0<br>
&gt;    frame:0<br>
&gt;    &gt;    &gt;              TX packets:84021 errors:0 dropped:0 overruns:0<br>
&gt;    carrier:0<br>
&gt;    &gt;    &gt;              collisions:0 txqueuelen:0<br>
&gt;    &gt;    &gt;              RX bytes:5045068 (4.8 MiB)  TX bytes:5045068 (4.8<br>
&gt;    MiB)<br>
&gt;    &gt;    &gt;    venet0    Link encap:UNSPEC  HWaddr<br>
&gt;    &gt;    &gt;    00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00<br>
&gt;    &gt;    &gt;              BROADCAST POINTOPOINT NOARP  MTU:1500  Metric:1<br>
&gt;    &gt;    &gt;              RX packets:0 errors:0 dropped:0 overruns:0 frame:0<br>
&gt;    &gt;    &gt;              TX packets:0 errors:0 dropped:0 overruns:0<br>
&gt;    carrier:0<br>
&gt;    &gt;    &gt;              collisions:0 txqueuelen:0<br>
&gt;    &gt;    &gt;              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)<br>
&gt;    &gt;    &gt;    So I guess it&#39;s going through lo device? Why and how can I<br>
&gt;    block<br>
&gt;    &gt;    this?<br>
&gt;    &gt;    &gt;    Many thanks.<br>
&gt;    &gt;<br>
&gt;    &gt;      &gt; _______________________________________________<br>
&gt;    &gt;      &gt; Debian mailing list<br>
&gt;<br>
</div></div>&gt;      &gt;      &gt; [3][6]<a href="mailto:Debian@openvz.org">Debian@openvz.org</a><br>
&gt;      &gt;      &gt; [4][7]<a href="https://lists.openvz.org/mailman/listinfo/debian" target="_blank">https://lists.openvz.org/mailman/listinfo/debian</a><br>
<div class="im">&gt;<br>
&gt;    &gt;      --<br>
&gt;    &gt;       --------------------- Ola Lundqvist ---------------------------<br>
&gt;<br>
</div>&gt;      &gt;      /  [5][8]<a href="mailto:opal@debian.org">opal@debian.org</a>                     Annebergsslingan<br>
&gt;      37      \<br>
&gt;      &gt;      |  [6][9]<a href="mailto:ola@inguza.com">ola@inguza.com</a>                      654 65 KARLSTAD<br>
&gt;               |<br>
&gt;      &gt;      |  [7][10]<a href="http://inguza.com/" target="_blank">http://inguza.com/</a>                  +46 (0)70-332<br>
<div class="im">&gt;      1551       |<br>
&gt;<br>
&gt;    &gt;      \  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9<br>
&gt;    /<br>
&gt;    &gt;       ---------------------------------------------------------------<br>
&gt;    &gt;<br>
&gt;<br>
&gt;      &gt; Referenser<br>
&gt;      &gt;<br>
</div>&gt;      &gt;    1. mailto:[11]<a href="mailto:opal@debian.org">opal@debian.org</a><br>
&gt;      &gt;    2. [12]<a href="http://forum.openvz.org/" target="_blank">http://forum.openvz.org/</a><br>
&gt;      &gt;    3. mailto:[13]<a href="mailto:Debian@openvz.org">Debian@openvz.org</a><br>
&gt;      &gt;    4. [14]<a href="https://lists.openvz.org/mailman/listinfo/debian" target="_blank">https://lists.openvz.org/mailman/listinfo/debian</a><br>
&gt;      &gt;    5. mailto:[15]<a href="mailto:opal@debian.org">opal@debian.org</a><br>
&gt;      &gt;    6. mailto:[16]<a href="mailto:ola@inguza.com">ola@inguza.com</a><br>
&gt;      &gt;    7. [17]<a href="http://inguza.com/" target="_blank">http://inguza.com/</a><br>
<div class="im">&gt;      --<br>
&gt;       --- Inguza Technology AB --- MSc in Information Technology ----<br>
</div>&gt;      /  [18]<a href="mailto:ola@inguza.com">ola@inguza.com</a>                    Annebergsslingan 37<br>
&gt;      \<br>
&gt;      |  [19]<a href="mailto:opal@debian.org">opal@debian.org</a>                   654 65 KARLSTAD<br>
&gt;      |<br>
&gt;      |  [20]<a href="http://inguza.com/" target="_blank">http://inguza.com/</a>                Mobile: +46 (0)70-332 1551<br>
<div class="im">&gt;      |<br>
&gt;<br>
&gt;    \  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /<br>
&gt;     ---------------------------------------------------------------<br>
&gt;<br>
</div>&gt; Referenser<br>
&gt;<br>
&gt;    1. mailto:<a href="mailto:spameden@gmail.com">spameden@gmail.com</a><br>
&gt;    2. mailto:<a href="mailto:ola@inguza.com">ola@inguza.com</a><br>
&gt;    3. <a href="http://openvz.org/Virtual_Ethernet_device" target="_blank">http://openvz.org/Virtual_Ethernet_device</a><br>
&gt;    4. mailto:<a href="mailto:opal@debian.org">opal@debian.org</a><br>
&gt;    5. <a href="http://forum.openvz.org/" target="_blank">http://forum.openvz.org/</a><br>
&gt;    6. mailto:<a href="mailto:Debian@openvz.org">Debian@openvz.org</a><br>
&gt;    7. <a href="https://lists.openvz.org/mailman/listinfo/debian" target="_blank">https://lists.openvz.org/mailman/listinfo/debian</a><br>
&gt;    8. mailto:<a href="mailto:opal@debian.org">opal@debian.org</a><br>
&gt;    9. mailto:<a href="mailto:ola@inguza.com">ola@inguza.com</a><br>
&gt;   10. <a href="http://inguza.com/" target="_blank">http://inguza.com/</a><br>
&gt;   11. mailto:<a href="mailto:opal@debian.org">opal@debian.org</a><br>
&gt;   12. <a href="http://forum.openvz.org/" target="_blank">http://forum.openvz.org/</a><br>
&gt;   13. mailto:<a href="mailto:Debian@openvz.org">Debian@openvz.org</a><br>
&gt;   14. <a href="https://lists.openvz.org/mailman/listinfo/debian" target="_blank">https://lists.openvz.org/mailman/listinfo/debian</a><br>
&gt;   15. mailto:<a href="mailto:opal@debian.org">opal@debian.org</a><br>
&gt;   16. mailto:<a href="mailto:ola@inguza.com">ola@inguza.com</a><br>
&gt;   17. <a href="http://inguza.com/" target="_blank">http://inguza.com/</a><br>
&gt;   18. mailto:<a href="mailto:ola@inguza.com">ola@inguza.com</a><br>
&gt;   19. mailto:<a href="mailto:opal@debian.org">opal@debian.org</a><br>
&gt;   20. <a href="http://inguza.com/" target="_blank">http://inguza.com/</a><br>
<div class=""><div class="h5"><br>
--<br>
 --- Inguza Technology AB --- MSc in Information Technology ----<br>
/  <a href="mailto:ola@inguza.com">ola@inguza.com</a>                    Annebergsslingan 37        \<br>
|  <a href="mailto:opal@debian.org">opal@debian.org</a>                   654 65 KARLSTAD            |<br>
|  <a href="http://inguza.com/" target="_blank">http://inguza.com/</a>                Mobile: +46 (0)70-332 1551 |<br>
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /<br>
 ---------------------------------------------------------------<br>
</div></div></blockquote></div><br></div></div>