Two network interfaces with unique public IPs simultaneously

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • magnus
    Junior Member
    • Sep 2024
    • 1

    Two network interfaces with unique public IPs simultaneously

    Hello,
    For a specific reason I need two network interfaces connected to NordVPN servers working at the same time using OpenVPN on Ubuntu server.

    I already have two extra network interfaces setup for this purpose (3 in total) with local IP eth1 eg 10.56.1.15/24 and eth2 eg 10.56.1.16/24.

    Config for first interface us4970.conf:

    Code:
    client
    dev tun
    proto udp
    remote 138.199.9.134 1194
    resolv-retry infinite
    remote-random
    [B]#nobind[/B]
    tun-mtu 1500
    tun-mtu-extra 32
    mssfix 1450
    persist-key
    persist-tun
    ping 15
    ping-restart 0
    ping-timer-rem
    reneg-sec 0
    comp-lzo no
    verify-x509-name CN=us4970.nordvpn.com
    [B]local 10.56.1.15
    ifconfig 10.100.0.2 255.255.255.0[/B]
    
    remote-cert-tls server
    
    auth-user-pass /path/to/auth (with login credfntials)
    verb 3
    pull
    fast-io
    cipher AES-256-CBC
    auth SHA512
    <ca>
    -----BEGIN CERTIFICATE-----
    **cert removed in example**
    -----END CERTIFICATE-----
    </ca>
    key-direction 1
    <tls-auth>
    #
    # 2048 bit OpenVPN static key
    #
    -----BEGIN OpenVPN Static key V1-----
    **key removed in example**
    -----END OpenVPN Static key V1-----
    </tls-auth>
    Config for second interface us4980.conf:

    Code:
    client
    dev tun
    proto udp
    remote 212.102.40.57 1194
    resolv-retry infinite
    remote-random
    [B]#nobind[/B]
    tun-mtu 1500
    tun-mtu-extra 32
    mssfix 1450
    persist-key
    persist-tun
    ping 15
    ping-restart 0
    ping-timer-rem
    reneg-sec 0
    comp-lzo no
    verify-x509-name CN=us4980.nordvpn.com
    [B]local 10.56.1.16
    ifconfig 10.101.0.2 255.255.255.0[/B]
    
    remote-cert-tls server
    
    auth-user-pass /path/to/auth (with login credfntials)
    verb 3
    pull
    fast-io
    cipher AES-256-CBC
    auth SHA512
    <ca>
    -----BEGIN CERTIFICATE-----
    **cert removed in example**
    -----END CERTIFICATE-----
    </ca>
    key-direction 1
    <tls-auth>
    #
    # 2048 bit OpenVPN static key
    #
    -----BEGIN OpenVPN Static key V1-----
    **key removed in example**
    -----END OpenVPN Static key V1-----
    </tls-auth>​


    tun0 connects to internet and shows correct IP from NordVPN servers.
    tun1 shows a totally different IP than what should be shown from the config and doesn't connect to the internet.

    I must be missing some steps or du anyone of you have a clue what I'm doing wrong here? From what I've found so far they should be using different ports but when trying to change config nr2 to eg 1195 it wont connect/start service.

    Thanks in advance, cheers
Working...
😀
😂
🥰
😘
🤢
😎
😞
😡
👍
👎