Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I currently use putty for ssh tunneling through a Fedora server. The server has 2 IP's, and currently it goes by default through the first IP it has assigned. Is there a way to dynamically specify which IP it goes out on, when the tunnel is created? It doesn't seem to matter which IP I connect to on the server.

route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
xx.xxx.xxx.0    0.0.0.0         255.255.255.0   U     0      0        0 venet0
192.0.2.0       0.0.0.0         255.255.255.0   U     0      0        0 venet0
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 venet0
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 venet0

ipconfig -a

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1567431378 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1567431378 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:473454714430 (440.9 GiB)  TX bytes:473454714430 (440.9 GiB)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:1520680615 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1429747955 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:444337203664 (413.8 GiB)  TX bytes:559356385312 (520.9 GiB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:<IP Address 1>  P-t-P:<IP Address 1>  Bcast:xx.xxx.xxx.255  Mask:255.255.255.0
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

venet0:1  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:<IP Adress #2>  P-t-P:<IP Address 2>  Bcast:xx.xxx.xxx.255  Mask:255.255.255.0
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
share|improve this question
    
What do you get when you run route -n on the server? –  Robbie Mckennie Jun 13 '13 at 21:21
    
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface xx.xxx.xxx.0 0.0.0.0 255.255.255.0 U 0 0 0 venet0 192.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 venet0 169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 venet0 0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 venet0 Sorry the output on here is weird, pasted it into the question itself –  Rob Jun 13 '13 at 21:24
    
Is that verbatim? (excluding the obfuscation on your ip) I find it rather strange that your default gateway is 0.0.0.0 –  Robbie Mckennie Jun 13 '13 at 21:30
    
Yes it is, it's a VPS, I'm not sure if that makes a difference –  Rob Jun 13 '13 at 21:35
    
Could you post the output of ifconfig -a? Feel free to obfuscate the addresses, i don't need that. –  Robbie Mckennie Jun 13 '13 at 21:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.