LinuxQuestions.org
Help answer threads with 0 replies.
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-07-2005, 12:32 AM   #1
jeffvph
LQ Newbie
 
Registered: Jul 2005
Posts: 26

Rep: Reputation: 15
Routing question


I have a RedHat 9 box with 2.4.20-8 kernel connected to the internet via wireless wlan0 (x.x.x.x IP). The box also has 2 LAN cards eth0 (y.y.y.y) and eth1 (z.z.z.z).

z.z.z.z/24 network has full access to the internet while y.y.y.y/24 is not exposed to the internet. I need 1 host from z.z.z.z/24 network (lets say z.z.z.20) connected to another host in y.y.y.y/24 (y.y.y.20) on port 1972 only using iptables.

I know this is possible but I just dont know how. I will very much appreciate your help.

Thanks
 
Old 11-07-2005, 05:34 AM   #2
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
Run these commands:

# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -A FORWARD -i eth1 -s z.z.z.20 -o eth0 -d y.y.y.20 -p tcp --dport 1972 -j ACCEPT

Noe check the rule:
# iptables -L -n FORWARD

save the rule

Last edited by ~=gr3p=~; 11-07-2005 at 05:40 AM.
 
Old 11-07-2005, 07:14 PM   #3
jeffvph
LQ Newbie
 
Registered: Jul 2005
Posts: 26

Original Poster
Rep: Reputation: 15
Thanks grep, the packet forwarded seems not coming back from y.y.y.20 so added this line and it worked.

iptables -A FORWARD -i eth0 -s y.y.y.20 -o eth1 -d z.z.z.20 -p tcp --dport 1972 -j ACCEPT

Again thank you very much for your help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 question hsegtreas Linux - Networking 2 08-28-2004 05:19 PM
IP Routing Question yvesg Linux - Networking 2 05-11-2004 06:13 AM
routing question yenonn Linux - Networking 30 03-22-2004 09:55 AM
Routing Question brokenflea Linux - Networking 2 12-05-2003 03:15 PM
routing question busbarn Linux - Networking 4 05-08-2003 09:26 AM

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

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