Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have created a virtual interface using
ifconfig eth0:1 192.168.50.10 netmask 255.255.255.0 up
Now I'm sending a request to a server via the virtual interface using curl:
curl --interface 192.168.50.10 http://192.168.50.1:8080/myhostedapp
This works fine and my app shows the source ip as 192.168.50.10, but if the server is on a different subnet, and reachable from the physical interface (eth0), the connection times out.
So this works (via the physical interface):
curl http://10.10.50.1:8080/myhostedapp.
But this fails:
curl --interface 192.168.50.10 http://10.10.50.1:8080/myhostedapp.
For 10.10.50.1 to reach 192.168.50.10, I added it to the route table.
What do I need to configure so that 10.10.50.1 is reachable from 192.168.50.10?
You have to set iptunnel you can see this link it would make it more clear, one more thing when you added route you added the route with a gateway.
https://unix.stackexchange.com/questions/44065/linux-networking-routing-to-virtual-ip-addresses-from-a-different-subnet
Thanks & Regards,
Alok Thaker
First off, you shouldn't use ifconfig anymore. It is unmaintained since 10 years or so and known to have some issues, esp. regarding "virtual interfaces".
Better use ip from the iproute2 package.
See also this articles about ifconfig vs. ip and what the replacement commands look like:
Deprecated Linux networking commands and their replacements
iproute2: Life after ifconfig
ifconfig sucks
Now regarding your issue: what does your routing table look like? Please provide the output of ip address show eth0 and ip route show. I suspect your routing table to be the culprit.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I'd like to configure a debian box with multiple ip addresses (in the same subnet) on the same physical NIC in debian, while every address should use it's own network route.
I think it won't be able using ip addr add, but is it possible using pseudo interfaces like eth0:0 ? Or does the linux TCP stack prevent this? And if it's possible, how do I bind multiple default routes to their (pseudo-)interface or ip address? will it be able using iptables roules and with which?
Aliases are not required to do this You can do this with iproute2
ip addr add <ip> dev eth0
you then add routing to a ip specific route table
ip route add subnet dev eth0 table <tableid>
ip route add default via <GATEWAY> table <tableid>
Then add a rule to match the ip so that it uses the specific table
ip rule add from any to <ip> lookup <tableid>
ip route add from <ip> to any lookup <tableid>
This can get pretty confusing because the routing is now multiple routing tables
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
when I put this in the terminal
ifconfig eth0 69.69.69.69
the ip address in the terminal change but in the user interface not, I mean
initial state
my ip is 192.168.10.2
then a put in the terminal
ifconfig eth0 69.69.69.69
and this happens
terminal
properties
As we can see the properties didn't change.
what can I do for change that properties using the terminal or a bash?
You are probably using a Linux distribution that uses the NetworkManager daemon, and during installation it decided that eth0 should be configured via DHCP. So every time you manually setup its IP not using it (from a terminal in your case), NetworkManager will set it up again without noticing you within a few seconds or minutes.
To check if you have indeed NetworkManager running and managing eth0 setup, issue:
ps aux | grep -i networkmanager
If it is indeed running, look for more info about it, from Ubuntu for instance:
https://help.ubuntu.com/community/NetworkManager
...and then google around for "network manager manual setup ip".
PS:
I hate NetworkManager with a deep passion, gave up using it years ago and always uninstall it, managing my interfaces manually and/or the good old /etc/network/interfaces way. Noticeably (in my case) it can be a pure nuisance when multihoming and changing the interfaceS setup frequently. So if this is indeed your problem (90% sure) I can't help you much more with it. NetworkManager is good at managing one interface at a time, with one configuration (ex static or DHCP) for each interface. This satisfy 95% of user cases. But not mine.
i have try this in my computer and i have success
ifconfig eth0 192.168.218.110
if you want to chang the /etc/sysconfig/network-scripts/ifcfg-eth0 to chang the ip.
you can use vim edit chang thhis line:IPADDR=192.168.218.111
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have this routing table:
I used SSH to be able to use my Raspberry Pi on my laptop screen. Everything was fine until I opened my browser and wanted to ping Google in the terminal. I can't, though.
When I try to ping 8.8.8.8 (Google's nameserver), I get the message below the routing table in the image above. But the strange thing is, when I run SSH with PuTTY on a different laptop, the Internet connection is fine. So probably the problem is on my laptop.
How can I fix this issue?
Seems like you are using 192.168.1.1 as a gateway, yet you have configured 192.168.137.0/24 as the network.
You should either try to configure the default gateway to - perhaps - 192.168.137.1 or your IP address to 192.168.1.x.
An ifconfig output would be handy.
Edit:
Add default gateway:
route add default gw 192.168.137.1
You might also need to remove current default gateway(s).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am trying to setup openvpn on a server so that I have 2 different tap interfaces (tap0 and tap1) and then a bridge connecting those interfaces. The idea is that a client on tap0 will be able to talk to a client on tap1 and vice-versa.
There is no physical NIC involved in the bridge and the Bridge interface is setup with no ip/netmask/broadcast.
I am able to ping between the 2 when they are both connected however I see no traffic when trying to tcpdump the bridge interface.
I am a bit confused on some things:
Do I need to have an ip configured on the bridge interface at all? I don't quite see the reason for it as all it will do is to make to virtual interfaces talk to each other
Is the fact that the bridge interface does not have an assigned ip/netmask/broadcast the reason I am not able to see the ping traffic on the bridge interface when tcpdumping that interface?
If the answer to number 2 is Yes, I assume that it is not either possible to use iptables to block/allow traffic on that interface, correct? If so is there any other way to accomplish what one would do with iptables on an interface like that?
I guess this wasn't the proper place to put this question but I thought I'd put an update anyway to close the issue.
Turns out that you do not need an assigned ip address on the bridge and it is possible to tcpdump. I happened to be working in containers which made the traffic go outside the vpn when pinging.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I wish to know my current IP address (as the world sees it) via linux command line. I used ifconfig but it doesn't display the same ip address as is displayed on the website ip-details.com.
is there a way to get the current IP address from command line in linux?
thanks in advance
To find your external IP use the following command
$ dig myip.opendns.com #resolver1.opendns.com +short
This would give your IP as seen by a website
dig command is a DNS lookup utility.
DIG (domain information groper) is a flexible tool for interrogating DNS name servers.
It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried
Are you using a VM (or) you are trying ifconfig from machine directly connected to internet ?
If you are trying from a VM it will not show. You have to try at host machine