Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a virtual network of 3 machines running on the platform VirtualBox (version 4.1.16).
hosta and hostb are installed with debian-6.0.5-i386-netinst.iso and are a cli.
hostc is installed with ubuntu-12.04-desktop-i386.iso as GUI.
Both hosta (eth1) and b's IP settings are set statically and hostc revives its IP address from hostb which is acting as a DHCP server (isc-dhcp-server).
hosta is configured with 2 interface, eth0 (NAT) and eth1 (INT).
hostb and c both have one interface, set to internal.
In order to gain access to external addresses I am trying to configure NAT in hosta, I done this using the command "iptables -t nat -A POSTROUTING -s 10.R.N.0/24 -j MASQUERADE".
this has worked for hostb as it can reach google, aptitude etc. however hostc is unable to reach external addresses. I am able to ping both a and b from hostc, just not able to ping any external addresses.
It sounds like the default gateway on c has not been set, please provide "ifconfig -a", "route -n" and "iptables -vnL" for a and c. Note that the internal address ranges you're using are not "interesting", so do not need to be obscured.
Thanks for your time Chris. I am guessing it has something to do with the Forward chain in routera, if so why is it that b can be routed out fine but not c? Also I tried to flush the iptables to see if that would eradicate the issue but think I have the syntax wrong.
From hostc
Last edited by The Badger; 06-26-2013 at 09:44 AM.
root@routera:/home/davy# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.113.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
Code:
root@routera:/home/davy# iptables -vnL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
I can't connect to hostc via SSH for some reason, I figured out how to flush iptables and done so but didn't resolve the issue, so I have only been able to copy the text over for the commands run on hosta
I can't see anything low level that doesn't look right here. Clearly there is some network activity inbound to c, and you said yourself you can ping the gateway. Are you trying to hit remote hostnames or ip addresses? Could this actually be a DNS issue? If you do a traceroute 8.8.8.8 on c, does it get anywhere? can you show us "iptables -t nat -vnL" on a too?
In order to gain access to external addresses I am trying to configure NAT in hosta, I done this using the command "iptables -t nat -A POSTROUTING -s 10.R.N.0/24 -j MASQUERADE".
where is that command in the iptables -t nat -vnL output?
No, i mean the MASQUERADE line is clearly NOT in that output is it? you have NOT executed (and then saved) that command. Are you sure host B is connected the same way as host c?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.