OpenVZ Forum


Home » General » Support » how to let container forward ip packets (sysctl -p give error)
how to let container forward ip packets [message #42141] Sun, 06 March 2011 03:19
openvzcnsha is currently offline  openvzcnsha
Messages: 3
Registered: January 2011
Junior Member
Hello

I've setup two interfaces in my container, eth0 and eth1.

the ip address of eth0 is 192.168.1.8/24
the ip address of eth1 is 172.16.0.3/24

when i ping 172.16.0.3 from my web server 192.168.1.4, I found the ping is failed.

Then I turned on the tcpdump on interface eth1 and I saw that:

06:17:27.373507 IP 192.168.1.4 > 172.16.0.3: ICMP echo request, id 11023, seq 1134, length 64
06:17:28.373521 IP 192.168.1.4 > 172.16.0.3: ICMP echo request, id 11023, seq 1135, length 64
06:17:29.373524 IP 192.168.1.4 > 172.16.0.3: ICMP echo request, id 11023, seq 1136, length 64
06:17:30.373530 IP 192.168.1.4 > 172.16.0.3: ICMP echo request, id 11023, seq 1137, length 64

there is only echo in but no echo reply.

So, I think the problem is that the icmp packet reached my container buy it doesn't know how to forward it.

the route table in my container is:
root@r02:/# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.1.2 0.0.0.0 UG 100 0 0 eth0
0.0.0.0 172.16.0.1 0.0.0.0 UG 100 0 0 eth1

When I try to use sysctl -p command to see my sysctl configuraton, it says:

root@r02:/# sysctl -p
error: permission denied on key 'kernel.printk'
error: permission denied on key 'kernel.maps_protect'
error: permission denied on key 'fs.inotify.max_user_watches'
error: "vm.mmap_min_addr" is an unknown key
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.proxy_arp = 1
net.ipv4.ip_forward = 1
net.ipv4.conf.all.rp_filter = 1
error: permission denied on key 'kernel.sysrq'
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0

Is there something need to be done on sysctl regarding on VZ?

Thanks you in advance.
Previous Topic: Compile OpenVZ on slackware (rhel6) error
Next Topic: How to set time in OpenVZ VPS?
Goto Forum:
  


Current Time: Tue Jul 22 05:03:20 GMT 2025

Total time taken to generate the page: 0.11105 seconds