LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   internet connection on linux (https://www.linuxquestions.org/questions/linux-networking-3/internet-connection-on-linux-38113/)

ridha 12-12-2002 09:24 AM

internet connection on linux
 
hi
i am new in Linux, i used winnt4.0 to share internet in my local network, now i want to use Linux as a local server instead of winnt to connect to the internet and share it to the other computer in my local network. so i would like to know with programms should i use witch files should be configured in order to connect to the internet with Linux and share it.
i have a modem connected to a router that is connected to the computer using ethernet card and another ethernet card for the local network eth1. i have a permanant connection with a fix ip. i configured the 2 cards but i still can't connect to the internet :cry:
so please help me
thank you

Thymox 12-12-2002 09:29 AM

Am I right in thinking that your setup is like this?
Code:

Internet --> Router --> Linux Box --< Rest of network
If so, then you will want your Linux box configured so that eth0 is on one ip group and eth1 is on another, you would then set your Windows boxes to connect via (proxy?) your Linux box's eth1 ip address. Lots of people will suggest that you use dhcp for the internal, local network (of with your Linux box's eth1 will be a part of), but I maintain that if you're on a very small network (< 10 machines), it is just a easy to maintain if you give each one a seperate IP address.

HTH

ridha 12-12-2002 09:39 AM

sorry but u seem that u misundertood me , I couldn't connect to internet now , the eth1 have as ip 193.92.100.66 & is connected to the router which have an ip 193.92.100.65 ( i think that is the gateway ) & the nameserver of my isp ( i put them as the forwards in named.conf ) but the answer by ping to any host like www.google.fr is always "network unrecheable " & in the status bar of mozilla is first resolving hostname & now sending request but process isn't answering
thanks

Thymox 12-12-2002 09:44 AM

Sorry... I did misunderstand. I have not run into problems like this, myself, so please ignore my above post. Sorry I can't help.

plonker 12-12-2002 04:59 PM

Is it just name resolution that doesn't work? Can you ping an IP address for example (www.google.fr - 216.239.37.101) . If you cant then you need to see at what point you are getting stuck at. The way I do this is do a ping to each point out of your network until you find the address that is not responding, then investigate from there. At least then you will have narrowed down your problem to one spot.

Craig

ridha 12-12-2002 06:02 PM

i can ping in my local network but when i try to ping outside (internet) i have a message that said "destination host unreachable"
so i am asking if something to be done to connect to the internet . i configured the 2 ethernet cards one for the local network and the other to connect to the internet .
as i said above i used this configuration modem -> router (193.96.X.X) ->(193.96.X.X+1) linux (redhat8) 192.168.0.3

plonker 12-12-2002 06:35 PM

Ok. Here are a few things to look at

Have you put a route in place from one network card to the other on the Linux box? I am not sure exactly on the syntax (I am still new to Linux as well) but do a man route it it will show you some examples.

Do you have a FW (iptables?) running on the Linux box? Maybe this is blocking your access out. Maybe turn it off temporarily to verify a connection?

If you either telnet or console into your router can you verify that you can ping the internet from there. If you cant then the Linux box may not be your problem.


Craig

bbenz3 12-13-2002 12:18 PM

OK the way I see it is that you have everything setup except for the linux box. You need to be using either ipchains or iptables. I personally like iptables better and it is what replaced ipchains.
You should create a file that you execute on startup that will autostart these functions.

You also need to enable IP Forwarding by this line:
echo 1 > /proc/sys/net/ipv4/ip_forward
You also need these lines to forward traffic between NICs:

iptables -t nat -I POSTROUTING -p all -d 0/0 -s 0/0 -j SNAT --to-source xxx.xxx.xxx.xxx (ext IP address)

if you e-mail my i will send you a copy of my script (too big for here)


All times are GMT -5. The time now is 02:21 AM.