Linux Ip Routing

anonymous

Newbie
Joined
Dec 17, 2007
Messages
32
Reaction score
0
I have one vps with multiple internet ip(virtual ethernet interfaces; eth0:0 and eth0:1 ) but i can only use one ip when i use as ssh tunneling(outgoing connections).
Solution is ip routing but it seems complicated.
Is there anyone explain step by step please ?
 
This should work:

route add -host xxx.xxx.xxx.xxx dev eth0:1

The x's refer to the IP address of the destination - NOT your IP address. You need to replace eth0:1 with the device you want for all outgoing traffic. All traffic going to host xxx.xxx.xxx.xxx will appear to be coming from whatever IP address is bound to eth0:1
 
This should work:

route add -host xxx.xxx.xxx.xxx dev eth0:1

The x's refer to the IP address of the destination - NOT your IP address. You need to replace eth0:1 with the device you want for all outgoing traffic. All traffic going to host xxx.xxx.xxx.xxx will appear to be coming from whatever IP address is bound to eth0:1

Thank you very much this works but what i exactly want to do is;
assume
eth0:0 has ip 111.111.111.111
eth0:1 has ip 222.222.222.222

if i open ssh to 111.111.111.111 then i want outgoing connections will be 111.111.111.111, and if i open ssh to 222.222.222.222 then i want outgoing connections will be 222.222.222.222.
(but now when i open ssh to 222.222.222.222, outgoing connections are from 111.111.111.111, this is the problem i have )
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock