OpenVZ Forum


Home » Mailing lists » Users » Using NAT for VE with private IPs
Using NAT for VE with private IPs [message #10653] Sun, 25 February 2007 20:14 Go to next message
lloyd is currently offline  lloyd
Messages: 3
Registered: February 2007
Junior Member
Hi,

I'm closing in on my first successful install of a VE on openVZ but,
having trouble with network configuration.

My hardware NODE is behind a firewall connected to a dsl modem. DNSmasq
on the firewall supplies a static IP to the hardware NODE. Let's call
it <hardwareNODE>.

Following the instructions in:

http://wiki.openvz.org/Using_NAT_for_VE_with_private_IPs

...I issued the following command to the hardware NODE:

iptables -t nat -A POSTROUTING -s 172.16.0.0/255/255/255/0 -o eth0 -j
SNAT --to <hardwareNODE>

Then I entered:

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to <hardwareNODE>

Finally, since my system didn't hve the file /etc/modprobe.conf, I
issued the following at the commandline:

modprobe ip_conntrack ip_conntrack_enable_ve0=1

Then I rebooted, entered a VE and tested by issuing:

apt-get update.

The system failed resolve the addresses in sources.list.

I double checked that I had entered:

vzctl set 777 --ipadd 172.16.0.1 --save

...which I had.

Any ideas, please, of what I'm doing wrong, or need to do to
diagnose and solve the problem?


Many thanks,

Lloyd R. Prentice
Re: Using NAT for VE with private IPs [message #10655 is a reply to message #10653] Mon, 26 February 2007 06:44 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Lloyd R. Prentice wrote:
> Hi,
>
> I'm closing in on my first successful install of a VE on openVZ but,
> having trouble with network configuration.
>
> My hardware NODE is behind a firewall connected to a dsl modem.
> DNSmasq on the firewall supplies a static IP to the hardware NODE.
> Let's call it <hardwareNODE>.
>
> Following the instructions in:
>
> http://wiki.openvz.org/Using_NAT_for_VE_with_private_IPs
>
> ...I issued the following command to the hardware NODE:
>
> iptables -t nat -A POSTROUTING -s 172.16.0.0/255/255/255/0 -o eth0 -j
> SNAT --to <hardwareNODE>
>
> Then I entered:
>
> iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to <hardwareNODE>
>
> Finally, since my system didn't hve the file /etc/modprobe.conf, I
> issued the following at the commandline:
>
> modprobe ip_conntrack ip_conntrack_enable_ve0=1
>
> Then I rebooted
Oops. Why a reboot?

All the iptables commands, and modprobe as well, are not taking effect
after the reboot. In order to make them persistent, you have to put
those in some startup script.
> , entered a VE and tested by issuing:
>
> apt-get update.
>
> The system failed resolve the addresses in sources.list.
>
> I double checked that I had entered:
>
> vzctl set 777 --ipadd 172.16.0.1 --save
>
> ...which I had.
>
> Any ideas, please, of what I'm doing wrong, or need to do to diagnose
> and solve the problem?
>
>
> Many thanks,
>
> Lloyd R. Prentice
>
>
>
>
Re: Using NAT for VE with private IPs [message #10658 is a reply to message #10655] Mon, 26 February 2007 09:55 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Kir Kolyshkin wrote:
> Lloyd R. Prentice wrote:
>> Then I rebooted
> Oops. Why a reboot?
>
> All the iptables commands, and modprobe as well, are not taking effect
> after the reboot. In order to make them persistent, you have to put
> those in some startup script.
To be more precise, all distribution I know use /etc/sysconfig/iptables
file to make rules persistent. After setting up your rules via
`iptables` command you should do `iptables-save >
/etc/sysconfig/iptables`, and at a boot time init script will
automagically use your rules.

HTH,
Vasily.
Re: Using NAT for VE with private IPs [message #10682 is a reply to message #10658] Mon, 26 February 2007 15:09 Go to previous messageGo to next message
lloyd is currently offline  lloyd
Messages: 3
Registered: February 2007
Junior Member
Thanks all.

I'll give it a shot.

Best wishes,

LRP


-----Original Message-----
From: "Vasily Tarasov" <vtaras@openvz.org>
Sent: Mon, February 26, 2007 4:55 am
To: users@openvz.org
Subject: Re: [Users] Using NAT for VE with private IPs

Kir Kolyshkin wrote:
> Lloyd R. Prentice wrote:
>> Then I rebooted
> Oops. Why a reboot?
>
> All the iptables commands, and modprobe as well, are not taking effect
> after the reboot. In order to make them persistent, you have to put
> those in some startup script.
To be more precise, all distribution I know use /etc/sysconfig/iptables
file to make rules persistent. After setting up your rules via
`iptables` command you should do `iptables-save >
/etc/sysconfig/iptables`, and at a boot time init script will
automagically use your rules.

HTH,
Vasily.
Re: Using NAT for VE with private IPs [message #10716 is a reply to message #10658] Mon, 26 February 2007 23:40 Go to previous messageGo to next message
lloyd is currently offline  lloyd
Messages: 3
Registered: February 2007
Junior Member
Hi,

Oops, still no satisfaction.

Unfortunately I'm off the Mexico in a few hours so won't have time
double-check my work until after I return on March 13.

Kir noted that I shouldn't have rebooted...

I think I was thrown off by the language in openVZ wiki -- Using NAT for
VE with private IPs. "... Also remember that if this module is loaded
without the option, unloading and reloading doesn't work! You need to
reboot the computer."

It's clearer to me now, I think. But it was ambiguous at the time.

Many thanks for your help. I hope I can get this going shortly after my
return.

All the best,

LRP


-----Original Message-----
From: "Vasily Tarasov" <vtaras@openvz.org>
Sent: Mon, February 26, 2007 4:55 am
To: users@openvz.org
Subject: Re: [Users] Using NAT for VE with private IPs

Kir Kolyshkin wrote:
> Lloyd R. Prentice wrote:
>> Then I rebooted
> Oops. Why a reboot?
>
> All the iptables commands, and modprobe as well, are not taking effect
> after the reboot. In order to make them persistent, you have to put
> those in some startup script.
To be more precise, all distribution I know use /etc/sysconfig/iptables
file to make rules persistent. After setting up your rules via
`iptables` command you should do `iptables-save >
/etc/sysconfig/iptables`, and at a boot time init script will
automagically use your rules.

HTH,
Vasily.
memory problem [message #12163 is a reply to message #10653] Wed, 18 April 2007 12:05 Go to previous messageGo to next message
Soldatov Dmitry is currently offline  Soldatov Dmitry
Messages: 8
Registered: October 2006
Junior Member
[root@rh0 dv]# vzmemcheck -v
Output values in %
veid LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc
util commit util util commit util commit limit
1028 0.09 25.92 0.74 0.46 7.50 2.42 7.50 13.83
1001 0.37 46.25 1.85 1.14 12.49 3.43 12.49 18.83
------------------------------------------------------------ -------------
Summary: 0.45 72.16 2.60 1.59 19.99 5.86 19.99 32.66
[root@rh0 dv]# vzctl enter 1001
entered into VE 1001
-bash: pipe error: Cannot allocate memory
-bash-3.1#

inside VPS (logged in before memory problems):
[700353@h0001 700353]$ top
bash: start_pipeline: pgrp pipe: Cannot allocate memory
bash: top: command not found
[700353@h0001 ~]$ ps auxw
/proc/self/stat: Cannot allocate memory

inside host:
[root@rh0 vz]# cat ./vestat
Version: 2.2
VEID user nice system uptime idle strv uptime used maxlat totlat numsched
1001 50392 343 14125 7922942 94838940488033 0 23766049873942
203406018536 0 0 0
1028 8900 0 18286 201038265 2411830220100997 0 603043235696062
301978099005 0 0 0
[root@rh0 vz]# cat ./vzquota
qid: path usage softlimit hardlimit time expire
1028: /vz/private/1028
1k-blocks 4869664 21474836480 21474836480 0 259200
inodes 52147 442799 487079 0 259200
1001: /vz/private/1001
1k-blocks 1670104 21474836480 21474836480 0 259200
inodes 81303 442799 487079 0 259200

[root@rh0 proc]# cat ./user_beancounters_sub
Version: 2.5
uid resource held maxheld barrier limit failcnt

...
1001: kmemsize 5644891 16417987 744488960 754974720 0
lockedpages 0 5 410 410 0
privvmpages 54706 123048 111270 122397 597042
shmpages 658 4018 11127 11127 0
dummy 0 0 0 0 0
numproc 50 181 204 204 0
physpages 17150 69819 0 9223372036854775807 0
vmguarpages 0 0 18545 9223372036854775807 0
oomguarpages 17150 69819 18545 9223372036854775807 0
numtcpsock 7 68 204 204 0
numflock 5 20 326 358 0
numpty 2 7 20 20 0
numsiginfo 0 34 1024 1024 0
tcpsndbuf 79696 757112 1963491 2799075 0
tcprcvbuf 114688 578712 1963491 2799075 0
othersockbuf 170872 507168 981745 1817329 0
dgramrcvbuf 0 16976 981745 981745 0
numothersock 121 204 204 204 93
dcachesize 1820178 1871195 1825304 1880064 680879
numfile 1246 3176 3264 3264 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 10 10 40 40 0

what is the problem?
i've created this VPS # 1001 with
vzctl set 1001 --kmemsize 750M --save

do i have to increase "dcachesize" value manually?

--
Солдатов Дмитрий
Ведущий специалист НИОКР
ОАО "ТелеNet"
Тел.: +7(4822)456784
E-mail: dvorkin@tvcom.ru
Re: memory problem [message #12164 is a reply to message #12163] Wed, 18 April 2007 12:26 Go to previous message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

Dvorkin Dmitry wrote:
> [root@rh0 dv]# vzmemcheck -v
> Output values in %
> veid LowMem LowMem RAM MemSwap MemSwap Alloc Alloc Alloc
> util commit util util commit util commit limit
> 1028 0.09 25.92 0.74 0.46 7.50 2.42 7.50 13.83
> 1001 0.37 46.25 1.85 1.14 12.49 3.43 12.49 18.83
> ------------------------------------------------------------ -------------
> Summary: 0.45 72.16 2.60 1.59 19.99 5.86 19.99 32.66
> [root@rh0 dv]# vzctl enter 1001
> entered into VE 1001
> -bash: pipe error: Cannot allocate memory
> -bash-3.1#
>
> inside VPS (logged in before memory problems):
> [700353@h0001 700353]$ top
> bash: start_pipeline: pgrp pipe: Cannot allocate memory
> bash: top: command not found
> [700353@h0001 ~]$ ps auxw
> /proc/self/stat: Cannot allocate memory
>
> inside host:
> [root@rh0 vz]# cat ./vestat
> Version: 2.2
> VEID user nice system uptime idle strv uptime used maxlat totlat numsched
> 1001 50392 343 14125 7922942 94838940488033 0 23766049873942
> 203406018536 0 0 0
> 1028 8900 0 18286 201038265 2411830220100997 0 603043235696062
> 301978099005 0 0 0
> [root@rh0 vz]# cat ./vzquota
> qid: path usage softlimit hardlimit time expire
> 1028: /vz/private/1028
> 1k-blocks 4869664 21474836480 21474836480 0 259200
> inodes 52147 442799 487079 0 259200
> 1001: /vz/private/1001
> 1k-blocks 1670104 21474836480 21474836480 0 259200
> inodes 81303 442799 487079 0 259200
>
> [root@rh0 proc]# cat ./user_beancounters_sub
> Version: 2.5
> uid resource held maxheld barrier limit failcnt
>
> ...
> 1001: kmemsize 5644891 16417987 744488960 754974720 0
> lockedpages 0 5 410 410 0
> privvmpages 54706 123048 111270 122397 597042
> shmpages 658 4018 11127 11127 0
> dummy 0 0 0 0 0
> numproc 50 181 204 204 0
> physpages 17150 69819 0 9223372036854775807 0
> vmguarpages 0 0 18545 9223372036854775807 0
> oomguarpages 17150 69819 18545 9223372036854775807 0
> numtcpsock 7 68 204 204 0
> numflock 5 20 326 358 0
> numpty 2 7 20 20 0
> numsiginfo 0 34 1024 1024 0
> tcpsndbuf 79696 757112 1963491 2799075 0
> tcprcvbuf 114688 578712 1963491 2799075 0
> othersockbuf 170872 507168 981745 1817329 0
> dgramrcvbuf 0 16976 981745 981745 0
> numothersock 121 204 204 204 93
> dcachesize 1820178 1871195 1825304 1880064 680879
> numfile 1246 3176 3264 3264 0
> dummy 0 0 0 0 0
> dummy 0 0 0 0 0
> dummy 0 0 0 0 0
> numiptent 10 10 40 40 0
>
> what is the problem?
> i've created this VPS # 1001 with
> vzctl set 1001 --kmemsize 750M --save
>
> do i have to increase "dcachesize" value manually?
sure, you have changed kmemsize limit only.
dcachesize limit is too tight and should be increased.

Thanks,
Kirill
Previous Topic: Asterisk
Next Topic: creating partition for VE and networking
Goto Forum:
  


Current Time: Thu Jul 18 13:27:17 GMT 2024

Total time taken to generate the page: 0.02607 seconds