PDA

View Full Version : problems setting up network


ThaRealest
2004-09-21, 04:49 PM CDT
im trying to set up my network in linux so my flatmates can use the internet through my computer and access some of my files like they could wen i used windows. basically, there is one mac and one windows xp computer to be on the network with me. I had the problems with my usb cable modem (ntl broadband) but that was easily sorted by creating the dhcpd.conf file as described in other posts before my first boot into fedora. In the network configuration the only hardware listed is my 3com 940 ethernet and this is what is selected as the hardware for the broadband connection (despite it really being an ambit cable modem plugged into usb?!) i dont want to change this as the internet works fine. ive tried following the guides to set up samba etc to connect to the mac but no joy, even pinging the mac isnt working and the light for my connection on my router isnt on (its not the cable as it all works in windows). when it comes to networking in linux im a n00b but if someone could give me a step by step to get this sorted out that would be quality

thanks in advance

Tom

** just realised its a network hub we all plug into not a router, dont know if that makes a difference for fixing it though

crackers
2004-09-21, 08:13 PM CDT
You have to use a second network card and set up IP forwarding, masquerading, and net routing. This all takes a bit of doing, so you're not likely to get a step by step here. Use Google to search for "Linux routing firewall"

ThaRealest
2004-09-23, 06:48 AM CDT
Ok, i've put in a Realtek RL8029 card and disabled the onboard 3Com Lan. Now i have the internet fine again in fedora and the device is usbnet (that wasnt there at all when 3Com was enabled). eth1 is the realtek and it says its active and manually set the ip to 192.169.0.1 with the masking 255.255.255.0. i've followed the red hat bible's instructions to set linux as the router for the other computers with ip forwarding etc. Still nothing works, including the lights on the back of the card and on the hub and pinging the Mac doesnt work either.

Is there sumthin i'm missing to just get the card itself working, the lights come on in windows so it must be a setting somewhere?

taylor65
2004-09-23, 09:10 AM CDT
If you don't have a link light, then you have a layer 2 issue. Make sure you have eth1 active. If it's active, and you don't have a link light on the hub, then make sure you have a straight through cable (as opposed to a crossover cable). Get the link light first, then we can look at ip addresses and such.

ThaRealest
2004-09-23, 11:09 AM CDT
that did it! thanks a lot, thats been drivin me mad the past few days. assumed the cable was right coz it worked with the onboard ethernet in wdinows.
now to get this internet shared!

hiberphoptik
2004-09-23, 12:04 PM CDT
You have to use a second network card and set up IP forwarding, masquerading, and net routing. This all takes a bit of doing, so you're not likely to get a step by step here. Use Google to search for "Linux routing firewall"
you should actually be able to do this with only one network card

1. setup ip forwarding (if you want an easy way to do it install firestarter)
2. tell your other computers to use your linux box as the gateway

if you want other IP addresses but you dont want to use a second NIC you can also setup aliased IP interfaces for you NIC like so

ifconfig eth0 10.0.0.1
ifconfig eth0:0 192.168.1.100
ifconfig eth0:1 192.168.1.101

this would give that one network card 3 differant IP addresses add as many as you like :)

ThaRealest
2004-09-23, 12:13 PM CDT
might gve that a try another time, the network seems to be fine now as the mac is accessing my files. just the internet routing is giving me problems. to /etc/sysconfig/network i added the line
GATEWAY=192.168.0.1

i set net.ipv4.ip_forward = 1 in /etc/sysctl.conf

and typed the following

iptables -t nat -A POSTROUTING -o 192.168.0.1 -j MASQUERADE
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -d 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -s ! 192.168.0.0/24 -j DROP

rebooted but no joy. does what i've done look right or have i missed something?

ThaRealest
2004-09-23, 01:12 PM CDT
ok ive got me firestarter installed and set it up to enable NAT with eth1 as my net device and auto detect address. STILL the mac can't connect to the internet.

AwPhuch
2004-09-23, 01:23 PM CDT
im trying to set up my network in linux so my flatmates can use the internet through my computer and access some of my files like they could wen i used windows. basically, there is one mac and one windows xp computer to be on the network with me. I had the problems with my usb cable modem (ntl broadband) but that was easily sorted by creating the dhcpd.conf file as described in other posts before my first boot into fedora. In the network configuration the only hardware listed is my 3com 940 ethernet and this is what is selected as the hardware for the broadband connection (despite it really being an ambit cable modem plugged into usb?!) i dont want to change this as the internet works fine. ive tried following the guides to set up samba etc to connect to the mac but no joy, even pinging the mac isnt working and the light for my connection on my router isnt on (its not the cable as it all works in windows). when it comes to networking in linux im a n00b but if someone could give me a step by step to get this sorted out that would be quality

thanks in advance

Tom

** just realised its a network hub we all plug into not a router, dont know if that makes a difference for fixing it though

Might I recommend a very nice and powerful firewall/router system based off of Redhat 8.0

Its called SMOOTHWALL (http://www.smoothwall.org) Its incredibly easy to install, configures as simple as a linksys or netgear router (by a webgui) and run on minimal hardware!

SmoothWall Express is an open source firewall distribution based on the GNU/Linux operating system. Linux is the ideal choice for security systems; it is well proven, secure, highly configurable and freely††† available as open source code. SmoothWall includes a hardened subset of the GNU/Linux operating system, so there is no separate OS to install. Designed for ease of use, SmoothWall is configured via a web-based GUI, and requires absolutely no knowledge of Linux to install or use.

Hope this helps

Brian
AwPhuch

crackers
2004-09-23, 10:22 PM CDT
ok ive got me firestarter installed and set it up to enable NAT with eth1 as my net device and auto detect address. STILL the mac can't connect to the internet.
Did you tell the Mac to use the internal IP (192.168.0.1) as the gateway or did you only set it on the Fedora box?

ThaRealest
2004-09-24, 02:51 AM CDT
yeh its set up with a manual ip (192.168.0.2) but to automatically detect router with dhcp. Even if i manually set the router as 192.168.0.1 it syill doesn't work

taylor65
2004-09-24, 05:28 AM CDT
You can't set the IP address manually and have dhcp running.

ThaRealest
2004-09-24, 05:44 AM CDT
on the mac/os x u can. it manually sets its own ip (which i put as 192.168.0.2) but uses dhcp to find the internet so im guessing it should set that itself to my network ip 192.168.0.1. even if i do set it manuially with the router and DNS as 192.168.0.1 it doesnt work anyway. Thing is he can access my files using samba and can ping each other so its not a connection prob and i have firestarter set up to allow NAT and ip forwarding is set to 1

ThaRealest
2004-09-28, 01:26 PM CDT
i'm thinking maybe the problem with the internet sharing is my dhcpd setup? i manuall created the .conf file before my first boot with just the line

ddns-update-style interim;

as this was the only way to get my cable modem to be recognised (as its usb). do i need to add anything else to this file?