You are not logged in.
Pages: 1
Please advise the easiest way to share internet connection. I have a default network setup. Just a desktop with dhspcd for client connections and no network manager. I've inserted another nic and want to share internet connection with another computer.
I followed instructions from "Internet sharing" and "dhcpd" wikis, but these articles aren't foolproof enough for me. I'm getting the following errors:
systemctl status dhcpd4@enp1s9.service
● dhcpd4@enp1s9.service - IPv4 DHCP server on enp1s9
Loaded: loaded (/etc/systemd/system/dhcpd4@.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since nie 2014-12-21 10:45:53 CET; 3min 3s ago
Process: 291 ExecStart=/usr/bin/dhcpd -4 -q -pf /run/dhcpd4.pid %I (code=exited, status=1/FAILURE)
gru 21 10:45:53 jakamal dhcpd[291]:
gru 21 10:45:53 jakamal dhcpd[291]:
gru 21 10:45:53 jakamal dhcpd[291]: Not configured to listen on any interfaces!
gru 21 10:45:53 jakamal dhcpd[291]:
gru 21 10:45:53 jakamal dhcpd[291]: If you think you have received this message due to a bug rather
gru 21 10:45:53 jakamal dhcpd[291]: than a configuration issue please read the section on submitting
gru 21 10:45:53 jakamal systemd[1]: dhcpd4@enp1s9.service: control process exited, code=exited status=1
gru 21 10:45:53 jakamal systemd[1]: Failed to start IPv4 DHCP server on enp1s9.
gru 21 10:45:53 jakamal systemd[1]: Unit dhcpd4@enp1s9.service entered failed state.
gru 21 10:45:53 jakamal systemd[1]: dhcpd4@enp1s9.service failed.Offline
Which wiki page have you followed? Which method did you use?
I believe you should be following this page but that shows four distinct methods.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Or, if you prefer a NAT configuration, this page
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
If it is a wired connection between 2 computer, why do you want to use DHCP, better static IP and adjust iptables rule as ewaller pointed.
do it good first, it will be faster than do it twice the saint ![]()
Offline
Trilby, ewaller, The Saint: thanks for your replies.
@Trilby
I followed these wikis: Internet sharing and dhcpd, but yes, a bridge is simpler, so I'll go for it. After Christmas, I think.
(...) but that shows four distinct methods
– that's a bit of a problem, but I'll try method 1.
@TheSaint
I need a socket to plug in various devices without configuring them, so DHCP suits me better.
Going back on all the commands I had issued in following the said wikis was difficult. I hope I've managed to revert to defaults.
Offline
That's means that every DHCP lease will get its own iptable rule. It will take a bit of scripting, I think.
do it good first, it will be faster than do it twice the saint ![]()
Offline
Setting up a bridge is easy, but i get disconnected by my provider (one computer policy), and it doesn't survive reboots, so I need a NAT anyway.
Trouble is I can't configure my internal interface to use dhcpd on it.
How do I make this persistent:
#ip addr add 139.96.30.100/24 dev eth0?
In other systems I can configure interfaces with /etc/network/interfaces, but there is no such thing here.
Or in other words, what should be done to enable NAT with DHCP in a few steps? Writing bash scripts doesn't seem a proper solution. I tried using shorewall – it starts, but I can't get it to route and the local interface isn't persistent either. Neither did Firestarter work for me.
Last edited by kuba_66 (2014-12-28 05:12:21)
Offline
@The Saint
Do you mean I should manually assign a static IP to my local interface using Persistent configuration on boot using systemd? It's so ruddy complicated! I am deliberately posting in the Newbie Corner to find a simple solution.
What address, subnet, netmask, etc. should I choose if my primary interface has: inet 192.168.0.11 netmask 255.255.255.0 broadcast 192.168.0.255, if it matters at all?
Or perhaps I could use netctl to set up the interface as suggested here: [link=https://wiki.archlinux.org/index.php/NAT%27ing_firewall_-_Share_your_broadband_connection#IP_configuration]IP configuration[/link], but I am not sure what provides the existing connection. It's a default setup. I think it's dhcpcd. Would it be OK to have one interface configured through dhcpcd and another through netctl?
Last edited by kuba_66 (2014-12-28 12:34:29)
Offline
You may find this useful, at least as an example. I have added a link to the Internet sharing wiki page.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Thank you for sharing, Xyne. Your script is a great way for an ad-hoc dhcp server. I was looking for a more stateful solution.
Offline
Offline
Thanks for the link to create_ap, Saint. Yes, Xyne's ingredients are very good.
Offline
You aren't lonely, let us know your developments. If you have more questions don't hesitate to ask for more.
I'm keen to give my best.
do it good first, it will be faster than do it twice the saint ![]()
Offline
Thank you for sharing, Xyne. Your script is a great way for an ad-hoc dhcp server. I was looking for a more stateful solution.
After adapting the subnet launcher script to your needs, you could just create and enable a systemd service file to start and stop it using the ExecStart and ExecStop options, respectively. See the service file manpage for details.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Pages: 1