LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-06-2007, 08:22 AM   #1
firewireee
LQ Newbie
 
Registered: Jan 2007
Posts: 4

Rep: Reputation: 0
Red face how to change ssh tunnel source ip


I use SSH tunnels ( -D ) to access my local network from outside.

But the last machine I configured I can't surf local network because my source ip is from ppp0 and not eth1.

Is there any way to setup witch ethernet device ssh uses ?

Code:
suzn:/# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
BSN-access.dsl. *               255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth1
239.0.0.0       *               255.0.0.0       U     0      0        0 eth1
default         *               0.0.0.0         U     0      0        0 ppp0
suzn:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:60:97:D5:C6:25
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5077234 errors:1 dropped:0 overruns:0 frame:1
          TX packets:4264111 errors:0 dropped:0 overruns:0 carrier:1
          collisions:66201 txqueuelen:1000
          RX bytes:4265669470 (3.9 GiB)  TX bytes:1338685241 (1.2 GiB)
          Interrupt:11 Base address:0x1080

eth1      Link encap:Ethernet  HWaddr 00:50:04:82:FC:BA
          inet addr:192.168.0.5  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1044871 errors:1 dropped:0 overruns:0 frame:1
          TX packets:1660743 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:105912003 (101.0 MiB)  TX bytes:1941903675 (1.8 GiB)
          Interrupt:10 Base address:0x1000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:43116 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43116 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10901119 (10.3 MiB)  TX bytes:10901119 (10.3 MiB)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:195.210.*.*  P-t-P:213.250.19.90  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:3039676 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2574576 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:2613565506 (2.4 GiB)  TX bytes:742325278 (707.9 MiB)

suzn:/#
 
Old 01-07-2007, 03:21 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
You can create a file for ssh client configuration as ~/.ssh/config and it will automatically be used for any ssh connections you initiate from this machine & account. In that file you can use the BindAddress statement to set which IP to use as your source IP. You can also use the -b option on the command line.
 
  


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
Trying to tunnel X over SSH DaneM Linux - Software 23 06-07-2008 08:17 AM
SSH Tunnel - need some help on this MeridianRebel Linux - Networking 2 08-11-2005 02:10 PM
ssh tunnel crep Linux - Networking 2 08-25-2004 08:24 PM
ssh tunnel TroelsSmit Linux - Software 2 04-30-2004 03:30 PM
Ssh Tunnel tinaa Linux - Software 7 07-29-2003 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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