Network settings - differnet address range for containers [message #42161] |
Fri, 11 March 2011 19:17 |
naro
Messages: 4 Registered: March 2011
|
Junior Member |
|
|
Hello,
I'm trying to set up public IP for my container. HN has address XXX.71.138.11 (eth0). Container should get address from range:
YYY.132.159.194 - 222 (gateway is set up by ISP to YYY.132.159.193 and is sending packets to my HW node).
I tried to set YYY.132.159.200 to HN as eth0:0 and it works fine, it means, ISP routing is fine.
There are no iptables rules.
I've assigned YYY.132.159.194 to container and now I need to set up routing on hardware node. I checked Source based routing wiki, added the rule, but
/sbin/ip route add default dev eth0 via YYY.132.159.193 table 10
failed with RTNETLINK: No such file or directory. This is caused by missing YYY.132.159.193 route in the main table probably, but I don't know how to set it up.
HN# ip route list
YYY.132.159.194 dev venet0 scope link
XXX.71.138.0/27 dev eth0 proto kernel scope link src XXX.71.138.11
default via XXX.71.138.1 dev eth0
HN has assigned XXX.71.138.11 on eth0 only. No other public address.
How should I setup routing on HN to correctly pass packets from YYY.132.159.194-222 to YYY.132.159.193 via eth0 ?
Thanks
Edit:
forgot to mention sysctl settings:
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
I have tried to assign 192.168.200.101 to container and configured iptables postrouting on HN and it works fine, but I'm still not able to get public address work.
[Updated on: Sat, 12 March 2011 17:27] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Network settings - differnet address range for containers [message #43235 is a reply to message #43232] |
Wed, 10 August 2011 11:00 |
pilpelet
Messages: 25 Registered: October 2006
|
Junior Member |
|
|
Hi naro,
Thanks for the script, i was wondering how did you solve the routing issue? im having the same issue and the max i could achive is pinging from the container out but not from the world in.
I did that by adding
iptables -t nat -A POSTROUTING -d 62.90.150.0/26 -j MASQUERADE -o eth0
on NH
where 62.90.150.0/26 is the subnet that doesnt configured on the NH eth0.
I still not fully understand the routing procedure special the default gateway/route on the NH specialy when its not possible to add default gayway on container working with venet.
maybee the ARP table on NH will solve the issue(it does make sense) i havnt tested it yet.
|
|
|