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 09-17-2005, 09:40 PM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
Lightbulb iptables help with sth plz


Hi i have two interfaces in my system
eth0
and eth1
each one has a unique ip address that belogns to a different network



Computer A MyLaptop(iptables here)
eth 0 ========cable============ eth1 eth0======== HUB

The traffic comes from the hub (right) to the eth0 of my laptop.. I want to change the packets so as to reach the eth0 of Computer A.,,, I want to do this thing for a specific ip address and a specific port that reaches my laptop's eth0
So i need to help me with this little problem
 
Old 09-17-2005, 10:04 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
You'll need to use port forwarding to accomplish this. Do you have an existing NAT setup?
 
Old 09-18-2005, 03:41 AM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
can u give me a smallexample plz?
 
Old 09-18-2005, 12:44 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Code:
/sbin/iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 8888 -j DNAT --to 192.168.0.2:80
/sbin/iptables -A FORWARD -p tcp -i eth0 -d 192.168.0.2 --dport 80 -j ACCEPT
This will route port 8888 to 192.168.0.2:80.
 
  


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
Some Iptables Problems, Plz Help tcheric Linux - Networking 2 09-06-2005 11:53 AM
plz plz solve my route mapping problem nedian123 Linux - Networking 1 07-12-2004 10:41 PM
Disable screensaver in slack 9.1 without any x or sth ice_world Linux - Newbie 3 06-06-2004 01:52 PM
i'd like to know sth about "apt" FreakFish Linux - Software 3 04-25-2004 08:40 AM
Perl Sqlite DBI $sth->rows The Jesus Programming 0 10-22-2003 12:35 AM

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

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