what modules should be loaded if I want to route eth0 to wlan0 use nftables?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I want to share my internet of eth0 to the wlan0. So I followed this tutorial:
https://wiki.archlinux.org/index.php/Internet_sharing



my Kernel version is 4.1.15



The modules I already have loaded are:



nft_chain_nat_ipv4, nft_nat, nft_masq, nf_tables_ipv4


I set /proc/sys/net/ipv4/ip_forward as 1 as well.



Then:



nft add table ip nat
nft add chain ip nat prerouting type nat hook prerouting priority 0 ;
nft add chain ip nat postrouting type nat hook postrouting priority 100 ;


worked fine. nft list table nat also shows the NAT table.



Then:



nft add rule nat postrouting oifname eth0 masquerade


shows



<cmdline>:1:1-49 Error: could not process rule: No such file or directory


It seems I have to load another module? Or what did I do wrong?



update: I solved the problem myself. It seems the modprobe is very intelligent and every dependencies should be loaded automatically.



My problem was: the folder name of the module under /lib/modules is xxx-yyy. But my the uname -r on my pc shows xxx. So I changed the name of the folder from xxx-yyy to xxx. Everything works fine now.







share|improve this question






















  • It is probably easier doing bridging.
    – Rui F Ribeiro
    Jan 4 at 12:26










  • @RuiFRibeiro Hi. I already successfully did it with bridging. But just want to know how to do it with NAT
    – J.R.
    Jan 4 at 12:30










  • Why NAT? Do routing between internal networks.
    – Rui F Ribeiro
    Jan 4 at 12:33










  • @RuiFRibeiro Cause I want a static address for the wlan0, which can only be done with NAT. If I bridge them, I cannot visit the device with a static ip.
    – J.R.
    Jan 4 at 12:39










  • make sure that the iptable_nat module is unloaded, and what will happen if you remove the oifname eth0 section from the command.
    – Rabin
    Jan 4 at 14:14














up vote
0
down vote

favorite












I want to share my internet of eth0 to the wlan0. So I followed this tutorial:
https://wiki.archlinux.org/index.php/Internet_sharing



my Kernel version is 4.1.15



The modules I already have loaded are:



nft_chain_nat_ipv4, nft_nat, nft_masq, nf_tables_ipv4


I set /proc/sys/net/ipv4/ip_forward as 1 as well.



Then:



nft add table ip nat
nft add chain ip nat prerouting type nat hook prerouting priority 0 ;
nft add chain ip nat postrouting type nat hook postrouting priority 100 ;


worked fine. nft list table nat also shows the NAT table.



Then:



nft add rule nat postrouting oifname eth0 masquerade


shows



<cmdline>:1:1-49 Error: could not process rule: No such file or directory


It seems I have to load another module? Or what did I do wrong?



update: I solved the problem myself. It seems the modprobe is very intelligent and every dependencies should be loaded automatically.



My problem was: the folder name of the module under /lib/modules is xxx-yyy. But my the uname -r on my pc shows xxx. So I changed the name of the folder from xxx-yyy to xxx. Everything works fine now.







share|improve this question






















  • It is probably easier doing bridging.
    – Rui F Ribeiro
    Jan 4 at 12:26










  • @RuiFRibeiro Hi. I already successfully did it with bridging. But just want to know how to do it with NAT
    – J.R.
    Jan 4 at 12:30










  • Why NAT? Do routing between internal networks.
    – Rui F Ribeiro
    Jan 4 at 12:33










  • @RuiFRibeiro Cause I want a static address for the wlan0, which can only be done with NAT. If I bridge them, I cannot visit the device with a static ip.
    – J.R.
    Jan 4 at 12:39










  • make sure that the iptable_nat module is unloaded, and what will happen if you remove the oifname eth0 section from the command.
    – Rabin
    Jan 4 at 14:14












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I want to share my internet of eth0 to the wlan0. So I followed this tutorial:
https://wiki.archlinux.org/index.php/Internet_sharing



my Kernel version is 4.1.15



The modules I already have loaded are:



nft_chain_nat_ipv4, nft_nat, nft_masq, nf_tables_ipv4


I set /proc/sys/net/ipv4/ip_forward as 1 as well.



Then:



nft add table ip nat
nft add chain ip nat prerouting type nat hook prerouting priority 0 ;
nft add chain ip nat postrouting type nat hook postrouting priority 100 ;


worked fine. nft list table nat also shows the NAT table.



Then:



nft add rule nat postrouting oifname eth0 masquerade


shows



<cmdline>:1:1-49 Error: could not process rule: No such file or directory


It seems I have to load another module? Or what did I do wrong?



