Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-30-2006, 04:32 AM   #1
LQ Newbie
Registered: Aug 2005
Location: Romania
Distribution: opensuse 10.1/Ubuntu Edgy Eft
Posts: 10

Rep: Reputation: 0
Angry Cannot share internet connection?

I have a dual boot computer windows XP/opensuse 10.1 with 2 network cards.I have tried InternetConnectonSharing in winxp but it doesn't work.Then i've tried with linux and SNAT and masquerading but still does not work

this is the iptables script that i've used

#! /bin/sh
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -F
iptables -F
iptables -t mangle -F

iptables -P INPUT DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i ! eth0 -j ACCEPT

iptables -A FORWARD -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to myexternalipaddress

is there something wrong with it?

I've also installed vmware server in linux and in it a winxp virtual machine and when i select the network card for the virtual machine i selected to "use NAT and share the host ip address" everything works fine

Is it possible for my ISP to block sharing of my internet connection?
And if yes how?
Old 12-01-2006, 11:36 AM   #2
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
3 Things you can check for :
1. Does your clients have your box set as their gateway ?
2. Are your clients configured with the real DNS ip of your ISP at their boxes ?
3. Are'nt you get any errors while you run that script of yours ? (you can modprobe iptable_nat for natting)

Above all its always helpfull to tcpdump packets & see where exactly the problem could be. If confirmed for the above 3 things, can you post the output of tcpdump while a client requesting a browse access.
Old 12-01-2006, 05:24 PM   #3
LQ Newbie
Registered: Aug 2005
Location: Romania
Distribution: opensuse 10.1/Ubuntu Edgy Eft
Posts: 10

Original Poster
Rep: Reputation: 0
1. yes all my clients have set as the default gateway my linux box
2. i 've tried the DNS of the ISP and i also configured a DNS server on my linux box
3. i don't get any errors when i run my script but i haven't modprobe iptable_nat ( i don't really know what this is ), is it necessary?

I don't know what tcpdump is? Is it something like ethereal or wireshark? I've tried ethereal and i could see the packets got routed by the linux box (or by the Internet connecton sharing in winxp) but i get no reply. Also the packets that are routed have the ip address and the MAC address of the linux box.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Share Internet Connection sam_casperson Linux - Networking 3 02-03-2005 07:07 PM
How do I share my Internet Connection? sagi7ario Linux - Networking 3 03-16-2004 06:17 PM
how to share internet connection digihall7 Linux - Networking 2 09-23-2003 04:42 PM
HOW to share Internet connection zaldyd Linux - Newbie 1 07-25-2003 01:42 AM
How do I share the Internet connection? Valeria Linux - Networking 4 07-19-2003 12:28 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:19 PM.

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