Add Secondary IP Address That Is Seen By A Server











up vote
0
down vote

favorite












I need to add another IP address and I need the server to be able to know see it.
On the client: curl using the second IP/interface
On the server: netstat or tcpdump



I want to be able to see the second IP address in the server.



Tried ip link add, ip address add, ifconfig. Nothing works. On the server there is always the "main" address of the client.



Everything is on the LAN, no need for DNS, etc..










share|improve this question


















  • 3




    Possible duplicate of How to set up multiple IP addresses?
    – Tom Brossman
    2 days ago















up vote
0
down vote

favorite












I need to add another IP address and I need the server to be able to know see it.
On the client: curl using the second IP/interface
On the server: netstat or tcpdump



I want to be able to see the second IP address in the server.



Tried ip link add, ip address add, ifconfig. Nothing works. On the server there is always the "main" address of the client.



Everything is on the LAN, no need for DNS, etc..










share|improve this question


















  • 3




    Possible duplicate of How to set up multiple IP addresses?
    – Tom Brossman
    2 days ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I need to add another IP address and I need the server to be able to know see it.
On the client: curl using the second IP/interface
On the server: netstat or tcpdump



I want to be able to see the second IP address in the server.



Tried ip link add, ip address add, ifconfig. Nothing works. On the server there is always the "main" address of the client.



Everything is on the LAN, no need for DNS, etc..










share|improve this question













I need to add another IP address and I need the server to be able to know see it.
On the client: curl using the second IP/interface
On the server: netstat or tcpdump



I want to be able to see the second IP address in the server.



Tried ip link add, ip address add, ifconfig. Nothing works. On the server there is always the "main" address of the client.



Everything is on the LAN, no need for DNS, etc..







networking






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 at 22:16









nmnir

1013




1013








  • 3




    Possible duplicate of How to set up multiple IP addresses?
    – Tom Brossman
    2 days ago














  • 3




    Possible duplicate of How to set up multiple IP addresses?
    – Tom Brossman
    2 days ago








3




3




Possible duplicate of How to set up multiple IP addresses?
– Tom Brossman
2 days ago




Possible duplicate of How to set up multiple IP addresses?
– Tom Brossman
2 days ago










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Try this solution as ip isn't persistent:



sudo nmcli con modify "interface_name" +ipv4.addresses 172.16.2.140/24
sudo nmcli con up "interface_name"


Note you change that ip add I added to yours and do this on the client machine.






share|improve this answer























  • Thanks, but it's not working. I read about nmcli and also tried nmcli con add type ethernet con-name static2 ifname enp0s3 ip4 192.168.1.50/24 gw4 192.168.1.1 but the server see the main IP address
    – nmnir
    Nov 22 at 23:04










  • so if you ping that ip add what happens?
    – George Udosen
    Nov 22 at 23:17










  • Pinging works. It also works with other methods. Thats because the icmp that asks "who has the_new_address".
    – nmnir
    Nov 22 at 23:19










  • Did you restart the networkmanager on the server?
    – George Udosen
    Nov 22 at 23:33










  • Also try to ping the client from the server!
    – George Udosen
    Nov 22 at 23:45













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1095229%2fadd-secondary-ip-address-that-is-seen-by-a-server%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Try this solution as ip isn't persistent:



sudo nmcli con modify "interface_name" +ipv4.addresses 172.16.2.140/24
sudo nmcli con up "interface_name"


Note you change that ip add I added to yours and do this on the client machine.






share|improve this answer























  • Thanks, but it's not working. I read about nmcli and also tried nmcli con add type ethernet con-name static2 ifname enp0s3 ip4 192.168.1.50/24 gw4 192.168.1.1 but the server see the main IP address
    – nmnir
    Nov 22 at 23:04










  • so if you ping that ip add what happens?
    – George Udosen
    Nov 22 at 23:17










  • Pinging works. It also works with other methods. Thats because the icmp that asks "who has the_new_address".
    – nmnir
    Nov 22 at 23:19










  • Did you restart the networkmanager on the server?
    – George Udosen
    Nov 22 at 23:33










  • Also try to ping the client from the server!
    – George Udosen
    Nov 22 at 23:45

















up vote
0
down vote













Try this solution as ip isn't persistent:



sudo nmcli con modify "interface_name" +ipv4.addresses 172.16.2.140/24
sudo nmcli con up "interface_name"