update: I solved the problem myself. It seems the modprobe is very intelligent and every dependencies should be loaded automatically.



My problem was: the folder name of the module under /lib/modules is xxx-yyy. But my the uname -r on my pc shows xxx. So I changed the name of the folder from xxx-yyy to xxx. Everything works fine now.







share|improve this question














I want to share my internet of eth0 to the wlan0. So I followed this tutorial:
https://wiki.archlinux.org/index.php/Internet_sharing



my Kernel version is 4.1.15



The modules I already have loaded are:



nft_chain_nat_ipv4, nft_nat, nft_masq, nf_tables_ipv4


I set /proc/sys/net/ipv4/ip_forward as 1 as well.



Then:



nft add table ip nat
nft add chain ip nat prerouting type nat hook prerouting priority 0 ;
nft add chain ip nat postrouting type nat hook postrouting priority 100 ;


worked fine. nft list table nat also shows the NAT table.



Then:



nft add rule nat postrouting oifname eth0 masquerade


shows



<cmdline>:1:1-49 Error: could not process rule: No such file or directory


It seems I have to load another module? Or what did I do wrong?



update: I solved the problem myself. It seems the modprobe is very intelligent and every dependencies should be loaded automatically.



My problem was: the folder name of the module under /lib/modules is xxx-yyy. But my the uname -r on my pc shows xxx. So I changed the name of the folder from xxx-yyy to xxx. Everything works fine now.









share|improve this question













share|improve this question




share|improve this question








edited Jan 4 at 14:33

























asked Jan 4 at 12:24









J.R.

177




177











  • It is probably easier doing bridging.
    – Rui F Ribeiro
    Jan 4 at 12:26










  • @RuiFRibeiro Hi. I already successfully did it with bridging. But just want to know how to do it with NAT
    – J.R.
    Jan 4 at 12:30










  • Why NAT? Do routing between internal networks.
    – Rui F Ribeiro
    Jan 4 at 12:33










  • @RuiFRibeiro Cause I want a static address for the wlan0, which can only be done with NAT. If I bridge them, I cannot visit the device with a static ip.
    – J.R.
    Jan 4 at 12:39










  • make sure that the iptable_nat module is unloaded, and what will happen if you remove the oifname eth0 section from the command.
    – Rabin
    Jan 4 at 14:14
















  • It is probably easier doing bridging.
    – Rui F Ribeiro
    Jan 4 at 12:26










  • @RuiFRibeiro Hi. I already successfully did it with bridging. But just want to know how to do it with NAT
    – J.R.
    Jan 4 at 12:30










  • Why NAT? Do routing between internal networks.
    – Rui F Ribeiro
    Jan 4 at 12:33










  • @RuiFRibeiro Cause I want a static address for the wlan0, which can only be done with NAT. If I bridge them, I cannot visit the device with a static ip.
    – J.R.
    Jan 4 at 12:39










  • make sure that the iptable_nat module is unloaded, and what will happen if you remove the oifname eth0 section from the command.
    – Rabin
    Jan 4 at 14:14















It is probably easier doing bridging.
– Rui F Ribeiro
Jan 4 at 12:26




It is probably easier doing bridging.
– Rui F Ribeiro
Jan 4 at 12:26












@RuiFRibeiro Hi. I already successfully did it with bridging. But just want to know how to do it with NAT
– J.R.
Jan 4 at 12:30




@RuiFRibeiro Hi. I already successfully did it with bridging. But just want to know how to do it with NAT
– J.R.
Jan 4 at 12:30












Why NAT? Do routing between internal networks.
– Rui F Ribeiro
Jan 4 at 12:33




Why NAT? Do routing between internal networks.
– Rui F Ribeiro
Jan 4 at 12:33












@RuiFRibeiro Cause I want a static address for the wlan0, which can only be done with NAT. If I bridge them, I cannot visit the device with a static ip.
– J.R.
Jan 4 at 12:39




@RuiFRibeiro Cause I want a static address for the wlan0, which can only be done with NAT. If I bridge them, I cannot visit the device with a static ip.
– J.R.
Jan 4 at 12:39












make sure that the iptable_nat module is unloaded, and what will happen if you remove the oifname eth0 section from the command.
– Rabin
Jan 4 at 14:14




make sure that the iptable_nat module is unloaded, and what will happen if you remove the oifname eth0 section from the command.
– Rabin
Jan 4 at 14:14















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414760%2fwhat-modules-should-be-loaded-if-i-want-to-route-eth0-to-wlan0-use-nftables%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414760%2fwhat-modules-should-be-loaded-if-i-want-to-route-eth0-to-wlan0-use-nftables%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?