Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st July 2006, 14:50
geek.de.nz geek.de.nz is offline
Member
 
Join Date: Feb 2006
Posts: 65
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to geek.de.nz Send a message via MSN to geek.de.nz
Angry Routing question virtual machines

Hi, I've searched this forum extensively but didn't find an answer to my question(s):

My setup:
router/adsl modem is on ip 10.0.0.11/8 (has dns server)
My main linux box (ubuntu 5.10 with 2.6.16-suspend2 kernel) is on ip 10.0.0.4 called lexo
My vmware vm (under main box):
debian etch on ip 192.168.0.2

I've added a virtual ip for 10.0.0.4 of 192.168.0.1 by doing the follwing:
Code:
ifconfig eth0:0 192.168.0.1 netmask 255.255.255.0 up
Output of:
Code:
etch:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:6F:B6:A3
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe6f:b6a3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:37996 errors:0 dropped:0 overruns:0 frame:0
          TX packets:295 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7476327 (7.1 MiB)  TX bytes:24318 (23.7 KiB)
          Interrupt:177 Base address:0x1400
 ...
etch:~# route -nee
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    MSS   Window irtt
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0     0     0      0
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0     0     0      0

root@lexo:~# cat /etc/sysctl.conf
#
# /etc/sysctl.conf - Configuration file for setting system variables
# See sysctl.conf (5) for information.
#
# Be warned that /etc/init.d/procps is executed to set the following
# variables.  However, after that, /etc/init.d/networking sets some
# network options with builtin values.  These values may be overridden
# using /etc/network/options.

#kernel.domainname = example.com
#net/ipv4/icmp_echo_ignore_broadcasts=1
dev.cdrom.lock=0
# Enables packet forwarding
net.ipv4.ip_forward=1

root@lexo:~# sysctl -p

root@lexo:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:05:1C:01:7C:85
          inet addr:10.0.0.4  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8624 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7796 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3390769 (3.2 MiB)  TX bytes:1260345 (1.2 MiB)
          Interrupt:11 Base address:0xb800

eth0:0    Link encap:Ethernet  HWaddr 00:05:1C:01:7C:85
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:11 Base address:0xb800
  ...
root@lexo:~# route -nee
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface    MSS   Window irtt
172.16.231.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet1   0     0      0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0     0     0      0
172.16.120.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8   0     0      0
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth0     0     0      0
0.0.0.0         10.0.0.11       0.0.0.0         UG    0      0        0 eth0     0     0      0
OK. But routing seems to not work properly:
Code:
etch:~# ping -c 3 10.0.0.11
PING 10.0.0.11 (10.0.0.11) 56(84) bytes of data.
From 192.168.0.1: icmp_seq=1 Redirect Host(New nexthop: 10.0.0.11)
From 192.168.0.1: icmp_seq=4 Redirect Host(New nexthop: 10.0.0.11)
From 192.168.0.1: icmp_seq=10 Redirect Host(New nexthop: 10.0.0.11)

--- 10.0.0.11 ping statistics ---
28 packets transmitted, 0 received, 100% packet loss, time 27004ms
and when I do:
Code:
etch:~# ping -c 1 google.com
ping: unknown host google.com
But dns is working on the (real) router/adsl modem and I can ping google.com from lexo.

I just want to understand how routing works in unix. Am I on the right track? Is this problem maybe because I'm using everything virtually (virtual ip vmware vms etc.)? It should still work shouldn't it? What is wrong? I thought this would be the simplest setup, but it turns out to be not working. If you need any more outputs, please tell me so. Thanks in advance :-).

Or is it not working because eth0 on lexo is shared and has the same MAC address??

Does anyone know what the vmnet settings (routing table) are for and why they are in a different subnet? Is that maybe the problem? Can I just delete them or are they important? How is it in Xen?
__________________
Always mention at least your distribution/version! You can add it in your signature if you don't want to always type it. ;-)

Distributions:
Ubuntu 5.10 with custom kernel (2.6.16-suspend2),
Debian Sarge 3.1 and Etch

Please submit your ISP or Webhost to (free)
http://www.ihostnz.com
Reply With Quote
Sponsored Links
  #2  
Old 2nd July 2006, 18:13
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,735 Times in 2,571 Posts
Default

Usually VMware does everything for you to configure bridging and/or NATting...

You might want to have a look here to see how it works with Xen:
http://www.howtoforge.com/perfect_setup_xen3_debian_p6
http://www.howtoforge.com/perfect_xe...bian_ubuntu_p6
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forwarding Question For Virtual Users And Domains With Postfix, Courier And MySQL (+ mrjjman HOWTO-Related Questions 3 6th April 2006 11:23
Firewall question for Virtual Users/domains using postfix/courier/MySQL toastmaster HOWTO-Related Questions 1 25th January 2006 07:04
Static Routing Question alienbob Server Operation 1 24th January 2006 17:49
postfix config jmroth Installation/Configuration 6 18th September 2005 15:58
DNS in virtual machines todvard Installation/Configuration 2 15th August 2005 19:43


All times are GMT +2. The time now is 20:32.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.