Internet Connection Sharing debian > Windows xp

New to Debian (Or Linux in general)? Ask your questions here!

Internet Connection Sharing debian > Windows xp

Postby szarki432 » 2010-02-08 20:41

Hello

I installed modem Sagem fast 800 on debian .. and i want share internet connection with windows xp
Before this (masquerade) everything worked fine on debian (internet worked)

I say step by step what i done ..

on windows xp i set NIC like this:
Code: Select all
IP Address: 192.168.0.2
Netmask: 255.255.255.0
Gateway: 192.168.0.1
DNS1: 192.168.0.1
DNS2: 212.160.68.2

Debian NIC:
Code: Select all
IP Address: 192.168.0.1
Netmask: 255.255.255.0
Gateway: 192.168.0.1


Next i run those commands:
Code: Select all
ifconfig eth0 192.168.0.1
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
apt-get install dnsmasq ipmasq
/etc/init.d/dnsmasq restart
dpkg-reconfigure ipmasq


I uncomment this line in /etc/sysctl.conf :
Code: Select all
net.ipv4.ip_forward=1


I figured out that i will have to run those commands after every reboot (to have masquerade) :
Code: Select all
ifconfig eth0 192.168.0.1
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward


So i decide create /etc/init.d/firewall
Code: Select all
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

of course
Code: Select all
chmod +x /etc/init.d/firewall
update-rc.d firewall defaults 20


And to /etc/network/interfaces i added:
Code: Select all
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.1


After that i rebooted PC
My debian .. simply stoped for about couple of minutes on:
Code: Select all
Starting MTA:


