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 02-15-2011, 03:51 AM   #1
Imbeciles
LQ Newbie
 
Registered: Oct 2005
Location: Centurion
Distribution: Ubuntu
Posts: 11

Rep: Reputation: 1
A tought Challenge


I have a particular nice system that communicte through different DSL routers for backups. The problem is the remote is reachable through my default gateway however for security i need to controll the physical interface/ip it uses to communicate with. I also need to select this path at will.

It's base is ssh - specifically scp.

I can ping through these interfces with
Code:
ping -I eth0
or
Code:
ping -I eth1
(-I interface address = Set source address to specified interface address. Argument may be numeric IP address or name of device. When pinging IPv6 link-local address this option is required.)

My requirement is to make an SCP / SSH connection but selectively force it through an particular interface/IP router.

Does anyone have an Elagant way?

My Scripts is all
Code:
#!/bin/sh
BASH

Last edited by Imbeciles; 02-15-2011 at 03:53 AM.
 
Old 02-15-2011, 03:52 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Is that all your script is? That really can't be all...
 
Old 02-15-2011, 03:57 AM   #3
Imbeciles
LQ Newbie
 
Registered: Oct 2005
Location: Centurion
Distribution: Ubuntu
Posts: 11

Original Poster
Rep: Reputation: 1
Smile

Quote:
Originally Posted by corp769 View Post
Is that all your script is? That really can't be all...
It indicate that I use Bash - sh

A solution using perl/java/c++ etc whatever will prolly not fit into my current application. Althow all suggestions is welcome.
 
Old 02-15-2011, 04:06 AM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Maybe you can use the -b switch for using a different bind address? Do a man ssh and man scp for more information.
 
Old 02-15-2011, 04:17 AM   #5
Imbeciles
LQ Newbie
 
Registered: Oct 2005
Location: Centurion
Distribution: Ubuntu
Posts: 11

Original Poster
Rep: Reputation: 1
Lightbulb

Quote:
Originally Posted by corp769 View Post
Maybe you can use the -b switch for using a different bind address? Do a man ssh and man scp for more information.
I have tried the ssh -b {ipliteral}before and now again, both work but it go through the same gateway, the bind seem to be not routing the traffic any other way.
How i test this is checking whether my ssh comes from an certain IP and using the -b result in the IP of only one router - the same one every time. I could not find (Google) any samples where the -b was used either.
 
Old 02-15-2011, 04:43 AM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Do you understand how to use the -b modifier? For example, if I issued ssh -b 10.0.0.1 10.0.2.1 it would use the interface that is assigned 10.0.0.1 (eth0). Whereas if I issued it with -b 10.0.1.1 10.0.2.1 it would use the 1.1 interface (wlan0). Hope that helps.
 
  


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
A Challenge??? ajeetraina Linux - Newbie 5 12-18-2007 07:20 AM
new challenge thebiggiantmouse Linux - Newbie 16 07-24-2006 09:03 AM
Want a challenge? TruckStuff Linux - Security 2 05-13-2005 01:39 AM
a challenge for you derfaust Programming 3 03-12-2004 12:23 AM
Basic C++ challenge? mymojo Programming 5 12-15-2003 02:25 PM

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

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