Quote:
Originally Posted by KFC123
But it seems fail for 1.2.3.5. Is it possible to have two ip binding to eth0?
|
What is it that is failing with 1.2.3.5?
Anyway, yes, it should be possible to define a sub-interface, e.g.:
Code:
ifconfig eth0:1 1.2.3.5 netmask 255.255.255.0
There may be a problem with the routing rule - if you defined 1.2.3.1 as the default gateway, then the internet would no longer be reachable via your other ip address. You'd probably have to add a specific static route for the computer / network from which SSH access is needed, e.g.
Code:
route add -net 80.254.3.24 netmask 255.255.255.248 gw 1.2.3.1
... would add a route to the network 80.254.3.24/29 (address and mask picked at random), via 1.2.3.1. The machine should choose the most specific route when making routing decisions (so should route all traffic to that address range via 1.2.3.1, but all other traffic should still go via the default gateway).
Hope this helps,
Rob