After that i logged in as root
and i try ping something .. but nothing was pingged.
It shows up after ping try
"unknow ...."
i checked my internet connections and seems to be fine .. but not working :(
I try
Code: Select all
pppd call net24

and shows up:
Code: Select all
Plugin pppoatm.so loaded

but this plugin was allready loaded durring system booting.

ifconfig shows:
Code: Select all
eth0      Link encap:Ethernet  HWaddr 00:02:a5:35:83:f5
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::202:a5ff:fe35:83f5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:73 errors:0 dropped:0 overruns:0 frame:0
          TX packets:135 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5586 (5.4 KiB)  TX bytes:5945 (5.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:65 errors:0 dropped:0 overruns:0 frame:0
          TX packets:65 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5577 (5.4 KiB)  TX bytes:5577 (5.4 KiB)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:77.255.61.246  P-t-P:195.114.190.150  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:240 (240.0 B)  TX bytes:61 (61.0 B)


and, /etc/network/interfaces shows:
Code: Select all
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.1


Please, help me :cry:
User avatar
szarki432
 
Posts: 18
Joined: 2010-02-08 20:20

Re: Internet Connection Sharing debian > Windows xp

Postby szarki432 » 2010-02-09 23:48

I added new info
User avatar
szarki432
 
Posts: 18
Joined: 2010-02-08 20:20

Re: Internet Connection Sharing debian > Windows xp

Postby Absent Minded » 2010-02-10 17:21

Don't you have 2 nics in your computer for this? Also I noticed that you are not setting your gateway to your modem. What was the working configuration in your interfaces file before you changed it?
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012
User avatar
Absent Minded
 
Posts: 3714
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.

Re: Internet Connection Sharing debian > Windows xp

Postby szarki432 » 2010-02-10 18:51

little misunderstanding
I have 1 nic in debian and 1 in windows xp

Everything was working (internet connection on debian) after instaling modem:
(Quick what i've done)

I downloaded http://eagle-usb.org/ueagle-atm/non-fre ... 1.1.tar.gz
and run commands
Code: Select all
tar xvzf ueagle-data-1.1.tar.gz
mv ueagle-data-1.1 ueagle-atm
mv ueagle-atm /lib/firmware/
apt-get install ppp

I created /etc/ppp/peers/net24
Code: Select all
lock
defaultroute
noipdefault
noauth
holdoff 4
maxfail 25
persist
asyncmap 0
lcp-echo-interval 2
lcp-echo-failure 7
name myid@provider.com
user myid@provider.com
plugin pppoatm.so
0.35

I created /etc/ppp/pap-secrets
Code: Select all
# Secrets for authentication using PAP
# client        server  secret                  IP addresses
"myid@provider.com" * "mypass" *

And after that my internet connection working
Code: Select all
pppd call net24


But when i've done that what is post in 1st post
internet connection stopped working.

Here is my resolv.conf
Code: Select all
nameserver 213.241.79.37
nameserver 213.241.79.38

and data from route command:
Code: Select all
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
195.114.190.150 *               255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

I don't know why i have double eth0
btw. I suppose that i should put IP address of second nic (192.168.0.2) in Destination.
But i don't know how to do it , and if that will be good .. to do that.
User avatar
szarki432
 
Posts: 18
Joined: 2010-02-08 20:20

Re: Internet Connection Sharing debian > Windows xp

Postby Absent Minded » 2010-02-10 19:19

okay, i think I need more info, How is your modem connected? USB? I would have thought hat there should have been an entry in /etc/network/interfaes that showed your modem connection. Anyway, it looks to me like you machine is just going around in a circle as I don't see a gatway to the internet. As for needing to put anything in for WinXP's nic you shouldn't have to do that. The way I understand dnsmask WinXP should be set to get a DHCP address from your Debian box. anyway, I "think" you need an entry in your interfaces file for your modem.
Serving the community the best way I can.
Spreading the tradition of Community Spirit.
Please read some Basic Forum Philosophy
Give a man a fish, he eats for a day. Teach him how to fish, he eats for life.
Updated Nov. 19, 2012
User avatar
Absent Minded
 
Posts: 3714
Joined: 2006-07-09 08:50
Location: Washington State U.S.A.

Re: Internet Connection Sharing debian > Windows xp

Postby szarki432 » 2010-02-10 20:46

My modem is Sagem F@st 800 it's using USB port.

i think too that i shoul put something to /etc/network/interfaes
but i don't know exactly what
Like u see my modem using ppp0
and has dynamic ip (changing every time after re-connect)

I almost sure that i set all good in win xp (NIC)

I don't have have dhcp installed on debian .. and it will be problem to install it since i don't have internet connection on debian.

btw.
you mean
apt-get install dhcp
or
apt-get install dhcp3-server

Coz i tried install dhcp3-server before and there was a problem durring loading this thing (exactly durring system bootting)
User avatar
szarki432
 
Posts: 18
Joined: 2010-02-08 20:20

Re: Internet Connection Sharing debian > Windows xp

Postby smallchange » 2010-02-10 21:04

Your XP settings are correct. Remove the gateway line from /etc/network/interfaces. That establishes a default route to your internal network when you want the default route to be through your modem. The default route is through the gateway, so if the host is not found on your local network that is where it goes to find it. You should have an entry in /etc/hosts that associates your XP address, 192.168.0.2, with that machine and it will be found because it is on your local subnet. Then, because your ppp command includes "defaultroute" when ppp comes up that defaultroute is added.

Summary:
/etc/network/interfaces looks like this
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0

Then run
Code: Select all
ifdown eth0 && ifup eth0

Edit: I changed the ) to the 0 it needed to be above.

Then bring up your ppp interface and it should work. As for the enabling of forwarding leave this
net.ipv4.ip_forward=1
in /etc/sysctl.conf and all the echoing business is not needed.
Last edited by smallchange on 2010-02-10 21:16, edited 1 time in total.
smallchange
 
Posts: 1740
Joined: 2009-05-04 15:56

Re: Internet Connection Sharing debian > Windows xp

Postby szarki432 » 2010-02-10 21:07

You meant
Code: Select all
net.ipv4.ip_forward=1

or
Code: Select all
#net.ipv4.ip_forward=1


because i have allready uncomment this line (so it's "on")
User avatar
szarki432
 
Posts: 18
Joined: 2010-02-08 20:20

Re: Internet Connection Sharing debian > Windows xp

Postby smallchange » 2010-02-10 21:15

I mean leave net.ipv4.ip_forward=1 uncommented.
smallchange
 
Posts: 1740
Joined: 2009-05-04 15:56

Re: Internet Connection Sharing debian > Windows xp

Postby szarki432 » 2010-02-10 21:36

It's working now :D
masquerade and net connection on debian working perfectly
many thanks :wink:
User avatar
szarki432
 
Posts: 18
Joined: 2010-02-08 20:20

Re: Internet Connection Sharing debian > Windows xp

Postby szarki432 » 2010-02-12 00:38

Hi again :wink:

I have another problem with some web pages
They do not work after masqerade (when usb modem is connected to pc with debian)

Those web pages starting to work when i connect my modem directly to pc with windows xp

One person told me that i should put this:
Code: Select all
echo 0 > /proc/sys/net/ipv4/tcp_window_scaling

to /etc/init.d/firewall
But this not helped (I reboot pc with debian to see those changes)

Please help me :roll:
User avatar
szarki432
 
Posts: 18
Joined: 2010-02-08 20:20

Re: Internet Connection Sharing debian > Windows xp

Postby smallchange » 2010-02-12 02:21

To be of any help we will need to know more about the links that are giving you trouble. Can you point us to one?
smallchange
 
Posts: 1740
Joined: 2009-05-04 15:56

Re: Internet Connection Sharing debian > Windows xp

Postby szarki432 » 2010-02-12 04:03

Ok

For example this:
http://debian.linux.pl/

This is polish support for debian
User avatar
szarki432
 
Posts: 18
Joined: 2010-02-08 20:20

Re: Internet Connection Sharing debian > Windows xp

Postby smallchange » 2010-02-12 12:52

I don't see any obvious problem. I can't read any of it but it appears to be complete and in place when I look at it. The page is largely javascript. I have not heard any problems with javascript through NAT. Maybe someone else here has some ideas?

What do you see when it has trouble?
smallchange
 
Posts: 1740
Joined: 2009-05-04 15:56

Re: Internet Connection Sharing debian > Windows xp

Postby szarki432 » 2010-02-12 14:05

That page (debian.linux.pl)

Is loading, and loading .. so on so on
I waited abou 5 min to Firefox finish loading in page (i not touch FF when he was doing it) and nothing loaded (not a single element)
User avatar
szarki432
 
Posts: 18
Joined: 2010-02-08 20:20

Next

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable