OpenVZ Forum


Home » General » Support » set alternative router for VE through dhcp
set alternative router for VE through dhcp [message #35274] Fri, 13 March 2009 21:34 Go to previous message
eisenhorn is currently offline  eisenhorn
Messages: 4
Registered: March 2009
Junior Member
I have ubuntu (8.10 with kernel from 8.04 supporting openv) box (HN) with 2 NIC: eth0 - ISP1, eth1 - LAN (192.168.7.1).
It acts as simple NAT (iptables -A POSTROUTING -s 192.168.7.0/24 -j MASQUERADE), so ip_forward is enabled.
On eth1 I created bridge (br0) to let VE see the network.
Also this box acts as DHCP-server.

On the other hand I have adsl-modem configured as router (192.168.7.3, ISP2). I'm trying to pass all traffic from some machines through ISP2. It is easily done by specifying "option routers 192.168.7.3;" in dhcpd.conf per machine. And it works fine with physical boxes, but not with VE (192.168.7.6).

In VE I'm trying to add default route, but it has no effect - no packets are going through router:
root@gretchin:/# ping ya.ru
PING ya.ru (213.180.204.8) 56(84) bytes of data.

--- ya.ru ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2007ms

root@gretchin:/# traceroute ya.ru
traceroute to ya.ru (213.180.204.8), 30 hops max, 40 byte packets
 1  192.168.7.3 (192.168.7.3)  2.059 ms  2.693 ms  2.997 ms
 2  * * *


I'm sure that it isn't router's issue, cause doing such on HN helps:
ip rule add from 192.168.7.6 table 6
ip route add default dev br0 via 192.168.7.3 table 6


But why it isn't running without adding routing rules on HN?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PTY allocation request failed
Next Topic: communicating between virtual machines
Goto Forum:
  


Current Time: Mon Nov 18 22:54:57 GMT 2024

Total time taken to generate the page: 0.02893 seconds