LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-11-2008, 03:26 PM   #1
Cyberman
Member
 
Registered: Aug 2005
Distribution: Debian Stable
Posts: 218

Rep: Reputation: 17
Internet Connection Sharing kind of working


How do I establish the ICS all the way?

I was able to get Ubuntu working with Puppy Linux, however, I seem to be unable to get it working with Debian etch.

Ubuntu 7.10 is the server.
Debian etch is the client.

Debian etch has been giving me an error such as

Quote:
eth0: no ipv6 routers present
I don't know what that is all about, and I'm not sure if it's related.

Here's what I have been able to accomplish so far.

I have been able to get the debian computer to obtain an IP address from the ubuntu box. I have also been able to ping google.com, and it seems that it's domain was rendered into its IP, so I am assuming it knows google exists. Perhaps it is the case that it only knows google exists because the ubuntu computer says says, and nothing further, as in it might be in ubuntu's cache or something.

Here is the script I used on the ubuntu computer to start ICS.

Code:
#!/bin/sh
sudo apt-get install dnsmasq ipmasq
echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.conf
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo "1" | sudo tee -a /proc/sys/net/ipv4/ip_forward
echo "net.ipv4.conf.default.forwarding=1" | sudo tee -a /etc/sysctl.conf
echo "net.ipv4.conf.all.forwarding=1" | sudo tee -a /etc/sysctl.conf
sudo /etc/init.d/dnsmasq restart
sudo dpkg-reconfigure ipmasq
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
I'm really thinking that maybe it has to do with the ipv4 versus the ipv6 protocols. I don't know enough about it, but maybe some of you might.

I was able to get this working on Puppy Linux, but I can't get it to work with Debian etch. I know that the ethernet cards and the wireless device works.

On the client, I do the following:

Code:
sudo dhclient eth0
Code:
route add default gw 192.168.0.123
That gets an IP and allows me to
Code:
ping google.com
Quote:
PING google.com (72.14.207.99) 56(84) bytes of data.
PING 192.168.0.3 imcp_seq=2 Destination Host Unreachable
PING 192.168.0.3 imcp_seq=2 Destination Host Unreachable
PING 192.168.0.3 imcp_seq=2 Destination Host Unreachable

--- google.com ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3000ms, pipe3
If I

Quote:
cat /etc/resolv.conf
it looks like this...

Quote:
search domain_not_set.invalid
nameserver 192.168.0.123

Last edited by Cyberman; 07-12-2008 at 01:01 AM.
 
Old 07-13-2008, 11:07 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by Cyberman View Post
Code:
PING google.com (72.14.207.99) 56(84) bytes of data.
PING 192.168.0.3 imcp_seq=2 Destination Host Unreachable
PING 192.168.0.3 imcp_seq=2 Destination Host Unreachable
PING 192.168.0.3 imcp_seq=2 Destination Host Unreachable

--- google.com ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3000ms, pipe3
My interpretation of that is:
  1. Debian successfully did a DNS resolution of goggle.com to 72.14.207.99
  2. Debian then tried to to ping 72.14.207.99 and was told by Ubuntu that the host was unreachable.
Interpreting this is where I am not certain. My experience is if there is no entry in the routing table the message is something like "no route to destination." My recollection is that I've seen "Destination Host Unreachable" on a LAN when the forwarding computer can't get any response when it tries ARP (address resolution protocol) to determine the host's MAC address (for example, if the computer is off). I am not too sure what it would mean when the host is not on the LAN.

I do have some questions and and observations ...

It looks to me like the script is a combination of things you need to do once (such as install/configure packages and change configuration files), and things you need to do at every boot (like the iptables commands). So is this a script you only ran once? And if so did you make any provisions for the results of those commands being persistent across reboots? (I am not sure about Debian, but on some distros, if you send the output of iptables-save to a particular file at a particular location, then the existing rules will be re-established on every boot. If you have a script called /etc/init.d/iptables, it may give you some clues about this.)

If my first question doesn't lead to understanding this difficulty it might be useful to use a packet sniffer such as wireshark or tcpdump on the Ubuntu machine to see what, if anything, is going out and coming back from your Internet connection. (Edit: Look in particular for any inappropriate ARP packets -- for example asking "who has 72.14.207.99" -- or type 3 icmp messages coming from further upstream.)

Normally, setting the default route (gateway) is handled automatically by DHCP (so you wouldn't need to do it with a route or ip command), although things can be configured where this is not true. (And doing it unnecessarily should not cause this problem.)

I have wondered whether you really want to MASQUERADE packets on both eth0 and wlan0. But unless one of those provides the connection to your Ubuntu machine, I don't see how it can cause this problem.

And just to make sure I am understanding you, by ICS do you mean Internet Connection Sharing?

EDIT: I am not sure the IPv6 message is related to your problem, but my knowledge of IPv6 is quite limited. I do know I see that message on one of my boxes every time I bring up wireless w/o apparent ill effects.

Last edited by blackhole54; 07-13-2008 at 11:14 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
urgent:: internet connection sharing: DNS server not working shyam_d_sundar Linux - Networking 18 05-04-2021 05:52 PM
Internet Connection Sharing LordHendrix Linux - Newbie 3 11-12-2006 07:42 PM
internet connection kind of slow, occasionally times out or locks up agentchange Linux - Newbie 3 11-01-2006 08:05 AM
Internet connection sharing LinuxNewKnight Linux - Networking 1 04-10-2006 08:04 AM
internet connection sharing vishalkhandade Linux - Software 17 02-14-2006 01:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:36 AM.

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
Open Source Consulting | Domain Registration