Jump to content

Internet Connection Sharing (and Samba, too)


Steve Scrimpshire
 Share

Recommended Posts

I have not found a post that helps me the way I need help. Everything is a little more than basic, so please don't flame me for this question. If there is a post that explains it easy, please point me to it.

 

Here's my setup:

 

One Linux Mandrake 8.1 (2.4.20 kernel) and one Win98SE computer. Both have Linksys Home Phoneline network cards in them. The internet connection is strictly dialup. I'd rather have my Linux box be the server. I have no idea where to begin.

 

Idealistically, I'd like to have it so that the server listens for the other box to want to connect (open IE or whatever) and connects and then disconnects when the user closes IE or logs off somehow manually. I think my iptables is a little screwed up (had this problem before, I think it has something to do with the options or modules in my kernel and it was a pain to get the kernel configured to recognize my card). I've tried to use MCC, but it always gives me a list of cards to choose from and my card is not on that list. I had to download a driver from Linksys specifically for it.

 

I've tried to do

 

ifup eth0

 

but it tells me that it failed...probably having something to do with not having a DNS server configured or something.

 

I'm totally clueless where to begin and have nothing newbie-ized enough to make it clear to me. Also learning more about filesharing would be great, too.

 

TIA

 

Steve Scrimpshire

(Formerly known as Omar Serenity)

Link to comment
Share on other sites

Ok, I put this at the end of /etc/rc.d/rc.local:

/sbin/ifconfig eth0 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0

dhcpd

 

and this is what I get when I run ifconfig eth0 (on the Linux box, of course):

eth0      Link encap:Ethernet  HWaddr 00:20:78:F0:42:23

         inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0

         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

         RX packets:3982 errors:2 dropped:0 overruns:0 frame:8

         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

         collisions:0 txqueuelen:100

         RX bytes:298833 (291.8 Kb)  TX bytes

 

On the Windows box, when I do winipcfg:

 

IP Autoconfiguration address: 192.168.0.253

Mask: 255.255.255.0

 

Here are some things that appear to be relevant in my syslog of the Linux box:

Dec 21 15:44:58 localhost dhcpd: DHCPDISCOVER from 00:20:78:f0:2a:25 via eth0 

Dec 21 15:44:59 localhost dhcpd: DHCPOFFER on 192.168.0.253 to 00:20:78:f0:2a:25 (6V0K10B) via eth0 

Dec 21 15:44:59 localhost dhcpd: DHCPREQUEST for 192.168.0.253 (192.168.0.1) from 00:20:78:f0:2a:25 (6V0K10B) via eth0 

Dec 21 15:44:59 localhost dhcpd: DHCPACK on 192.168.0.253 to 00:20:78:f0:2a:25 (6V0K10B) via eth0 

Dec 21 15:53:40 localhost dhcpd: DHCPINFORM from 192.168.0.253 via eth0: not authoritative for subnet 192.168.0.0 

Dec 21 16:10:36 localhost dhcpd: Listening on LPF/eth0/00:20:78:f0:42:23/192.168.0.0/24 

Dec 21 16:10:36 localhost dhcpd: Sending on LPF/eth0/00:20:78:f0:42:23/192.168.0.0/24 

Dec 21 16:18:59 localhost dhcpd: Listening on LPF/eth0/00:20:78:f0:42:23/192.168.0.0/24 

Dec 21 16:18:59 localhost dhcpd: Sending on LPF/eth0/00:20:78:f0:42:23/192.168.0.0/24 

Dec 21 16:23:25 localhost dhcpd: Listening on LPF/eth0/00:20:78:f0:42:23/192.168.0.0/24 

Dec 21 16:23:25 localhost dhcpd: Sending on LPF/eth0/00:20:78:f0:42:23/192.168.0.0/24

 

(6V0K10B is my Windows box)

 

Here's some other possibly useful stuff:

[root@localhost omar]# ping 192.168.0.253

PING 192.168.0.253 (192.168.0.253) from 192.168.0.1 : 56(84) bytes of data.

64 bytes from 192.168.0.253: icmp_seq=0 ttl=128 time=1.122 msec

