I am trying to access a linux system which is connected to OpenVPN connection.
In my case the global Ip for VPN connection using tun1 interface is x.x.x.x. The global Ip when not connected to VPN and using only ethernet using eth0 interface is y.y.y.y.
I am routing all the traffic to the VPN NIC(tun1 in my case). I want to use the y.y.y.y IP to SSH in to my computer when it is connected to the VPN. I have port forwarded in my router to local IP and it is working correctly when not connected to the VPN.
I have tried adding the following in the routing table,
route add -host "dynamicdnssite.com" gw 192.168.0.1 dev eth0
dynamicdnssite.com- redirects to my global IP y.y.y.y
192.168.0.1 - Local Ip of my router
But it is not working as it routes only the outgoing connection and I want to route the incoming connection on certain port.
I found this myself. You have to be connected to the same VPN which you are accessing and connect with the ethernet's global IP(y.y.y.y in my case).
Related
I tried to connect to an IIS from WiFi but I couldn't although I succeeded connecting to it while that device was connecting to the router via LAN.
How should I change the router settings to connect to other devices localhost when all the devices are connected to the router via WiFi?
Router model: TP-link TD-W8901N
As far as I know, without using the DNS server, you couldn't access the web sites by using localhost url.
The only way you could access the site is using the ip address and the right port number.
You could firstly run ipconfig in the cmd tool on the IIS server.
Then you will record the IP address and the site's port number.
At last, you could use the IP address and the site prot number to access the sites.
Thr url like this: http://192.168.1.3:8098
I had create a new VPS instance in GCP successfully. Logged in via ssh and take root access. My commands to setting up a tun1 interface was successfull done:
ip tunnel del tun1
ip tunnel add tun1 mode gre remote xxx.xxx.xxx.xx local xx.xxx.xxx.xxx ttl 255
ip link set tun1 up
ip link set tun1 mtu 1360
ip addr add xxx.xxx.xxx.xx/32 dev lo
ip r add xxx.xxx.xxx.x/32 dev tun1
ip route add default via xxx.xxx.xxx.x dev tun1 table 200
ip rule add from xxx.xxx.xxx.xx table 200
If I check with lsmode | grep gre, I see
# lsmod | grep tun
tun 31740 0
ip_tunnel 25163 1 ip_gre
I try also:
# modprobe ip_tunnel
# modprobe gre
#
No results be displayed.
If everything is okay, I should be able to access my server with the external dedicated IP xxx.xxx.xxx.xx (it is a Cloud DNS system).
Push, could anybody out there help me ?
Unfortunately Google doesn't allow GRE traffic.
See here:
https://cloud.google.com/vpc/docs/firewalls#blockedtraffic
Always blocked traffic Google Cloud always blocks the traffic that is
described in the following table. Your firewall rules cannot be used
to allow any of this traffic.
Always blocked traffic Applies to GRE traffic All sources and
destinations, whether the source or destination is an internal IP
address or an external IP address.
This is now supported.
External IPv4 and IPv6 addresses only accept TCP, UDP, ICMP, IPIP, AH, ESP, SCTP, and GRE packets. Resources that use external IP addresses impose additional protocol restrictions:
Forwarding rules for protocol forwarding, external HTTP(S) Load Balancing, External SSL Proxy Load Balancing, External TCP Proxy Load Balancing, and Network Load Balancing only process the protocols and ports configured on the forwarding rule.
Cloud VPN gateways only accept VPN protocols.
I have Linux host with libvirt/kvm virtualization, VMs needs the "real" static IP addresses, so I decided to setup bridged network. I make br0 on the host and in the VMs properties I set source device: Host device vnet0(Bridge 'br0').
For example, my br0 have ip 192.168.1.1 and one of the VM have 192.168.1.5
Everything works pretty well, but then I connect to the virtual machine, the client address detects as 192.168.1.1. Also, all the HTTP requests comes from 192.168.1.1.
Q: Is it my mistake, some sort of misconfiguration? How can VM get the real IPs of the clients?
Let me try to answer based on what i infer from your question:
Since you want to assign routable IP addresses to the VMs,
Option 1: Add the host physical ethernet interface to the vswitch (aka vswitch uplink). Further, for all the VM ethernet interface, assign IP address in the same subnet in which the physical ethernet interface's IP belongs. Alternatively, if DHCP server is running in the same broadcast domain (subnet), the VMs would get the IP from the DHCP server if the interfaces are configured to get IP via DHCP
Option 2: Create the vswitch and assign X.Y.Z.1 IP to the vswitch (br0). Also enable IP forwarding in the host. Now you can assign IPs from the same subnet to the VM ethernet interfaces. Alternatively, you can run DHCP (e.g. DNSmasq) on br0 and assign IPs to the VM interfaces
Is it my mistake, some sort of misconfiguration? How can VM get the real IPs of the clients?
If you are connecting from the host on which your vms are running, then they are getting the real IP address. Your host shares a network (192.168.1.0/24 or similar, apparently) with the virtual machines. When you connect to your virtual machines from your host, the source address if 192.168.1.1.
If you are connecting from elsewhere on your network, you would need to provide us with more details of your configuration.
I am running a webserver (eg: tomcat7) in vmplayer guest, with NAT and I am able to view the webserver from guest using it's hostname:port but host browser is unable to connect to this webserver. Any idea? Is there any specific network configuration that needs to be done for host to connect to guest?
Note: I used ifconfig and got ip address from eth8, but ping request times out all the time.
VMWARE player network settings screenshot
Update
I also had to add entries in both machines hosts file for DNS
Change the network settings to use Bridged. That will connect to your router and get an IP off DHCP which your Host will be able to see. NAT is using your host address.
How would I get the LAN IP of a user connected to my node.js app ?
I can get the WAN IP, but not sure how to get the LAN IP. I tried this
How can I get the local IP address in Node.js?
but all it does is give the LAN IP of the machine the node app is running on.