Note you change that ip add I added to yours and do this on the client machine.






share|improve this answer























  • Thanks, but it's not working. I read about nmcli and also tried nmcli con add type ethernet con-name static2 ifname enp0s3 ip4 192.168.1.50/24 gw4 192.168.1.1 but the server see the main IP address
    – nmnir
    Nov 22 at 23:04










  • so if you ping that ip add what happens?
    – George Udosen
    Nov 22 at 23:17










  • Pinging works. It also works with other methods. Thats because the icmp that asks "who has the_new_address".
    – nmnir
    Nov 22 at 23:19










  • Did you restart the networkmanager on the server?
    – George Udosen
    Nov 22 at 23:33










  • Also try to ping the client from the server!
    – George Udosen
    Nov 22 at 23:45















up vote
0
down vote










up vote
0
down vote









Try this solution as ip isn't persistent:



sudo nmcli con modify "interface_name" +ipv4.addresses 172.16.2.140/24
sudo nmcli con up "interface_name"


Note you change that ip add I added to yours and do this on the client machine.






share|improve this answer














Try this solution as ip isn't persistent:



sudo nmcli con modify "interface_name" +ipv4.addresses 172.16.2.140/24
sudo nmcli con up "interface_name"


Note you change that ip add I added to yours and do this on the client machine.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 23 at 5:30

























answered Nov 22 at 22:38









George Udosen

18.5k94265




18.5k94265












  • Thanks, but it's not working. I read about nmcli and also tried nmcli con add type ethernet con-name static2 ifname enp0s3 ip4 192.168.1.50/24 gw4 192.168.1.1 but the server see the main IP address
    – nmnir
    Nov 22 at 23:04










  • so if you ping that ip add what happens?
    – George Udosen
    Nov 22 at 23:17










  • Pinging works. It also works with other methods. Thats because the icmp that asks "who has the_new_address".
    – nmnir
    Nov 22 at 23:19










  • Did you restart the networkmanager on the server?
    – George Udosen
    Nov 22 at 23:33










  • Also try to ping the client from the server!
    – George Udosen
    Nov 22 at 23:45




















  • Thanks, but it's not working. I read about nmcli and also tried nmcli con add type ethernet con-name static2 ifname enp0s3 ip4 192.168.1.50/24 gw4 192.168.1.1 but the server see the main IP address
    – nmnir
    Nov 22 at 23:04










  • so if you ping that ip add what happens?
    – George Udosen
    Nov 22 at 23:17










  • Pinging works. It also works with other methods. Thats because the icmp that asks "who has the_new_address".
    – nmnir
    Nov 22 at 23:19










  • Did you restart the networkmanager on the server?
    – George Udosen
    Nov 22 at 23:33










  • Also try to ping the client from the server!
    – George Udosen
    Nov 22 at 23:45


















Thanks, but it's not working. I read about nmcli and also tried nmcli con add type ethernet con-name static2 ifname enp0s3 ip4 192.168.1.50/24 gw4 192.168.1.1 but the server see the main IP address
– nmnir
Nov 22 at 23:04




Thanks, but it's not working. I read about nmcli and also tried nmcli con add type ethernet con-name static2 ifname enp0s3 ip4 192.168.1.50/24 gw4 192.168.1.1 but the server see the main IP address
– nmnir
Nov 22 at 23:04












so if you ping that ip add what happens?
– George Udosen
Nov 22 at 23:17




so if you ping that ip add what happens?
– George Udosen
Nov 22 at 23:17












Pinging works. It also works with other methods. Thats because the icmp that asks "who has the_new_address".
– nmnir
Nov 22 at 23:19




Pinging works. It also works with other methods. Thats because the icmp that asks "who has the_new_address".
– nmnir
Nov 22 at 23:19












Did you restart the networkmanager on the server?
– George Udosen
Nov 22 at 23:33




Did you restart the networkmanager on the server?
– George Udosen
Nov 22 at 23:33












Also try to ping the client from the server!
– George Udosen
Nov 22 at 23:45






Also try to ping the client from the server!
– George Udosen
Nov 22 at 23:45




















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1095229%2fadd-secondary-ip-address-that-is-seen-by-a-server%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

數位音樂下載

When can things happen in Etherscan, such as the picture below?

格利澤436b