create one thousand macvlan , ping local ip failedIPv6 works only after ping to routing boxDL380 G7: Not able to access ILO on DL380 via ssh from a clientPing (DUP) with Linux bridges and tap devicesweird bridge issue in KVMKVM Ubuntu Guest cannot connect to the internet on bridged networkingUsing my IPs on OVH server via GREGetting chunks of high ms when pinging local / external IP addresses?Is it possible to ssh or rsync into a system whose file-system has remounted itself read-only?Ping inconsistent but works just to different addressIPv6 routing with duplicated route entries
Does the average primeness of natural numbers tend to zero?
How to create a consistant feel for character names in a fantasy setting?
I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine
Some basic questions on halt and move in Turing machines
Doomsday-clock for my fantasy planet
Information to fellow intern about hiring?
Can a planet have a different gravitational pull depending on its location in orbit around its sun?
Is it true that "The augmented fourth (A4) and the diminished fifth (d5) are the only aug and dim intervals that appear in diatonic scales"
Manga about a female worker who got dragged into another world together with this high school girl and she was just told she's not needed anymore
What is GPS' 19 year rollover and does it present a cybersecurity issue?
How to move the player while also allowing forces to affect it
Shall I use personal or official e-mail account when registering to external websites for work purpose?
Symmetry in quantum mechanics
When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?
Latin words with no plurals in English
Why is making salt water prohibited on Shabbat?
Crop image to path created in TikZ?
New order #4: World
Sort in WP_Query(), not filter? Is it possible?
Can I find out the caloric content of bread by dehydrating it?
Travelling to Edinburgh from India
How to deal with fear of taking dependencies
Email Account under attack (really) - anything I can do?
Need help identifying/translating a plaque in Tangier, Morocco
create one thousand macvlan , ping local ip failed
IPv6 works only after ping to routing boxDL380 G7: Not able to access ILO on DL380 via ssh from a clientPing (DUP) with Linux bridges and tap devicesweird bridge issue in KVMKVM Ubuntu Guest cannot connect to the internet on bridged networkingUsing my IPs on OVH server via GREGetting chunks of high ms when pinging local / external IP addresses?Is it possible to ssh or rsync into a system whose file-system has remounted itself read-only?Ping inconsistent but works just to different addressIPv6 routing with duplicated route entries
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I want to create 1000 macvlan
with diffrent ip. And use ip rule
routing different public ip to internet with multiple interfaces.
First create 1000 macvlan:
ip link add link eth0 address %02x:%02x:%02x:%02x:%02x:%02x eth0_%d type macvlan
%02x is mac address, %d is 0-999.
Then use ifconfig set each macvlan different public ip. At last, use ip rule:
ip route add default via $router dev $interface src $ip table $interfaceidx
ip rule add from $ip table $interfaceidx
each macvlan will add a rule, and a table.
Use the other server ping any macvlan ip is ok.
root@ubuntu:/tmp# ping 222.217.107.102
PING 222.217.107.102 (222.217.107.102) 56(84) bytes of data.
64 bytes from 222.217.107.102: icmp_seq=1 ttl=56 time=57.5 ms
64 bytes from 222.217.107.102: icmp_seq=2 ttl=56 time=58.0 ms
64 bytes from 222.217.107.102: icmp_seq=3 ttl=56 time=60.1 ms
64 bytes from 222.217.107.102: icmp_seq=4 ttl=56 time=57.5 ms
But ping macvlan in host will drop packet:
[root@localhost ~]# ping 222.217.107.102
PING 222.217.107.102 (222.217.107.102) 56(84) bytes of data.
64 bytes from 222.217.107.102: icmp_seq=1 ttl=64 time=0.124 ms
ping: sendmsg: Invalid argument
64 bytes from 222.217.107.102: icmp_seq=3 ttl=64 time=0.049 ms
ping: sendmsg: Invalid argument
ping 127.0.0.1 will also drop packet:
[root@localhost ~]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
ping: sendmsg: Invalid argument
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.050 ms
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.061 ms
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I think my routeing table is ok. Other pc ping is ok.Modern Linux kernels has support for 4294967295 table ids, implemented as rtnetlink attribute RTA_TABLE with 32 bit length. https://bird.network.cz/pipermail/bird-users/2013-November/008706.html
327654: from 113.15.163.120 lookup 1429
327655: from 113.15.163.121 lookup 1511
327656: from 113.15.163.122 lookup 1522
327657: from 113.15.163.123 lookup 1186
327658: from 113.15.163.125 lookup 1513
327659: from 113.15.163.124 lookup 1190
327660: from all lookup main
327670: from all lookup default
linux networking linux-networking linux-kernel
New contributor
add a comment |
I want to create 1000 macvlan
with diffrent ip. And use ip rule
routing different public ip to internet with multiple interfaces.
First create 1000 macvlan:
ip link add link eth0 address %02x:%02x:%02x:%02x:%02x:%02x eth0_%d type macvlan
%02x is mac address, %d is 0-999.
Then use ifconfig set each macvlan different public ip. At last, use ip rule:
ip route add default via $router dev $interface src $ip table $interfaceidx
ip rule add from $ip table $interfaceidx
each macvlan will add a rule, and a table.
Use the other server ping any macvlan ip is ok.
root@ubuntu:/tmp# ping 222.217.107.102
PING 222.217.107.102 (222.217.107.102) 56(84) bytes of data.
64 bytes from 222.217.107.102: icmp_seq=1 ttl=56 time=57.5 ms
64 bytes from 222.217.107.102: icmp_seq=2 ttl=56 time=58.0 ms
64 bytes from 222.217.107.102: icmp_seq=3 ttl=56 time=60.1 ms
64 bytes from 222.217.107.102: icmp_seq=4 ttl=56 time=57.5 ms
But ping macvlan in host will drop packet:
[root@localhost ~]# ping 222.217.107.102
PING 222.217.107.102 (222.217.107.102) 56(84) bytes of data.
64 bytes from 222.217.107.102: icmp_seq=1 ttl=64 time=0.124 ms
ping: sendmsg: Invalid argument
64 bytes from 222.217.107.102: icmp_seq=3 ttl=64 time=0.049 ms
ping: sendmsg: Invalid argument
ping 127.0.0.1 will also drop packet:
[root@localhost ~]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
ping: sendmsg: Invalid argument
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.050 ms
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.061 ms
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I think my routeing table is ok. Other pc ping is ok.Modern Linux kernels has support for 4294967295 table ids, implemented as rtnetlink attribute RTA_TABLE with 32 bit length. https://bird.network.cz/pipermail/bird-users/2013-November/008706.html
327654: from 113.15.163.120 lookup 1429
327655: from 113.15.163.121 lookup 1511
327656: from 113.15.163.122 lookup 1522
327657: from 113.15.163.123 lookup 1186
327658: from 113.15.163.125 lookup 1513
327659: from 113.15.163.124 lookup 1190
327660: from all lookup main
327670: from all lookup default
linux networking linux-networking linux-kernel
New contributor
are you sure interfaceidx didn't interact with standard routing tables local (255), main (254) and (usually unused) default (253) ? What is the range of $interfaceidx?
– A.B
Apr 4 at 22:23
I am sure routeing can larger than 255. Modern Linux kernels has support for 4294967295 table ids, implemented as rtnetlink attribute RTA_TABLE with 32 bit length.
– jianxi sun
Apr 4 at 22:31
yes but did you write into the existing tables with fixed values 253,254,255? That is why I was asking what was the range but you didn't answer my question. Just add 1000 to the table value in your loop to be sure to not touch those.
– A.B
Apr 4 at 23:20
add a comment |
I want to create 1000 macvlan
with diffrent ip. And use ip rule
routing different public ip to internet with multiple interfaces.
First create 1000 macvlan:
ip link add link eth0 address %02x:%02x:%02x:%02x:%02x:%02x eth0_%d type macvlan
%02x is mac address, %d is 0-999.
Then use ifconfig set each macvlan different public ip. At last, use ip rule:
ip route add default via $router dev $interface src $ip table $interfaceidx
ip rule add from $ip table $interfaceidx
each macvlan will add a rule, and a table.
Use the other server ping any macvlan ip is ok.
root@ubuntu:/tmp# ping 222.217.107.102
PING 222.217.107.102 (222.217.107.102) 56(84) bytes of data.
64 bytes from 222.217.107.102: icmp_seq=1 ttl=56 time=57.5 ms
64 bytes from 222.217.107.102: icmp_seq=2 ttl=56 time=58.0 ms
64 bytes from 222.217.107.102: icmp_seq=3 ttl=56 time=60.1 ms
64 bytes from 222.217.107.102: icmp_seq=4 ttl=56 time=57.5 ms
But ping macvlan in host will drop packet:
[root@localhost ~]# ping 222.217.107.102
PING 222.217.107.102 (222.217.107.102) 56(84) bytes of data.
64 bytes from 222.217.107.102: icmp_seq=1 ttl=64 time=0.124 ms
ping: sendmsg: Invalid argument
64 bytes from 222.217.107.102: icmp_seq=3 ttl=64 time=0.049 ms
ping: sendmsg: Invalid argument
ping 127.0.0.1 will also drop packet:
[root@localhost ~]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
ping: sendmsg: Invalid argument
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.050 ms
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.061 ms
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I think my routeing table is ok. Other pc ping is ok.Modern Linux kernels has support for 4294967295 table ids, implemented as rtnetlink attribute RTA_TABLE with 32 bit length. https://bird.network.cz/pipermail/bird-users/2013-November/008706.html
327654: from 113.15.163.120 lookup 1429
327655: from 113.15.163.121 lookup 1511
327656: from 113.15.163.122 lookup 1522
327657: from 113.15.163.123 lookup 1186
327658: from 113.15.163.125 lookup 1513
327659: from 113.15.163.124 lookup 1190
327660: from all lookup main
327670: from all lookup default
linux networking linux-networking linux-kernel
New contributor
I want to create 1000 macvlan
with diffrent ip. And use ip rule
routing different public ip to internet with multiple interfaces.
First create 1000 macvlan:
ip link add link eth0 address %02x:%02x:%02x:%02x:%02x:%02x eth0_%d type macvlan
%02x is mac address, %d is 0-999.
Then use ifconfig set each macvlan different public ip. At last, use ip rule:
ip route add default via $router dev $interface src $ip table $interfaceidx
ip rule add from $ip table $interfaceidx
each macvlan will add a rule, and a table.
Use the other server ping any macvlan ip is ok.
root@ubuntu:/tmp# ping 222.217.107.102
PING 222.217.107.102 (222.217.107.102) 56(84) bytes of data.
64 bytes from 222.217.107.102: icmp_seq=1 ttl=56 time=57.5 ms
64 bytes from 222.217.107.102: icmp_seq=2 ttl=56 time=58.0 ms
64 bytes from 222.217.107.102: icmp_seq=3 ttl=56 time=60.1 ms
64 bytes from 222.217.107.102: icmp_seq=4 ttl=56 time=57.5 ms
But ping macvlan in host will drop packet:
[root@localhost ~]# ping 222.217.107.102
PING 222.217.107.102 (222.217.107.102) 56(84) bytes of data.
64 bytes from 222.217.107.102: icmp_seq=1 ttl=64 time=0.124 ms
ping: sendmsg: Invalid argument
64 bytes from 222.217.107.102: icmp_seq=3 ttl=64 time=0.049 ms
ping: sendmsg: Invalid argument
ping 127.0.0.1 will also drop packet:
[root@localhost ~]# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
ping: sendmsg: Invalid argument
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.050 ms
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.061 ms
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I think my routeing table is ok. Other pc ping is ok.Modern Linux kernels has support for 4294967295 table ids, implemented as rtnetlink attribute RTA_TABLE with 32 bit length. https://bird.network.cz/pipermail/bird-users/2013-November/008706.html
327654: from 113.15.163.120 lookup 1429
327655: from 113.15.163.121 lookup 1511
327656: from 113.15.163.122 lookup 1522
327657: from 113.15.163.123 lookup 1186
327658: from 113.15.163.125 lookup 1513
327659: from 113.15.163.124 lookup 1190
327660: from all lookup main
327670: from all lookup default
linux networking linux-networking linux-kernel
linux networking linux-networking linux-kernel
New contributor
New contributor
edited Apr 4 at 22:34
jianxi sun
New contributor
asked Apr 4 at 22:13
jianxi sunjianxi sun
63
63
New contributor
New contributor
are you sure interfaceidx didn't interact with standard routing tables local (255), main (254) and (usually unused) default (253) ? What is the range of $interfaceidx?
– A.B
Apr 4 at 22:23
I am sure routeing can larger than 255. Modern Linux kernels has support for 4294967295 table ids, implemented as rtnetlink attribute RTA_TABLE with 32 bit length.
– jianxi sun
Apr 4 at 22:31
yes but did you write into the existing tables with fixed values 253,254,255? That is why I was asking what was the range but you didn't answer my question. Just add 1000 to the table value in your loop to be sure to not touch those.
– A.B
Apr 4 at 23:20
add a comment |
are you sure interfaceidx didn't interact with standard routing tables local (255), main (254) and (usually unused) default (253) ? What is the range of $interfaceidx?
– A.B
Apr 4 at 22:23
I am sure routeing can larger than 255. Modern Linux kernels has support for 4294967295 table ids, implemented as rtnetlink attribute RTA_TABLE with 32 bit length.
– jianxi sun
Apr 4 at 22:31
yes but did you write into the existing tables with fixed values 253,254,255? That is why I was asking what was the range but you didn't answer my question. Just add 1000 to the table value in your loop to be sure to not touch those.
– A.B
Apr 4 at 23:20
are you sure interfaceidx didn't interact with standard routing tables local (255), main (254) and (usually unused) default (253) ? What is the range of $interfaceidx?
– A.B
Apr 4 at 22:23
are you sure interfaceidx didn't interact with standard routing tables local (255), main (254) and (usually unused) default (253) ? What is the range of $interfaceidx?
– A.B
Apr 4 at 22:23
I am sure routeing can larger than 255. Modern Linux kernels has support for 4294967295 table ids, implemented as rtnetlink attribute RTA_TABLE with 32 bit length.
– jianxi sun
Apr 4 at 22:31
I am sure routeing can larger than 255. Modern Linux kernels has support for 4294967295 table ids, implemented as rtnetlink attribute RTA_TABLE with 32 bit length.
– jianxi sun
Apr 4 at 22:31
yes but did you write into the existing tables with fixed values 253,254,255? That is why I was asking what was the range but you didn't answer my question. Just add 1000 to the table value in your loop to be sure to not touch those.
– A.B
Apr 4 at 23:20
yes but did you write into the existing tables with fixed values 253,254,255? That is why I was asking what was the range but you didn't answer my question. Just add 1000 to the table value in your loop to be sure to not touch those.
– A.B
Apr 4 at 23:20
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
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',
autoActivateHeartbeat: false,
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
);
);
jianxi sun is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f961596%2fcreate-one-thousand-macvlan-ping-local-ip-failed%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
jianxi sun is a new contributor. Be nice, and check out our Code of Conduct.
jianxi sun is a new contributor. Be nice, and check out our Code of Conduct.
jianxi sun is a new contributor. Be nice, and check out our Code of Conduct.
jianxi sun is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f961596%2fcreate-one-thousand-macvlan-ping-local-ip-failed%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
are you sure interfaceidx didn't interact with standard routing tables local (255), main (254) and (usually unused) default (253) ? What is the range of $interfaceidx?
– A.B
Apr 4 at 22:23
I am sure routeing can larger than 255. Modern Linux kernels has support for 4294967295 table ids, implemented as rtnetlink attribute RTA_TABLE with 32 bit length.
– jianxi sun
Apr 4 at 22:31
yes but did you write into the existing tables with fixed values 253,254,255? That is why I was asking what was the range but you didn't answer my question. Just add 1000 to the table value in your loop to be sure to not touch those.
– A.B
Apr 4 at 23:20