LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices



Reply
 
Search this Thread
Old 11-14-2012, 05:41 PM   #1
RootMason
Member
 
Registered: Oct 2012
Location: Tucson, AZ
Distribution: Debian/CentOS
Posts: 123

Rep: Reputation: 5
Setup of a VMware test LAN with Debian Wheezy as DHCP & Forwarder/CENTOS as client


Hello all!

I'm a student of Network Admin and I am having a hell of a time trying to set up a LAN test lab. I'm using VM Workstation9 with VMnet0 bridged to my laptop's wireless and VMnet1 (192.168.23.0) as Host-Only.

The server (Debian Wheezy) is configured with 2 NICs, with eth0 as the bridged connection & eth1 as the host-only connection. The idea is to connect other VM's to this eth1, host-only connection, to allow me to use Debian as a Firewall, DHCP and Forwarder to the internet (eth0) for my host machines.

The client I am using is CentOS, and it is set with one NIC (eth0) connected to VMnet1 (host-only). I have set up isc-dhcp-server to broadcast DCHP to this client and the client is getting an IP address, so I know they have the ability to communicate.

The problem comes when trying to connect CentOS to the internet & I have spent two full days reading man pages, doing & undoing config changes, etc... I just can't seem to figure out how to get Debian to route CentOS's traffic out the bridged interface!

I would post the config changes I have made, but I don't know if anyone would even want to read it if they see it's that long.

Any help would be much appreciated, even if it's just a point in the right direction. Thanks for your time & I'll contact you back ASAP if you are willing to help.

Steve
_________________________________________

That sounds like a BadIdea(tm)
 
Old 11-17-2012, 10:01 AM   #2
hamlindsza
Member
 
Registered: Aug 2012
Distribution: Debian, CentOS
Posts: 74

Rep: Reputation: Disabled
Hi,

On Debian VM:
1. Enable IP Forwarding:
echo 1 > /proc/sys/net/ipv4/ip_forward
2. Add a MASQUERADE Rule:
iptables -t nat -I POSTROUTING -i eth1 -o eth0 -j MASQUERADE
 
Old 11-17-2012, 09:39 PM   #3
RootMason
Member
 
Registered: Oct 2012
Location: Tucson, AZ
Distribution: Debian/CentOS
Posts: 123

Original Poster
Rep: Reputation: 5
Thanks for the response, but unfortunately I already set that. It must be some other config that I messed up, I think it may be the gateway, but I could be wrong. My router has an address of 192.168.1.1, the server eth0 is 192.168.1.48 and eth1 is 192.168.23.1, with all the client devices in the 192.168.23.0 address range. Any ideas on what the gateway for eth0 should be? I think this is a mistake I made, as I cannot figure out which I should use...

Thanks for the help!
 
Old 11-18-2012, 12:47 AM   #4
hamlindsza
Member
 
Registered: Aug 2012
Distribution: Debian, CentOS
Posts: 74

Rep: Reputation: Disabled
Could you post the outputs of ifconfig & route -n from the Debian & CentOS VM's?
 
Old 11-18-2012, 12:40 PM   #5
RootMason
Member
 
Registered: Oct 2012
Location: Tucson, AZ
Distribution: Debian/CentOS
Posts: 123

Original Poster
Rep: Reputation: 5
Hey, thanks for your help! Here's the ifconfig & route -n outputs...

Here's the configs for Debian:

root@sdserver2:/home/sdclark# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0c:29:6b:fa:f9
inet addr:192.168.1.148 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fdc6:4617:f4f4:0:20c:29ff:fe6b:faf9/64 Scope:Global
inet6 addr: fe80::20c:29ff:fe6b:faf9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21 errors:0 dropped:0 overruns:0 frame:0
TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2242 (2.1 KiB) TX bytes:7274 (7.1 KiB)

root@sdserver2:/home/sdclark# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:0c:29:6b:fa:03
inet addr:192.168.23.1 Bcast:192.168.23.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe6b:fa03/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:131 (131.0 B) TX bytes:6104 (5.9 KiB)

root@sdserver2:/home/sdclark# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.23.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.1 0.0.0.0 UG 0 0 0 eth0

And the configs for CentOS:

root@centserver# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:0c:29:6b:fa:03
inet addr:192.168.23.4 Bcast:192.168.23.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe6b:fa03/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:131 (131.0 B) TX bytes:6104 (5.9 KiB)

root@centserver# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.23.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1
0.0.0.0 192.168.23.1 0.0.0.0 UG 0 0 0 eth1


Again, thanks for your willingness to help! I just got my first part-time internship this week to work with a network admin firm and I feel like a friggin retard 'cause I just can't seem to figure out such a simple problem! Anyways, thanks a lot!
 
Old 11-18-2012, 01:08 PM   #6
hamlindsza
Member
 
Registered: Aug 2012
Distribution: Debian, CentOS
Posts: 74

Rep: Reputation: Disabled
Hi,

The IP & route configuration seems fine.

You could cross check your firewall configuration, or disable your firewall for now:
iptables -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

Check your DNS Settings on both VM's: /etc/resolv.conf

Could you check the following:
From the Debian VM:
Are you able to ping 192.168.1.1?
Are you able to ping google.com

From the CentOS VM:
Are you able to ping the Debian VM (192.168.23.1)?
Are you able to ping 192.168.1.1?
Are you able to ping google.com
 
Old 11-23-2012, 08:15 PM   #7
RootMason
Member
 
Registered: Oct 2012
Location: Tucson, AZ
Distribution: Debian/CentOS
Posts: 123

Original Poster
Rep: Reputation: 5
Thanks again for all the help, and for looking at my config files. I disabled the firewall as you had suggested and checked the resolv.conf file, but all seems fine. Here is resolv.conf

domain=test.com
nameserver=192.168.1.1
nameserver=75.75.75.75
nameserver=76.76.76.76

These are the nameservers my Windows base machine has in it's list to use, as well as on my Cisco router.

On the Debian server, I can ping 192.168.1.1 (my router's internal interface) and google.com and have full internet access. On the CentOS, I can ping the Debian machine (192.168.23.1) and it is getting a DHCP address from this connection. I cannot, however, ping 192.168.1.1 (on the router) or access the internet.

I must have tried 10 different setups and any help you may be able to give would be greatly appreciated. And thanks for all your help to date!

Steve
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up a Test Lab between DSL Client & Debian Server in VMWare Workstation RootMason Linux - Virtualization and Cloud 5 11-01-2012 04:27 PM
Using Squid on Debian Wheezy as a Proxy to a Client in VMWare Workstation RootMason Linux - Networking 0 10-31-2012 02:31 PM
How to install all g++ versions & switch 4.5,4.6,4.7 in Debian Wheezy? -alternatives? esgol Linux - Newbie 5 07-15-2012 06:44 AM
[SOLVED] Newly installed debian sid & saved debian wheezy home would like to transfer files EDDY1 Linux - Newbie 11 01-20-2012 08:43 PM
apache2 setup/test subdomains on LAN DeltaXFX Linux - Server 5 11-04-2007 11:16 AM


All times are GMT -5. The time now is 02:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration