0

I have a home server with several programs with web interfaces running on it.

I want to access all these web interfaces from outside my local network.

I also have a program I want to go through a vpn.

My vpn only allows one port to be forwarded however so I can't access all my web interfaces through the vpn from outside my network.

This program however allows me to bind it to an ipv4 address.

so what i want to do is somehow give my computer a second ip on my local network, make traffic on one of those ips go through my vpn, have traffic go through the non-vpn ip by default, and bind the one sensitive program to the vpn connected interface.

I currently have a workaround in place by running a virtual machine with the one sensitive program on it and it connected through vpn but that wastes resources and has a drawback. this sensitive program has a web interface as well which currently is unreachable from outside my local network. but if I am able to have different ip addresses I should be able to bind the web interface to the non-vpn but transfer the data through the vpn. any ideas on how to do this or perhaps a simpler way to solve my problem?

1 Answer 1

1

Basicall, you can configure a virtual network interface at command line (only without NetworkManager):

$ ifconfig eth0:1 192.168.177.52

If you do not use NetworkManager, you can create additional devices with :1, :2 and so on appended to the interface name in /etc/network/interfaces, so for example eth0 and then eth0:1, eth0:2, and so on. These will be displayed with ifconfig.

If you say "Ubuntu", I guess you are using NetworkManager. By use of any graphical tool for KDE or GNOME or by editing the file /etc/NetworkManager/system-connections/YOURLANCONNECTION, you can append several IP addresses.

I show you an excerpt of mine here (it is generated with the GNOME nm-applet):

[ipv4]
method=manual
dns=194.165.52.198;194.165.52.199;10.21.65.8;
dns-search=
address1=192.168.177.50/24,192.168.177.1
address2=10.21.65.206/24
address3=10.21.70.206/24
route1=192.168.10.0/24,192.168.177.1,1
route2=192.168.177.0/24,192.168.177.1,1
route3=10.21.65.0/24,0.0.0.0,1
ignore-auto-routes=true
ignore-auto-dns=true

As you can see, my PC has three different IPv4 addresses on the same interface. The interfaces are not listed with ifconfig.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .