Overclockers Australia Forums

OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Specific Hardware Topics > Networking, Telephony & Internet

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 29th July 2003, 10:15 PM   #1
Oink Thread Starter
Member
 
Join Date: Dec 2002
Posts: 50
Default Simplex over ethernet - dual adapters

Hi,

I'm not sure if the topic makes much sense, but basically I want to do the following:

A computer (linux box) with two network adapters. One adapter used for incoming data, the other for outgoing. I've googled forever and a day, and I can't seem to come up with the right search terms to get the results I want.

The closest I got was this:
http://www.nat32.com/simplex.html

This is information (for Windows) on how to set up so that your cable modem is used for incoming data, and your dialup modem is used for outgoing data -- such is the case for satellite cable etc.

Does anyone have any idea how to do this? How to designate a LAN link such that it can only support data flow in one direction only? It has been done many times before with Cable modems (as shown above) -- but can it be done in Linux?

Thanks for any useful suggestions or links!!
Oink is offline   Reply With Quote

Join OCAU to remove this ad!
Old 29th July 2003, 10:31 PM   #2
Dutch Wink
Member
 
Dutch Wink's Avatar
 
Join Date: Aug 2001
Location: Perth
Posts: 2,036
Default

default route, with source IP address spoofing ..?


set your default route to that of the modem, and you'll need an iptables scriptlet similar to this:
Code:
modem="ppp0"      #<--- set as relevant, for dialup or an eth interface
cableIP="`/sbin/ifconfig eth2 | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`"    #<--- if it is assigned via DHCP, change the eth2 as appropriate, OR
cableIP="12.34.56.78"       #<--- if static
iptables -t nat -A POSTROUTING -o $modem -j SNAT --to-source $cableIP
this should do the job i would think ..? give or take a typo or two...
__________________
OCAU OFFICIAL CHAIR RAVER'S SOCIETY MEMBER #1
-
Auroythmix**: GIRLS = MATH EQUATIONS, SO IF I SOLVE FOR X I GET THE SEX!
-
TheTron: If I sit and enjoy these pancakes. He'll buy me the new Justin Beaver album
Dutch Wink is offline   Reply With Quote
Old 29th July 2003, 10:39 PM   #3
Oink Thread Starter
Member
 
Join Date: Dec 2002
Posts: 50
Default

Thanks heaps;

although I was wondering if the solution had to be a hack -- I was hoping not to have to IP spoof etc. However, I will look in to your solution. Do you have any links or references that I could chase up?
Oink is offline   Reply With Quote
Old 29th July 2003, 10:43 PM   #4
Dutch Wink
Member
 
Dutch Wink's Avatar
 
Join Date: Aug 2001
Location: Perth
Posts: 2,036
Default

man iptables

...?

not really, i just grabbed all of that off the top of my head as i've done something similar to that lately.. have the luxury of a couple adsl accounts to play with at work ...

i really dont know how you're going to get data going out of one interface, to come back via the other, without telling it to do so by changing the source IP address? if you leave it untouched it'll be the modem's IP address.. and you guessed it - data will come back down via the modem ...
__________________
OCAU OFFICIAL CHAIR RAVER'S SOCIETY MEMBER #1
-
Auroythmix**: GIRLS = MATH EQUATIONS, SO IF I SOLVE FOR X I GET THE SEX!
-
TheTron: If I sit and enjoy these pancakes. He'll buy me the new Justin Beaver album
Dutch Wink is offline   Reply With Quote
Old 29th July 2003, 10:48 PM   #5
Oink Thread Starter
Member
 
Join Date: Dec 2002
Posts: 50
Default

Yeh I think you have a point there.

You've given me a very substantial hint at a possible solution at the very least!

Muchly appreciated. Will work on it tonight, and update this thread to see how it goes.

The reason for IP spoofing is for connection-based protcols such as TCP, right? I mean, there's no way you can handshake without a duplex connection. However, I plan on using it for UDP transmissions (connectionless). That fact that I'll be using it purely for connectionless protocols, could this possibly hint at a slightly different solution?

EDIT: Just to clarify; the the reason why I need a return channel at all is because I am going to be implementing a reliable UDP -- that is, some traffic will need to return to sender in order for packet retransmissions etc -- however, it will still remain connectionless.

Last edited by Oink; 29th July 2003 at 10:50 PM.
Oink is offline   Reply With Quote
Old 29th July 2003, 11:02 PM   #6
Dutch Wink
Member
 
Dutch Wink's Avatar
 
Join Date: Aug 2001
Location: Perth
Posts: 2,036
Default

"some traffic will need to return to sender..."

just like the postal system, the sender address is where any replies will be sent to (as this is where the remote system sees the connection/packet sequence as being made from), if you send out the modem interface then by default "return to sender" IP address is that of the modem.. you want to change this to the cable IP, so that replies are sent there, instead

(unless your program can instead supply a different IP address every time within the payload of each packet... not a great solution if you ask me)

this is for any protocol running on IP ...
__________________
OCAU OFFICIAL CHAIR RAVER'S SOCIETY MEMBER #1
-
Auroythmix**: GIRLS = MATH EQUATIONS, SO IF I SOLVE FOR X I GET THE SEX!
-
TheTron: If I sit and enjoy these pancakes. He'll buy me the new Justin Beaver album

Last edited by Dutch Wink; 29th July 2003 at 11:04 PM.
Dutch Wink is offline   Reply With Quote
Old 29th July 2003, 11:30 PM   #7
Iceman
Member
 
Iceman's Avatar
 
Join Date: Jun 2001
Location: Brisbane (nth), Australia
Posts: 6,308
Default

Whats the point? Ethernet is full duplex, why use 100mbit of one card and 100mbit of another? Why not just use 200mbit of one card or 400mbit of two?
__________________
_,ø¤°`°¤ø,¸_¸,ø¤°`°¤ø,¸_¸,ø¤°`°¤ø,¸_

WTB: Cisco 1801-M PM me
Please rehash my posts and pass them off as your own ideas! Triple points for doing it in the same page of the thread. Plagiarism is the sincerest form of copyright infringement.
Iceman is offline   Reply With Quote
Old 30th July 2003, 1:00 AM   #8
Oink Thread Starter
Member
 
Join Date: Dec 2002
Posts: 50
Default

The reason is not for anything performance related, but just so I can simulate a particular environment. Certain network setups require incoming and outgoing data to arrive and leave via different channels. Internet protocols will behave very differently under these circumstances -- I am testing them.
Oink is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

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 On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 12:24 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!