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 03-24-2004, 05:50 PM   #1
thirumala
LQ Newbie
 
Registered: Mar 2004
Location: USA
Posts: 18

Rep: Reputation: 0
Question new user; ROUTING PROBLEM


Hi,

I am new to linux. I want to setup a router on linux PC with following config:


GW-------SW-------[[eth0 linux box with redhat 9.0 eth1]]--------client pc

Eth0: 192.168.10.40 with 192.165.10.0 network
Router/GW: 192.168.10.1

Eth1: 192.168.20.1 with 192.168.20.0 network

Client PC: 192.168.20.25


I want to route any type of traffic between eth0 and eth1. What do I need to do?

What is the basic config for router setup?

At present I am able to ping from linux box towards both sides but not from client pc to GW.

Here is “route” command output:

192.168.20.0 192.168.20.1 255.255.255.0 UG 0 0 0 eth1
192.168.20.0 * 255.255.255.0 U 0 0 0 eth1
192.168.10.0 192.168.10.40 255.255.255.0 UG 0 0 0 eth0
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eht1
127.0.0.0 * 255.0.0.0 U 0 0 0 l0
default 192.168.10.1 0.0.0.0 UG 0 0 0 eth0

and

I have enabled IP-forwarding using
< echo "1" > /proc/sys/net/ipv4/ip_forward >

And FORWARD_IPV4=yes in sysctl.conf file.

Please let me know where the things going wrong?


Thanks,
Thiru
 
Old 03-24-2004, 10:25 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Question?
What is the gateway set to on the client machine?

Do you want to perform NAT translation to share an internet ip address. Otherwise, why have 2 gateways and why even have a switch for only one device?

Last edited by jschiwal; 03-24-2004 at 10:29 PM.
 
Old 03-25-2004, 09:02 AM   #3
thirumala
LQ Newbie
 
Registered: Mar 2004
Location: USA
Posts: 18

Original Poster
Rep: Reputation: 0
Routing Problem

Quote:
Originally posted by jschiwal
Question?
What is the gateway set to on the client machine?

Do you want to perform NAT translation to share an internet ip address. Otherwise, why have 2 gateways and why even have a switch for only one device?

Hi,

thanks for the reply.

for your question 1:

NIC has set as GW.


for question 2:

this setup is for bandwidth testing using NIST Net.
I don't want to do any NAT or filtering and I just want to route all the traffic from NIC1 to NIC2 and NIC2 to NIC1.

I have some more questions:

1> For normal routing do I need to use IPTABLES?

2> If not, how to setup just all traffic routing between NICs?

3> how to disable IPTABLES startup during boot?


Thanks,
Thiru
 
Old 03-25-2004, 10:06 AM   #4
titan5
LQ Newbie
 
Registered: Jan 2004
Posts: 2

Rep: Reputation: 0
TRY THE FOLLOWING FOR IPTABLES
1. deleting a specific rule:
replace the -A in the rule with -D and repeat the rule.
deleting all rules:
iptables -F

2. saving iptables rules:
service iptables save

this will save the rules to /etc/sysconfig/iptables and the rules will be aplied
after every boot.

3. listing iptables rules:
listing the filter table:
iptables -L
listing the nat table:
iptables -t nat -L

4. http://www.linuxguruz.com/iptables/howto/


Regarding routing, if you can get ES 3.0 then routin is enabled by default !! you don't need any rule, fortunately, or should I say unfortunately.
 
Old 03-25-2004, 10:42 AM   #5
thirumala
LQ Newbie
 
Registered: Mar 2004
Location: USA
Posts: 18

Original Poster
Rep: Reputation: 0
thanks for the reply.

I would like to know answers to the following questions:

I have some more questions:

1> For normal routing do I need to use IPTABLES?

2> If not, how to setup just all traffic routing between NICs?

3> how to disable IPTABLES startup during boot?


thanks,
Thiru


Quote:
Originally posted by titan5
TRY THE FOLLOWING FOR IPTABLES
1. deleting a specific rule:
replace the -A in the rule with -D and repeat the rule.
deleting all rules:
iptables -F

2. saving iptables rules:
service iptables save

this will save the rules to /etc/sysconfig/iptables and the rules will be aplied
after every boot.

