LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-12-2004, 04:01 PM   #1
willigiann
Member
 
Registered: Nov 2004
Posts: 46

Rep: Reputation: 15
routing(again????)


Hello there!
i know that i am one more idiot which thinks that he know linux(hahaha), but the truth is that every day i realize that i know less than yesterday....
Anyway, here's my big problem-->
i have a broadband connection and 5-6 pcs. Until now i used to have a netgear router for routing to those computers, which unfortunately broke by a hacker maybe, and now i need my SuSE 9.2 Prof computer to make the routing.
The problem is that i searched all the internet to find how can i do that, but the only information i found it was about how to route from an IP to another IP. I want to route from a network card to another network card. Let me show you the structure:
NTL:HOME--via ethernet-->server(suse 9.2)==another ethernet card=>hub=>rest network
I don't know how to do it and its really a trouble. sorry for saying this, but in windows its just 3 clicks.
I do not want to use windows because of the security, i just say that its more easy.
Please does anyone how can i do that? Please suppose that i am not so much expert, so if you could please answer me as clearly as you can.
Thank you all!!!!!
 
Old 11-12-2004, 05:10 PM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
I'm not exactly sure why you're having a hard time finding information on setting up routing and NAT, since what you have there is a very common configuration.
You can either do it via YaST, or preferably enter the necessary commands manually:
assuming eth0 is the external interface, and eth1 is the internal.
Code:
echo "1" > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
that's it, and depending on how your firewall is setup you may have to do:
Code:
/sbin/iptables -A FORWARD -o eth0 -j ACCEPT
 
Old 11-12-2004, 05:35 PM   #3
GUIPenguin
Member
 
Registered: Aug 2004
Location: Maine
Distribution: Gentoo Linux
Posts: 239

Rep: Reputation: 30
if you have an extera pc (the older the better!) you can setup a Distro that is specificly setup as a router, and seting up a router most likly you want a firewall too

try IPCop Linux manypeople like to use Smoothwall v2

I would go with IPCop
check out http://www.ipcop.org/cgi-bin/twiki/view/IPCop/WebHome

I personaly like the 2ed newest version 1.3 over 1.4, I have had some truble with my harddrive with 1.4 and it doesnt offer that much more fetures, plus I have found a few commands that dont work in the shell

it uses Snort for an Intrusion Detection system, and with the current patch updates it is rock solid!
 
Old 11-13-2004, 07:35 AM   #4
willigiann
Member
 
Registered: Nov 2004
Posts: 46

Original Poster
Rep: Reputation: 15
Talking

first of all, i'd like to thank you all for your very quick answers. i didn't wait an answer so fast
i want this specific computer to be my router with that specific distro.
I have enable through YaST the forwarding but it didn't worked. As for now, let me show you the ifconfig:
eth0 Link encap:Ethernet HWaddr 00:E0:7D:94:CA:2B
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:7dff:fe94:ca2b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:263037 errors:0 dropped:0 overruns:0 frame:0
TX packets:492271 errors:0 dropped:0 overruns:0 carrier:0
collisions:2815 txqueuelen:1000
RX bytes:33642079 (32.0 Mb) TX bytes:393929405 (375.6 Mb)
Interrupt:11 Base address:0xc000

eth2 Link encap:Ethernet HWaddr 00:06:4F:09:F7:E5
inet addr:81.109.68.192 Bcast:255.255.255.255 Mask:255.255.255.0
inet6 addr: fe80::206:4fff:fe09:f7e5/64 Scope:Link
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1894773 errors:0 dropped:0 overruns:0 frame:0
TX packets:1188923 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:935997847 (892.6 Mb) TX bytes:510960193 (487.2 Mb)
Interrupt:5 Base address:0xc400

i use eth2 for the internet and eth0 for the local. I run the commands you gave me as:
server:~ # echo "0" > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE

after that, i run the command for the firewall:
server:~ # iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE

and then i went to a local computer:
billg@billg:~> ping www.suse.de
ping: unknown host www.suse.de

i am doing something wrong. but what?
Thank you!
 
Old 11-13-2004, 07:48 AM   #5
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Quote:
use eth2 for the internet and eth0 for the local. I run the commands you gave me as:
server:~ # echo "0" > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE

after that, i run the command for the firewall:
server:~ # iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE

and then i went to a local computer:
billg@billg:~> ping www.suse.de
ping: unknown host www.suse.de

i am doing something wrong. but what?
it should be echo "1"

you need to configure the DNS server on the clients to your ISP's DNS, or setup a forwarder/caching server on your server then configure the clients to use it.

Last edited by Demonbane; 11-13-2004 at 07:50 AM.
 
Old 11-13-2004, 09:06 AM   #6
willigiann
Member
 
Registered: Nov 2004
Posts: 46

Original Poster
Rep: Reputation: 15
thanks, it worked fine. Just a final question now:My internet connection is BB1.5Mb but when i ping its going extremely slow...Why?
Thank you
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
routing jmono Linux - Networking 5 02-07-2006 06:20 AM
Routing gtkmike Linux - Networking 1 11-13-2003 09:21 AM
real routing under nat routing nothingmuch Linux - Networking 4 10-27-2003 03:11 PM
Routing in RH 8.0 Hybrid Blue Linux - Networking 2 10-12-2003 05:41 PM
Routing jimval7 Linux - Networking 3 02-08-2002 04:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration