Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working with multiple ip #267

Open
adililhan opened this issue Dec 14, 2017 · 1 comment
Open

working with multiple ip #267

adililhan opened this issue Dec 14, 2017 · 1 comment
Labels

Comments

@adililhan
Copy link

adililhan commented Dec 14, 2017

Hi,

I have setup an sniproxy server.

My ip a output is:

root@test:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 56:00:01:4c:0d:c3 brd ff:ff:ff:ff:ff:ff
    inet XX.XX.XX.192/23 brd XX.XX.XX.255 scope global ens3
       valid_lft forever preferred_lft forever
    inet YY.YY.YY.92/23 brd YY.YY.YY.255 scope global ens3:1
       valid_lft forever preferred_lft forever
    inet ZZ.ZZ.ZZZ.210/23 brd ZZ.ZZ.ZZZ.255 scope global ens3:2
       valid_lft forever preferred_lft forever

I send a request to ifconfig.co through ZZ.ZZ.ZZZ.210. However, the IP seems XX.XX.XX.192 on ifconfig.co

It is same when I send request through YY.YY.YY.92. The IP seems ZZ.ZZ.ZZZ.210 on ifconfig.co

If the user come to server through YY.YY.YY.92 then his request should be proxied through YY.YY.YY.92. Is there a way to keep the source interface's IP address?

@adililhan adililhan changed the title work with multiple ip working with multiple ip Dec 14, 2017
@dlundquist
Copy link
Owner

@adililhan You can use multiple listeners, one for each IP you wish to bind to and a source directive on each indicating the outbound IP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants