Cannot access outside LAN [message #40877] |
Tue, 19 October 2010 10:27 |
ExoCranial
Messages: 1 Registered: October 2010
|
Junior Member |
|
|
I don't know much about networking, sorry. But I find it better to post here than search for a solution for several months. Yes, my knowledge is that bad. Maybe someone can help with a simple fix?
My laptop is connected to a router (via a switch) and its IP is given by DHCP. The host OS is Debian Lenny with the kernel 2.6.32-5-openvz-amd64.
What I want to start with is to get access outside my virtual LAN. For example, at this moment I am not able to ping google from my VM. I can ping my network cards, but I cannot ping the router (with IP 192.168.1.1) from the VM. Since I use a laptop, I prefer to have my IP given by DHCP to host eth0. I guess my problem has some name server issues.
Iptables are currently uninstalled. I'll configure it later.
My sysctl.conf is following:
Quote: | net.ipv4.conf.all.rp_filter=1
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.ip_forward=1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.eth0.proxy_arp=1
|
host interface:
Quote: | mikael@T4220:~$ more /etc/network/interfaces
# network interface settings
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
mikael@T4220:~$
|
and then when I run ifconfig in the host I get following:
Quote: | T4220:/home/mikael# ifconfig
eth0 Link encap:Ethernet HWaddr 00:17:XX:XX:XX:XX
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::217:42ff:fe92:35d8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:120786 errors:0 dropped:0 overruns:0 frame:0
TX packets:72857 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:172324851 (164.3 MiB) TX bytes:4611498 (4.3 MiB)
Interrupt:16
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2171 errors:0 dropped:0 overruns:0 frame:0
TX packets:2171 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1596341 (1.5 MiB) TX bytes:1596341 (1.5 MiB)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
T4220:/home/mikael#
|
the same things inside my VM gives following:
Quote: | root@router:/# more /etc/network/interfaces
# This configuration file is auto-generated.
# WARNING: Do not edit this file, your changes will be lost.
# Please create/edit /etc/network/interfaces.head and /etc/network/interfaces.ta
il instead,
# their contents will be inserted at the beginning and at the end
# of this file, respectively.
#
# NOTE: it is NOT guaranteed that the contents of /etc/network/interfaces.tail
# will be at the very end of this file.
# Auto generated lo interface
auto lo
iface lo inet loopback
# Auto generated venet0 interface
auto venet0
iface venet0 inet static
address 127.0.0.1
netmask 255.255.255.255
broadcast 0.0.0.0
up route add -net 192.0.2.1 netmask 255.255.255.255 dev venet0
auto venet0:0
iface venet0:0 inet static
address 192.168.77.101
netmask 255.255.255.255
broadcast 0.0.0.0
gateway 192.0.2.1
root@router:/# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1056 (1.0 KiB) TX bytes:1056 (1.0 KiB)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:192.168.77.101 P-t-P:192.168.77.101 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
root@router:/#
|
In /etc/vz/vz.conf I got NEIGHBOUR_DEVS=all.
So what else do I need to configure to access internet from my VM?
Thank you!
|
|
|