64 bytes from 192.168.0.253: icmp_seq=1 ttl=128 time=641 usec

64 bytes from 192.168.0.253: icmp_seq=2 ttl=128 time=660 usec

64 bytes from 192.168.0.253: icmp_seq=3 ttl=128 time=661 usec



--- 192.168.0.253 ping statistics ---

4 packets transmitted, 4 packets received, 0% packet loss

round-trip min/avg/max/mdev = 0.641/0.771/1.122/0.202 ms

[root@localhost omar]# traceroute 192.168.0.253

traceroute to 192.168.0.253 (192.168.0.253), 30 hops max, 38 byte packets

1  192.168.0.253 (192.168.0.253)  0.754 ms  1.300 ms  0.545 ms

 

And I can ping 192.168.0.1 from the Windows box.

Link to comment
Share on other sites

Ok. I know I'm close. I can ping 192.168.0.1 from the Windows computer and I can ping the Windows computer by netbios name, but I can't ping the server (Linux box) from the Windows computer by name. Actually, I'm not even sure what the netbios name for my Linux box actually is. In Windows it says that it is 'Computer' but I'm not sure what to put for it in my config files for Samba or DHCP and what I should have in my /etc/hosts file.

Link to comment
Share on other sites

Thanks. I'm not quite ready to go with Mandrake 9.0 yet. The mandrake kernels don't jive with my MoBo among other problems. Anyway, I got this working. It turns out that I had done everything right, except the version of iptables that I was using conflicted with the 2.4.20 kernel I had installed. I upgraded iptables (with alot of effort) and voila, I am sharing my internet connection. Samba was a little easier...just a stupid mistake on my part of not allowing any users...LOL.

Link to comment
Share on other sites

Why dont you just install MDK 9... I am sharing a dial-up right now as i am typing this messge and it was really basic.....

 

It's really quite easy to do if you use the Control Centre.....?

 

how did you do that, if you could let me know, ive tried using the cc but to no avail except being able to internally ping!

Link to comment
Share on other sites

I don't know about the Control Center, but here is my /etc/dhcpd.conf:

authoritative;

ddns-update-style none;



# My Linux's ehternet card's IP/Subnet mask



       # default gateway

option routers 192.168.0.1;

option subnet-mask 255.255.255.0;



# Hostname of of my Linux box and Domain nameservers of my ISP



option domain-name "omar.serenity.home";

option domain-name-servers 205.171.3.65;

       option ip-forwarding on;



# This section would be used if you are sharing with more than one computer to assign

# different IPs to each. Not really needed on mine, I don't think



subnet 192.168.0.0 netmask 255.255.255.0 {

range dynamic-bootp 192.168.0.16 192.168.0.253;

default-lease-time 21600;

max-lease-time 43200;

}



# This is the hostname of my Windows box that uses DHCPD to obtain it's Static IP

# The hardware address is found under network, highlight your Ethernet TCP-IP and click 

# "Properties"



host 6v0k10b {

  hardware ethernet 00:20:78:f0:2a:25;

  fixed-address 192.168.0.2;

}

 

Setup dhcpd to run at boot. I hope this helps. There is also a Wizard for MCC for 8.1 (maybe that's what is installed in 9.0 by default under Servers?)

Link to comment
Share on other sites

You also need to adjust your settings in the properties of your card on your other box. You also need to make sure /proc/sys/net/ipv4 is set to 1. You can do this with InteractiveBastille as root, I think. It walks you through a whole bunch of questions. You can also set up ICS in MCC under Network & Internet, but I couldn't because my card was not listed.

Link to comment
Share on other sites

ok, so everything posted in that code part was what i ned for my linux gateway?! (just changing for my needs)

 

but what would i be needing for my linux client (just the one)?

 

all help appreciated

Link to comment
Share on other sites

I haven't tried yet, there is no booting off cd2 and choosing alt1 or alt2. There is on cd1 alt0, alt1, and alt2 images. Maybe I should see what they are, I'm not sure how to go about this as the boot from cd1 is the regular install disk boot. I'll play around and see what happens as the Gateway box is not my regularly work system.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...