LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-28-2006, 10:38 AM   #1
jay123
LQ Newbie
 
Registered: Jun 2004
Location: Cape Town
Distribution: suse
Posts: 18

Rep: Reputation: 0
Unhappy route add


Hello, please help! I am trying to add route and it does not work for me. I simply want to route from eth0 to eth1. My configuration as follow:

Thanks Jay.

[root@localhost sbin]# ./route add -net 192.168.100.0/24 gw 192.168.0.1
[root@localhost sbin]# ./route add -net 192.168.0.0/24 gw 192.168.100.1
[root@localhost sbin]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.100.0 192.168.0.1 255.255.255.0 UG 0 0 0 eth0
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.0.0 192.168.100.1 255.255.255.0 UG 0 0 0 eth2
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
 
Old 06-28-2006, 02:06 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
this doesn't make sense. you can't route TO a local subnet, it's already there.... sounds to me like you want to enable ip forwarding to make it actually route between the networks it is directly attached to.
 
Old 06-28-2006, 02:51 PM   #3
jay123
LQ Newbie
 
Registered: Jun 2004
Location: Cape Town
Distribution: suse
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks! I do agree with you. Now I am looking in to how to setup IPforward. Any suggestion on how to enable IP forwarding feature. I recently installed fedora core 5 and it seem it does not have command “ipfwadm”. Any help I appreciated.

Tks
Jay
 
Old 06-28-2006, 04:06 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
just run
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
there is also a static equivalent you can add to your sysctl.conf file if your distro uses it, but i forget the exact details.
 
Old 06-29-2006, 02:15 AM   #5
Notwerk
Member
 
Registered: Apr 2005
Location: Jordan
Distribution: Debian (Sarge), Ubuntu (6.06)
Posts: 271

Rep: Reputation: 31
Like acid kewpie said, you can set IP Forwarding to be enabled when the machine is started by adding this line to your /etc/sysctl.conf file:
Code:
net.ipv4.ip_forward = 1
But it's also common practice to use the "echo 1 > etc..." inside your firewall script. The static method may be more suitable for a dedicated server.
 
Old 06-29-2006, 09:42 AM   #6
turbowilliam
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Rep: Reputation: 0
Please help with my router. I have 2 computers I want to connect both on internet using linux router(one of the computer). I added the line
net.ipv4.ip_forward = 1
to /etc/sysctl.conf file. Only one of my network card let me activated it (the one that is connect to the modem: internet eth1). The other card eth0 won't let me activated it. eth0 is connect to a switch that connect my windows XP computer. I am doing something wrong? Please help.
Thank everyone
 
Old 06-29-2006, 09:50 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
turbowilliam, please don't threadjack. you should start a new thread explaining your problem, and clarify exactly what you mean buy "activated"
 
Old 07-03-2006, 09:50 AM   #8
jay123
LQ Newbie
 
Registered: Jun 2004
Location: Cape Town
Distribution: suse
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks for your support. I am still stuck on same problem. I may have missed something else. I have in Linux box with two Ethernet port Eth1 and Eth2. All I want to do is ping from PC1 to PC2 so I can insert delay and jitter on each port. First step is to get the IP forward working correctly then I can move forward.

In Linux box IP address as follow.
Eth1: IP address is 192.168.5.1/24 gw 192.168.5.2
Eth2: IP address is 192.168.1.1//24 gw 192.168.1.2
I also typed following command in Linux box.
echo 1 > /proc/sys/net/ipv4/ip_forward

Here is my overall configuration IP address.

PC1 (192.168.5.2 gw 192.168.5.1) Linux Eth1(192.168.5.1 gw 192.168.5.2) Linux (192.168.1.3 gw 192.168.1.1)  PC 2 (192.168.1.1 gw 192.168.1.3)


My routing table below from Linux box

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 192.168.5.2 0.0.0.0 UG 0 0 0 eth1

I also have tried route add insert proper gateway in both interfaces. (example: 192.168.5.0 192.168.5.2)
I also add route in PC.

Please help this problem driving me crezzzy.

Tks
Jay
 
Old 07-07-2006, 12:58 PM   #9
jay123
LQ Newbie
 
Registered: Jun 2004
Location: Cape Town
Distribution: suse
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks to you all got it working. I had XP running with firewall on. Once I disable the firewall it started working.
 
  


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
How do I add a route??? moonmoth Linux - Networking 3 09-04-2005 06:25 AM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
route add powah Linux - Newbie 4 09-01-2005 02:24 PM
route add robf2301 Linux - Networking 6 03-11-2005 04:06 AM
ip route add ducati620 Linux - Networking 0 06-06-2004 06:11 AM

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

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