Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Hope you don't kick me out of the forum for asking this.
I'm running redhat 9 on an intel P4, everything worked fine, I managed to connect it to a dsl connection, it works fantastic, then I added a second lan card, I actually understand the problem. But all the solutions I have seen in the formums are for text mode (I just never even seen it), I installed in graphics mode, and just once have used the "terminal", and I could use a hand on how to configure my lan cards just to share internet connection. This might sound dumb, but I tried with:
IP 192.168.10.2 (card 1)
IP 192.168.10.3 (card 2)
When I do this the dsl quits.
As a note, I'm not dumb, I just don't know what I'm doing.
So... exactly what is the problem? Ever since you installed the second card, dsl doesn't work? or you just can't share the connection?
Here are some command line to help you figure out what's going on where $ is your command prompt (have to be root for some of these)
$ ifconfig (this will show the configureations of the cards)
$ ifconfig eth0 [or eth1]
To share the Internet connection with another workstation you need to do the following things.
1. One of the cards should be configured by you (i.e. 192.168.....) and the other should be DHCP (because the IP will be assigned by the ADSL provider) ... your connection will be ppp0, not eth1 or eth0
2. Set up the other computer to use the internal card as a gateway
3. If you have iptables (firewall) set up in redHat, you MUST enable IP forwarding or else the connection will not work between cards.
You should only give a static IP to eth1, yes, because technically eth0 should be "down" until it has the Internet connection ... but you need to configure IP forwarding also, so that traffic can flow between the two interfaces.
type the following on a command line
$ cat /proc/sys/net/ipv4/ip_forward
If the system returns "0" then you will not be able to pass packets between the cards. to set: $ echo 1 > /proc/sys/net/ipv4/ip_forward
In addition your iptables must also be configured to forward the packets from one interface to another.
Thanks a lot, I'll try to configure the ipforward thing, it was bugging my head that I should tell eth1 where to look for the connection, and I couldn't give it a gateway that I didn't know which it was going to be.
I'll use the commands and keep you posted, I'll give it a try after work tomorrow.
The other reason it didn't work, and won't work is that you have put both eth's into the same subnet. A router, by definition, isn't a router unless it has interfaces in more than one subnet. Try 192.168.10.2 and 192.168.11.2, you might get somewhere.
The reason it probably failed is that when you give an ip address to an interface a route is put in the route table for that directly connected network. If you add a second interface into the same network the box now has to choose which interface it will point the route at and will choose one, more than likely the one with the higher ip address.
Now if your default route has a next hop of 192.168.1.1 via eth0 but you have told your box that 192.168.1.0 is also on eth1 when a packet need to be routed the box will try to forward the packet to the next hop via the wrong interface. What ever the address is that your ISP gives you DON'T configure the same network on eth1 or everything will go tits-up.
p.s. I would be surprised if your ISP gives you a 192.168.1.x address as the 192.168.0.0 range is reserved for internal use only and does not exist on the internet.
p.p.s due to this fact, if you want to use eth1 as a gateway to the internet for other devices on your network you will also need to configure nat.
So basically the cards ARE on different subnets since one is an internal IP and the other is an External IP.
On boot I initialise eth1 with the internal IP address; (set the onboot=yes) 192.168.1.1 and the other I do not initialise at boot time (onboot=no) but I start the ADSL. Basically you totally ignore the eth0 card and use ppp0 as the connection.
He's right about NAT - you configure this along with IP forwarding in iptables. and enable IP forwarding as I have indicated.
I know this sounds complicated to understand, but it's really fairly straighforward: you are routing the LAN to the Internet via your Internal LAN card forwarded to your External Internet card.
Baldy was saying that in your current config you were routing FROM your LAN TO your LAN, that's why it wasn't working.
Set up forwarding and you're good to go. If you need help with how to do that just post back here, and I can show what I have, but there is ample information on Google or even on these forums.
I think it will also help you if I answer your questions directly.
Originally posted by falconkid OK now I'm confused, let me get this straight.
eth0 is auto, because the ppp0 connection is the one that gives it the IP and all the info.
eht 1 is configured with information I feed it.
ok then which is my gateway ?
I assume the IP given by the dsl will be somewhere in the 192.168.1.x
Then according to baldy I will need for eth1 192.168.2.x
The gateway for your LAN clients will be the INTERNAL address (the address you made up) of your server. On your server itself for the internal card, i forget if it needs a gateway, I will have to double check on mine).
You are not correct, The IP given by your ADSL provider will be a public address and it could be anything but not in the 192.168.X.X or the 10.X.X.X range. It could be for example, 188.8.131.52. So as long as you assign eth1 anything in the 192.168 range, you will not have to worry about any conflicts. 192.168.10.1 is fine. Just make sure your clients are using the same subnet. (i.e. 192.168.10.X)
but when I give an IP to eth0 the dsl does not work, so it seems that the only card that can be configured is eth1.
Correct. eth0 is assigned by your DSL provider's DHCP server. Do not configure it yourself.
the issue now is what exactly with ?:
IP: 192.168.10.1 (let's say)
Netmask: 255.255.255.0 Or other ?
Gateway: Who knows ?
DNS 1 The dns should be the DNS of my service provider ? I guess so..
IP address and netmask are fine. I am not sure about the gateway but I would use 192.168.10.1 for now to see if that works. (my server is down right now but I will check if that doesn't work).
DNS1 and 2 settings will be that of your service provider unless you are running your own DNS server on the machine, then you can put 127.0.0.1 here. Normally, the DNS settings are stored in /etc/resolv.conf
We'll get that machine purring happily, don't worry.
OK, sorry, but I did it with windows, I'll keep on learning about Linux, but I needed the shared internet connection.
I've seen this is a recurrent issue with Linux all over the web, truckloads of people wanting to use it as what it's meant to be, a server, until it gets simpler, us mortals will have to keep reliying on bill gates.
As soon as I can afford an extra computer for experimentation, I'll give it another try, for now, windows will have to do.
Sorry for having bothered, but I really like Linux. I guess I was not up to it.