3. listing iptables rules:
listing the filter table:
iptables -L
listing the nat table:
iptables -t nat -L

4. http://www.linuxguruz.com/iptables/howto/


Regarding routing, if you can get ES 3.0 then routin is enabled by default !! you don't need any rule, fortunately, or should I say unfortunately.
 
Old 03-25-2004, 10:50 AM   #6
titan5
LQ Newbie
 
Registered: Jan 2004
Posts: 2

Rep: Reputation: 0
Which version of Linux are you running ?

Frankly, I have not set routing before, but I will try to test it on my RedHat 7.3 test PC.

becasue the newer version ES 3.0 which is currently running on our servers is a bit confusing because routing is enabled while IP FORWARDING is disabled !!

I will let you know as soon as I get more details.

To remove the IPTABLE rule use -D switch as I mentioned in my previous messae then SERVICE IPTABLES SAVE
 
Old 03-25-2004, 03:50 PM   #7
atlesn
Member
 
Registered: Oct 2003
Location: Oslo, Norway
Distribution: RedHat 9.0, Fedora Core 1/2/3, Debian 3.0, Smoothwall
Posts: 110

Rep: Reputation: 15
Download the parprotued package from "somewhere" (google it). Install. Change ips for both nics to the same, with broadcast to 255.255.255.255 and netmask to 255.255.255.255. Run

parprouted eth0 eth1

Disable ip-tabling

iptables --flush
iptables -t nat --flush
/etc/init.d/iptables save
(to save iptables to restore with no rules at boot)

Now, your computer should act switch like. I've tried it myself, with success!

Last edited by atlesn; 03-25-2004 at 03:52 PM.
 
Old 03-25-2004, 04:19 PM   #8
thirumala
LQ Newbie
 
Registered: Mar 2004
Location: USA
Posts: 18

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by atlesn
Download the parprotued package from "somewhere" (google it). Install. Change ips for both nics to the same, with broadcast to 255.255.255.255 and netmask to 255.255.255.255. Run

parprouted eth0 eth1

Disable ip-tabling

iptables --flush
iptables -t nat --flush
/etc/init.d/iptables save
(to save iptables to restore with no rules at boot)

Now, your computer should act switch like. I've tried it myself, with success!
Hi,

I am very happy to see your reply.

I need some information about this package. I wasted lot of time on this problem. I have left few days to reach my deadline.

I just want simple router that's it.
Please help me out.

Thanks,
Thiru
 
Old 03-25-2004, 04:55 PM   #9
timlitw
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Rep: Reputation: 0
router

make sure ip tables are removed as shown in a previous message

on a redhat 9+ for fedora machine

edit /etc/sysctrl.conf

make sure these lines are correct
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 1

add your routes

route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.16.10.1

to make it permanent

touch /etc/sysconfig/network-scripts/route-eth0

then

ip route show | grep eth0 | grep via | cut -d" " > \ /etc/sysconfig/network-scripts/route-eth0
 
Old 03-25-2004, 06:09 PM   #10
thirumala
LQ Newbie
 
Registered: Mar 2004
Location: USA
Posts: 18

Original Poster
Rep: Reputation: 0
Talking Re: router -worked

Quote:
Originally posted by timlitw
make sure ip tables are removed as shown in a previous message

on a redhat 9+ for fedora machine

edit /etc/sysctrl.conf

make sure these lines are correct
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 1

add your routes

route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.16.10.1

to make it permanent

touch /etc/sysconfig/network-scripts/route-eth0

then

ip route show | grep eth0 | grep via | cut -d" " > \ /etc/sysconfig/network-scripts/route-eth0

Hi,

It seems you are a real practical person. It worked.

Thanks
Thiru
 
  


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
User Mode Linux: Routing question neocookie Linux - General 6 06-04-2006 02:28 AM
One way routing Problem Ken_QTP Linux - Networking 3 10-28-2005 03:10 PM
User-Space Routing Info cophy Linux - Networking 1 07-23-2005 10:35 AM
Routing from Hell (WRT54G) - New user backroger Linux - Networking 5 03-07-2005 12:21 AM
Routing questions; New user thirumala Linux - Networking 0 03-25-2004 09:35 AM

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

All times are GMT -5. The time now is 04:15 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