what modules should be loaded if I want to route eth0 to wlan0 use nftables?
Clash 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.
linux kernel-modules nat nftables
add a comment |Â
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.
linux kernel-modules nat nftables
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 theiptable_nat
module is unloaded, and what will happen if you remove theoifname eth0
section from the command.
â Rabin
Jan 4 at 14:14
add a comment |Â
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.
linux kernel-modules nat nftables
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.
linux kernel-modules nat nftables
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 theiptable_nat
module is unloaded, and what will happen if you remove theoifname eth0
section from the command.
â Rabin
Jan 4 at 14:14
add a comment |Â
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 theiptable_nat
module is unloaded, and what will happen if you remove theoifname 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
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
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
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
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
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
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 theoifname eth0
section from the command.â Rabin
Jan 4 at 14:14