You are not logged in.
Pages: 1
Hello everyone,
the headline points to my problem.
I want to share the wifi-signal, that I receive from a router, via an ethernet-cable with another PC.
I already tried to solve it myself with wiki.archlinux.org/Network_configuration and this help.ubuntu.com/.../connectionsharing
There seems to be a connection between the PCs (I get desktop messages, that tell me so). But when I try browse the internet, no success.
I'm relatively new to Linux Arch. I really love that (usually) things work just fine, so I mostly just use it. But I always like to learn something new about it.
For your information, I use network-manager.
# ip addr prints this
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 20:1a:06:14:88:80 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 48:d2:24:da:60:50 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.14/24 brd 192.168.0.255 scope global dynamic wlp3s0
valid_lft 85501sec preferred_lft 85501sec
inet6 fe80::4ad2:24ff:feda:6050/64 scope link
valid_lft forever preferred_lft foreverCan someone help me?
Thanks in advance,
tt
Last edited by ttomsen89 (2017-01-25 16:07:20)
Offline
How about trying the page in the Arch wiki instead of the Ubuntu one?
Offline
I did this, too. But first the ethernet seemed to block the wifi, and now it's trying to connect without success (on the client)
Offline
If you followed that guide, I would have expected enp2s0f0 to have a static IPv4 address. It doesn't, so you need to fix that. The address space for that interface should not be in 192.168.0.x0/24. I suggest 192.168.1.1.
After you get that sorted, set up dhcpd (not to be confused with dhcpcd) to provide DHCP services to the 192.168.1.0/24 network. Read your journal to ensure it is working. Connect a client computer via a cable to enp2s0f0. Check that all the link light come on. Verify that the computer is able to get an address in the 192.168.1.x/24 space from the Arch box. Verify the Arch box can ping the client. Verify the client can ping the Arch box.
Now you are ready to enable NAT.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
You can also use Network Manager creating a new wired connection and setting IPv4 mode to "Shared to other computers". This will assign a static IP and enable a DHCP server.
Then set the client PC to use DHCP.
Offline
@ewaller
This are are too many steps for me. I'm reading in the wiki to figure out what to do, but so far didn't fully understand.
I entered this
# ip addr add 192.168.1.1 dev enp2s0f0
# ip addr show enp2s0f0
2: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 20:1a:06:14:88:80 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.1/32 scope global enp2s0f0
valid_lft forever preferred_lft foreverIt' strange, that when I ping the other mashine my IP seems to 192.168.0.14
# ping -c3 192.168.0.11
PING 192.168.0.11 (192.168.0.11) 56(84) bytes of data.
From 192.168.0.14 icmp_seq=1 Destination Host Unreachable
From 192.168.0.14 icmp_seq=2 Destination Host Unreachable
From 192.168.0.14 icmp_seq=3 Destination Host UnreachableHow do I set up dhcpd? I read wiki.archlinux/Dhcpd and created the conf-file with minimal configuration. Is that all?
@The Loko
This was my preferred option, but it didn't work.
Offline
This is very important. There are two network cards. There are two networks. One of those networks is 192.168.0.0/24, the other is 192.168.1.0/24.
The "other machine" will have a 192.168.1.0/24 address. What address does it report? From that machine, you want to ping 192.168.1.1; the address of enp2s0f0
Once you get this little network of two machines running, then we can talk about bridging or tunneling between the two networks.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
This is what I did on the 2nd mashine
# ip addr add 192.168.1.0 dev enp2s0
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
link/ether 98:e7:f4:2f:17:78 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.0/32 scope global enp2s0
valid_lft forever preferred_lft forever
inet6 fe80: :9ae7:f4ff:fe2f:1778/64 scope link
valid_lft forever preferred_lft forever Still no packets are being transmitted. But when the ethernet connection seems to be up, the wifi-connection is being interrupted.
Offline
# ip addr add 192.168.1.0 dev enp2s02: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
link/ether 98:e7:f4:2f:17:78 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.0/32 scope global enp2s0So enp2s0 and enp3s0 both have the address 192.168.1.0 assigned to them?
Offline
So enp2s0 and enp3s0 both have the address 192.168.1.0 assigned to them?
No, device enp2s0f0 has IP 192.168.1.1
Offline
As there appeats to be some confusion here, it might be useful if you provide the full output of
$ ip addr
$ ip routeFor both the gateway and client machines.
Offline
What loqs asks for will be useful. I think I see what happened though. I had said a 192.168.1.0 address; that does not mean use 192.168.1.0. I meant 192.168.1.x where 2<-x<=254. I envisioned this being dynamic -- provided by dhcpcd. But, static works too; but you cannot use 192.168.1.0; it is not a valid address.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
As there appeats to be some confusion here, it might be useful if you provide the full output of
$ ip addr
$ ip routeFor both the gateway and client machines.
After I followed @ewaller and changed the last number to 2, respective 3
Machine 1:
$ ip addr show enp2s0f0
2: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 20:1a:06:14:88:80 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.2/32 scope global enp2s0f0
valid_lft forever preferred_lft forever
inet6 fe80::221a:6ff:fe14:8880/64 scope link
valid_lft forever preferred_lft forever
$ ip route
default via 192.168.0.1 dev wlp3s0 proto static metric 600
192.168.0.0/24 dev wlp3s0 proto kernel scope link src 192.168.0.14 metric 600 Machine 2:
$ ip addr show enp3s0
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
link/ether 98:e7:f4:2f:17:78 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.3/32 scope global enp2s0 $ ip route
default via 192.168.0.1 dev wlp2s0 proto static metric 600
169.254.0.0/16 dev enp3s0 scope link metric 1000
192.168.0.0/24 dev wlp2s0 proto kernel scope link src 192.168.0.15 metric 600 Last edited by ttomsen89 (2017-01-24 21:56:02)
Offline
I believe the /32 after the addresses on both machines are going to cause routing problems. They should both be /24. It might be that ip addr add defaults to 32; try it with the /24 at the end of the address.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I believe the /32 after the addresses on both machines are going to cause routing problems. They should both be /24. It might be that ip addr add defaults to 32; try it with the /24 at the end of the address.
That did it, now pinging works ![]()
Now I can enable NAT?
Offline
From the article linked by slithery, try sysctl net.ipv4.ip_forward=1 as root and see it it works. It might not. If it doesn't, a few lines down, the article continues with
# iptables -t nat -A POSTROUTING -o internet0 -j MASQUERADE
# iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# iptables -A FORWARD -i net0 -o internet0 -j ACCEPTI am not sure exactly what those incantations do, but if I needed to know, man iptables is where I would go ![]()
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Thanks already!
I will go on further tomorrow.
Offline
Hello everyone,
it works now. I'm not sure what it did for me, but looking at this: wiki.archlinux.org/NetworkManager and this: xyne.archlinux.ca/dhcpwithdns I installed dnsmasq and -yes- dhcp.
So, I think Network Manager did it for me. I will reboot now and see, if I can repeat the settings.
Edit:
Yep, still works after reboot.
But as Network Manager is not part of the basic installation, I guess in case of a fresh installation of arch on a client machine, I have to use NAT and iptables, don't I?
Anyway, thanks a lot for time and advice : )
tt
Last edited by ttomsen89 (2017-01-25 15:20:38)
Offline
Pages: 1