LinuxQuestions.org
Help answer threads with 0 replies.
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 06-15-2004, 03:50 PM   #1
blueice
LQ Newbie
 
Registered: Oct 2003
Distribution: debian/stable
Posts: 25

Rep: Reputation: 15
simple router config


Hi to all,
i have 2 networks.
A. 192.168.0.0 255.255.255.0
B. 192.168.1.0 255.255.255.0

and i want computers of A network contact computers of B network, and B network contact the A network.

I have make a PC with debian (or i can use redhat) and 2 net cards (192.168.0.200 & 192.168.1.200).
I have config the cards but how i can add a simple routing?
I just want connect of A net to B and from B to A.
No internet, no anything else, just share the 2 networks.

Can everyone help me how i can do this simple?
Thanks and sorry for my bad English.
Christos
 
Old 06-16-2004, 01:54 AM   #2
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
turn on routing.
echo "1" > /proc/sys/net/ipv4/ip_forward

configure clients to use linux as gateway.
thats all.
 
Old 06-16-2004, 05:41 AM   #3
blueice
LQ Newbie
 
Registered: Oct 2003
Distribution: debian/stable
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by maxut
turn on routing.
echo "1" > /proc/sys/net/ipv4/ip_forward

configure clients to use linux as gateway.
thats all.
Hi,
thanks for the answer.
I have do this but i think needed and some more config. You are sure that it is not needed some route commands?
thanks a lot.
Christos
 
Old 06-16-2004, 06:13 AM   #4
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
If you have configured the clients to use the gateway as a default route, all you have to do is use the ip number in the other network to connect. The router does all the smart routing stuff..

If you want to use Window$ network browsing, you need to set up a WINS server on the router box.
This is part of the Samba package.
just add wins support = yes in the smb.conf file
and tell the clients to use the WINS server at the gateway address..
 
Old 06-16-2004, 08:45 AM   #5
blueice
LQ Newbie
 
Registered: Oct 2003
Distribution: debian/stable
Posts: 25

Original Poster
Rep: Reputation: 15
I have do this.
...the IPs of the router is:
eth0:
192.168.0.160
gateway 192.168.0.10 (my office gateway)

eth1 192.168.1.1

i have all add this configs but o PC (win2000) with IP: 192.168.1.12 can ping the both 2 interfaces of the router but no the PCs of the other network.
Any info about this?
Christos
 
Old 06-16-2004, 09:32 AM   #6
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 20.04
Posts: 2,116

Rep: Reputation: 73
You all sound out of line. He hasn't got a router
The man can't speak good english. He just wants to connect two pcs.
This is for blue ice:
Read the NFS Howto, if you can manage it. Look up www.tldp.org.
Connect your two pcs with a crossover cable, plugged into your ethernet cards in A and B.
For a start, disable all firewalls.
Configure the files hosts.allow hosts.deny and exports all to be found in /etc.
Then run as root in a terminal
ifconfig or /sbin/ifconfig, to make sure your eth0 card is running.
Then do in a terminal
/etc/rc.d/init.d/nfs start
Check with
rpcinfo -p to see that nfs and portmapper are running.
Do the same on the other computer.
Then try ping -c 10 192.168.1.0 see what you get. I spent ages getting my two connected, none of the wizards worked.
If you want examples of hosts.allow, hosts deny and exports, send me a mail and I'll beam it over.
Good Luck.
Peter
 
Old 06-16-2004, 04:31 PM   #7
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Add MASQUERADING to both interfaces..

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

(Forgot about that step, sorry)
 
Old 06-17-2004, 12:07 AM   #8
blueice
LQ Newbie
 
Registered: Oct 2003
Distribution: debian/stable
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by peter_robb
Add MASQUERADING to both interfaces..

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

(Forgot about that step, sorry)
thanks a lot
i will try today
 
Old 06-17-2004, 12:33 AM   #9
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
is MASQUERADE-ing required? This is a simple routing configuration.

bueice, you can edit /etc/sysctl.conf and set

net.ipv4.ip_forward = 1

Once this is done, you can

#sysctl -p

This iwll ensure that if you ever reboot your pc, you wouldn't need to retype the

echo "1" > /proc/sys/net/ipv4/ip_forward

or put it in the rc.local file.
 
  


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
Simple internal router lookssimple Linux - Networking 4 04-01-2004 12:30 PM
Configuring Simple Router on Mandrake 9.2... ech310n Linux - Networking 8 01-28-2004 08:16 PM
A simple router question. ingy866 Linux - Newbie 2 08-18-2003 01:51 PM
Turn a host pc into a simple router ? cmisip Linux - Networking 4 07-03-2003 10:19 PM
Simple Router hotrodowner Linux - Networking 14 02-10-2003 03:29 PM

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

All times are GMT -5. The time now is 07:07 PM.

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