You are not logged in.

#1 2013-07-14 10:48:13

n0rv
Member
Registered: 2012-02-27
Posts: 50

[SelfSolved] Sharing connection with dhcp server and netctl

Yesterday I switched to netctl and old, lovely network problems come back tongue
I have two interfaces: enp2s0 (profile Internet) and enp5s2 (profile Shared). enp2s0 connects to Internet, enp5s2 is LAN with DHCP. Very similar problem I described here: https://bbs.archlinux.org/viewtopic.php?id=153353 but now that config not works anymore.

First, netctl can't start profile Shared. It's simple static config just to get up interface and set IP.

Description='A basic static ethernet connection'
Interface=enp5s2
Connection=ethernet
IP=static
Address=('10.0.0.1/24')
#Routes=('10.0.0.1/24 via 255.255.255.255')
Gateway='10.0.0.1'
DNS=('8.8.8.8')
SkipNoCarrier=yes

Of course dhcpd also not work, because interface is not configured.

Second, if I start Shared profile and dhcpd manually, I cant connect to Internet. I set iptables like here:

iptables --append FORWARD --in-interface enp2s0 -j ACCEPT
iptables --table nat --append POSTROUTING --out-interface enp2s0 -j MASQUERADE

and set

sysctl net.ipv4.ip_forward=1

Now, if I stop Shared profile, I can connect neutral

Edit:
I switched back to netcfg and... it's working! Simple question, why this crap is in core repository?! Just because uses systemd?

Edit2:
Ok, it's not a crap tongue I just love to learn about Linux networking in such lovely Sunday like today wink
Shared profile should look like this:

Description='A basic static ethernet connection'
Interface=enp5s2
Connection=ethernet
IP=static
Address=('10.0.0.1/24')
SkipNoCarrier=yes

Last edited by n0rv (2013-07-14 13:40:18)

Offline

Board footer

Powered by FluxBB