You are not logged in.
Guys, I need to make a DHCP server, I was using Debian, but as I am an Arch user Some time ago, I decided to port to it.
Starting with a clean installation, what is the best way to make the DHCP server work?
The wiki didn't help me at all, it just doesn't connect when I plug the cable into the computer, following the steps there.
A long time ago, I used netctl, but even he is not willing to collaborate. Can you help me from scratch to make a server with Arch?
Offline
The dhcpd service is what I use. https://wiki.archlinux.org/index.php/Dhcpd
You will have to configure it to serve the subnet you want. And, you will need to have an address in that subnet assigned to one of your NICs.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
https://wiki.archlinux.org/index.php/Ro … S_and_DHCP
it just doesn't connect … I used netctl
Are you sure you want to "make a DHCP server"?
Offline
Try looking into dnsmasq
I run it on my RPi for DHCP.
Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '
Online
The dhcpd service is what I use. https://wiki.archlinux.org/index.php/Dhcpd
You will have to configure it to serve the subnet you want. And, you will need to have an address in that subnet assigned to one of your NICs.
I was using this one, but even following it, it doesn't send the IP to the machine (yes, I use a script with iptables to forward the address)
@ewaller How did you do it? Can you help me?
I'm not sure what you're talking about, but lol (google translator, sorry )
@merlock: What exactly did you do?
Last edited by willianholtz (2020-07-01 15:55:52)
Offline
It sounded as if you were trying to receive an IP (ie. this was a client issue)
Does the server listen on port 67/547 (check nmap)
What does your dhcpd config look like?
Also
ip a; ip r; sudo iptables -nvL
Offline
As you are using a translator, I assume English is not your primary language. As such I will ask a couple questions to be sure we are talking about the same thing.
Are you trying to use your computer to listen for requests for IP address from other computers and to provide those computers with a unique address ? This allows other computers to join the network controlled by your computer This is a DHCP server.
Or, is your computer trying to ask another computer (or router) for an IP address so that your computer may join that network?
Most people do not need to run a server. I do because I develop IoT devices that need to be provided an address when they start. One of the wired networks on this computer can be configured to provide those IoT devices addresses when they start up while keeping them on an isolated LAN.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
EDIT:
@ewaller
Sorry I hadn't seen the message, and yes, I want a computer (server) to distribute IP's to a network, I think it's a DHCP server, isn't it? lol
It sounded as if you were trying to receive an IP (ie. this was a client issue)
Does the server listen on port 67/547 (check nmap)
What does your dhcpd config look like?
Alsoip a; ip r; sudo iptables -nvL
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: enp8s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:24:e8:de:00:6f brd ff:ff:ff:ff:ff:ff
inet 139.96.30.100/24 scope global enp8s0
valid_lft forever preferred_lft forever
inet6 fe80::224:e8ff:fede:6f/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:26:5e:22:98:75 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.105/24 brd 192.168.0.255 scope global dynamic noprefixroute wlan0
valid_lft 6949sec preferred_lft 6049sec
inet6 fe80::89:aab9:a86c:5f2a/64 scope link
valid_lft forever preferred_lft forever
default via 192.168.0.1 dev wlan0 proto dhcp src 192.168.0.105 metric 303
139.96.30.0/24 dev enp8s0 proto kernel scope link src 139.96.30.100
192.168.0.0/24 dev wlan0 proto dhcp scope link src 192.168.0.105 metric 303
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Last edited by willianholtz (2020-07-01 17:03:24)
Offline
Please edit the post and wrap the output in code tags, https://bbs.archlinux.org/help.php#bbcode
There're no iptable rules at all, 2 NICS, the traffic defaults over wifi - do you want to create a dhcp server for the 139.96.30.0/24 subnet (your wired ethernet)?
You forgot to post the dhcpd.conf and to answer whether the interface is listening on the dhcp ports (you can check this locally w/ ss or netstat, but nmap results from a client in the subnet are the most relevant information right now)
Offline
Ifconfig:
enp8s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:24:e8:de:00:6f txqueuelen 1000 (Ethernet)
RX packets 217 bytes 58722 (57.3 KiB)
RX errors 0 dropped 46 overruns 0 frame 0
TX packets 116 bytes 14720 (14.3 KiB)
TX errors 2 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 13 bytes 1895 (1.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 13 bytes 1895 (1.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.105 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::89:aab9:a86c:5f2a prefixlen 64 scopeid 0x20<link>
ether 00:26:5e:22:98:75 txqueuelen 1000 (Ethernet)
RX packets 414735 bytes 415114653 (395.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 14055
TX packets 368868 bytes 27873717 (26.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 18
/etc/dhcpd.conf
option domain-name-servers 8.8.8.8, 8.8.4.4;
option subnet-mask 255.255.255.0;
option routers 139.96.30.100;
subnet 139.96.30.0 netmask 255.255.255.0 {
range 139.96.30.150 139.96.30.250;
}
I created it as it is on the wiki
/etc/systemd/system/dhcpd4@.service
[Unit]
Description=IPv4 DHCP server on %I
Wants=network.target
After=network-pre.target
Before=network.target
[Service]
Type=forking
PIDFile=/run/dhcpd4.pid
ExecStart=/usr/bin/dhcpd -4 -q -pf /run/dhcpd4.pid %I
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
I started the interface
systemctl enable dhcpd4@enp8s0.service
systemctl start dhcpd4@enp8s0.service
NETSTAT
netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 pacarch:56250 ce-in-f188.1e10:hpvroom ESTABLISHED
tcp 0 0 pacarch:48848 bbs.archlinux.org:https ESTABLISHED
udp 0 0 pacarch:48355 gru06s30-in-f14.1:https ESTABLISHED
udp 0 0 pacarch:36575 gru14s20-in-f14.1:https ESTABLISHED
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags Type State I-Node Path
unix 3 [ ] DGRAM 11037 /run/systemd/notify
unix 10 [ ] DGRAM 11076 /run/systemd/journal/dev-log
unix 6 [ ] DGRAM 11084 /run/systemd/journal/socket
unix 2 [ ] DGRAM 20148 /run/user/1000/systemd/notify
unix 2 [ ] DGRAM 74705 /var/run/wpa_supplicant/wlan0
unix 3 [ ] SEQPACKET CONNECTED 25268 @00004
unix 3 [ ] SEQPACKET CONNECTED 25266 @00003
unix 3 [ ] STREAM CONNECTED 40440
unix 3 [ ] STREAM CONNECTED 23289
unix 3 [ ] STREAM CONNECTED 21561
unix 3 [ ] DGRAM 75791
unix 3 [ ] STREAM CONNECTED 25379
unix 3 [ ] STREAM CONNECTED 21428 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 38306
unix 3 [ ] STREAM CONNECTED 23265 /run/user/1000/pulse/native
unix 3 [ ] STREAM CONNECTED 22877 @/tmp/.ICE-unix/662
unix 3 [ ] STREAM CONNECTED 20402
unix 3 [ ] STREAM CONNECTED 40441
unix 3 [ ] DGRAM 12622
unix 3 [ ] STREAM CONNECTED 23291 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 21465 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 75795
unix 3 [ ] STREAM CONNECTED 25358
unix 3 [ ] STREAM CONNECTED 20422 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 18666
unix 3 [ ] STREAM CONNECTED 41306
unix 3 [ ] STREAM CONNECTED 38994
unix 3 [ ] STREAM CONNECTED 34883 /run/user/1000/pulse/native
unix 3 [ ] STREAM CONNECTED 95007
unix 3 [ ] STREAM CONNECTED 22906
unix 3 [ ] STREAM CONNECTED 22575 /run/systemd/journal/stdout
unix 2 [ ] DGRAM 74751
unix 3 [ ] STREAM CONNECTED 36332
unix 3 [ ] STREAM CONNECTED 25357
unix 3 [ ] STREAM CONNECTED 21422
unix 3 [ ] STREAM CONNECTED 39173
unix 3 [ ] STREAM CONNECTED 21571 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 20372 /run/dbus/system_bus_socket
unix 3 [ ] DGRAM 12623
unix 3 [ ] STREAM CONNECTED 23054 /run/user/1000/bus
unix 2 [ ] DGRAM 21315
unix 2 [ ] DGRAM 21061
unix 3 [ ] STREAM CONNECTED 24498 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 21479
unix 3 [ ] STREAM CONNECTED 39118
unix 3 [ ] STREAM CONNECTED 22890
unix 3 [ ] STREAM CONNECTED 22597 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 20388 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 40689
unix 2 [ ] DGRAM 23301
unix 3 [ ] STREAM CONNECTED 21472
unix 3 [ ] DGRAM 75789
unix 3 [ ] SEQPACKET CONNECTED 25384
unix 3 [ ] STREAM CONNECTED 20349 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 39117
unix 3 [ ] STREAM CONNECTED 20434
unix 3 [ ] STREAM CONNECTED 20371
unix 3 [ ] STREAM CONNECTED 21960 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 21277
unix 3 [ ] DGRAM 75851
unix 3 [ ] STREAM CONNECTED 25465
unix 3 [ ] STREAM CONNECTED 20351 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 39113
unix 3 [ ] STREAM CONNECTED 20429
unix 3 [ ] STREAM CONNECTED 21490 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 23089
unix 3 [ ] STREAM CONNECTED 21462
unix 3 [ ] STREAM CONNECTED 75797
unix 3 [ ] STREAM CONNECTED 26711
unix 3 [ ] SEQPACKET CONNECTED 25373
unix 3 [ ] STREAM CONNECTED 21480
unix 3 [ ] STREAM CONNECTED 38299
unix 3 [ ] STREAM CONNECTED 39172
unix 3 [ ] STREAM CONNECTED 22876
unix 3 [ ] STREAM CONNECTED 20394 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 23053
unix 3 [ ] STREAM CONNECTED 21477 /run/user/1000/bus
unix 3 [ ] DGRAM 75852
unix 3 [ ] SEQPACKET CONNECTED 25489
unix 3 [ ] STREAM CONNECTED 21501
unix 3 [ ] STREAM CONNECTED 38300
unix 3 [ ] STREAM CONNECTED 39111
unix 3 [ ] STREAM CONNECTED 22725
unix 3 [ ] STREAM CONNECTED 95006
unix 2 [ ] DGRAM 18268
unix 3 [ ] STREAM CONNECTED 23090 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 20206 /run/systemd/journal/stdout
unix 3 [ ] DGRAM 75790
unix 3 [ ] STREAM CONNECTED 26710
unix 3 [ ] SEQPACKET CONNECTED 25372
unix 3 [ ] STREAM CONNECTED 21429
unix 3 [ ] STREAM CONNECTED 39103
unix 3 [ ] STREAM CONNECTED 23264
unix 3 [ ] STREAM CONNECTED 22612
unix 3 [ ] STREAM CONNECTED 20400 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 40438
unix 3 [ ] STREAM CONNECTED 38921
unix 3 [ ] STREAM CONNECTED 22911 /run/user/1000/bus
unix 3 [ ] DGRAM 75798
unix 3 [ ] STREAM CONNECTED 36333
unix 3 [ ] STREAM CONNECTED 24499 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 21430 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 39110
unix 3 [ ] STREAM CONNECTED 34882
unix 2 [ ] DGRAM 22893
unix 3 [ ] STREAM CONNECTED 22889 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 40688
unix 2 [ ] DGRAM 12620
unix 3 [ ] SEQPACKET CONNECTED 25263
unix 3 [ ] STREAM CONNECTED 21287
unix 3 [ ] STREAM CONNECTED 96671
unix 3 [ ] DGRAM 75792
unix 3 [ ] STREAM CONNECTED 25380
unix 3 [ ] STREAM CONNECTED 21424
unix 3 [ ] STREAM CONNECTED 18591
unix 3 [ ] STREAM CONNECTED 39102
unix 3 [ ] STREAM CONNECTED 22728 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 20401
unix 3 [ ] STREAM CONNECTED 40439
unix 3 [ ] STREAM CONNECTED 21562 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 22910
unix 3 [ ] STREAM CONNECTED 21476
unix 3 [ ] STREAM CONNECTED 75796
unix 3 [ ] STREAM CONNECTED 27036
unix 3 [ ] STREAM CONNECTED 25361 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 20392 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 18593 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 38307
unix 3 [ ] STREAM CONNECTED 39114
unix 3 [ ] STREAM CONNECTED 20430 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 20393
unix 3 [ ] STREAM CONNECTED 22905
unix 3 [ ] STREAM CONNECTED 21464 /run/systemd/journal/stdout
unix 3 [ ] DGRAM 75788
unix 3 [ ] STREAM CONNECTED 27035
unix 3 [ ] STREAM CONNECTED 25360
unix 3 [ ] STREAM CONNECTED 20385 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 38995
unix 3 [ ] STREAM CONNECTED 21506 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 20387
unix 3 [ ] STREAM CONNECTED 22587
unix 3 [ ] STREAM CONNECTED 18854 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 23292 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 21288
unix 3 [ ] DGRAM 75799
unix 3 [ ] STREAM CONNECTED 25330
unix 3 [ ] STREAM CONNECTED 21427
unix 3 [ ] STREAM CONNECTED 18669 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 41212
unix 3 [ ] STREAM CONNECTED 22722
unix 3 [ ] STREAM CONNECTED 20403
unix 3 [ ] STREAM CONNECTED 23288
unix 3 [ ] STREAM CONNECTED 21463
unix 3 [ ] STREAM CONNECTED 96672
unix 3 [ ] STREAM CONNECTED 75794
unix 3 [ ] STREAM CONNECTED 25329
unix 2 [ ] DGRAM 21431
unix 3 [ ] STREAM CONNECTED 41305
unix 3 [ ] STREAM CONNECTED 20426
unix 2 [ ] DGRAM 20398
unix 2 [ ] DGRAM 22577
unix 3 [ ] STREAM CONNECTED 18274
unix 3 [ ] STREAM CONNECTED 21959 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 21473 @/tmp/.X11-unix/X0
unix 3 [ ] DGRAM 75793
unix 3 [ ] SEQPACKET CONNECTED 25385
unix 3 [ ] STREAM CONNECTED 21509
unix 3 [ ] STREAM CONNECTED 41213
unix 3 [ ] STREAM CONNECTED 22891 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 22613 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 20399
unix 3 [ ] STREAM CONNECTED 95349
unix 3 [ ] STREAM CONNECTED 38955
unix 3 [ ] STREAM CONNECTED 36690
unix 3 [ ] STREAM CONNECTED 25449
unix 3 [ ] STREAM CONNECTED 18845
unix 3 [ ] STREAM CONNECTED 39224
unix 3 [ ] STREAM CONNECTED 18892
unix 3 [ ] STREAM CONNECTED 36764
unix 3 [ ] STREAM CONNECTED 25551
unix 3 [ ] STREAM CONNECTED 25662 @/tmp/.X11-unix/X0
unix 2 [ ] DGRAM 22231
unix 3 [ ] STREAM CONNECTED 18887
unix 3 [ ] STREAM CONNECTED 25460
unix 3 [ ] STREAM CONNECTED 18833 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 18889
unix 3 [ ] STREAM CONNECTED 20031
unix 3 [ ] STREAM CONNECTED 38960
unix 3 [ ] STREAM CONNECTED 25452
unix 3 [ ] STREAM CONNECTED 39249
unix 3 [ ] STREAM CONNECTED 95350
unix 3 [ ] STREAM CONNECTED 25550
unix 3 [ ] STREAM CONNECTED 25444
unix 3 [ ] STREAM CONNECTED 39180
unix 3 [ ] STREAM CONNECTED 80412 @/tmp/.ICE-unix/662
unix 3 [ ] STREAM CONNECTED 18890
unix 3 [ ] STREAM CONNECTED 21569 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 18884 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 36552
unix 3 [ ] STREAM CONNECTED 25394
unix 3 [ ] STREAM CONNECTED 39290
unix 3 [ ] STREAM CONNECTED 24886 /run/user/1000/kded5CnfVoy.1.slave-socket
unix 3 [ ] STREAM CONNECTED 36767
unix 3 [ ] STREAM CONNECTED 25559
unix 3 [ ] STREAM CONNECTED 25443
unix 3 [ ] STREAM CONNECTED 80411
unix 3 [ ] DGRAM 75597
unix 2 [ ] DGRAM 21576
unix 3 [ ] STREAM CONNECTED 26174
unix 3 [ ] SEQPACKET CONNECTED 25495
unix 3 [ ] STREAM CONNECTED 25464
unix 3 [ ] STREAM CONNECTED 39223
unix 3 [ ] STREAM CONNECTED 95975
unix 2 [ ] DGRAM 20034
unix 3 [ ] STREAM CONNECTED 36768
unix 3 [ ] STREAM CONNECTED 25663 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 39291
unix 3 [ ] STREAM CONNECTED 18888
unix 3 [ ] STREAM CONNECTED 26175
unix 3 [ ] STREAM CONNECTED 25560
unix 3 [ ] STREAM CONNECTED 25454
unix 3 [ ] STREAM CONNECTED 39288
unix 3 [ ] STREAM CONNECTED 24197
unix 3 [ ] DGRAM 75596
unix 3 [ ] STREAM CONNECTED 18387
unix 3 [ ] SEQPACKET CONNECTED 25496
unix 3 [ ] STREAM CONNECTED 25448
unix 3 [ ] STREAM CONNECTED 39287
unix 3 [ ] STREAM CONNECTED 18891
unix 3 [ ] STREAM CONNECTED 18383
unix 3 [ ] STREAM CONNECTED 37900
unix 3 [ ] STREAM CONNECTED 27071
unix 3 [ ] STREAM CONNECTED 25393
unix 3 [ ] STREAM CONNECTED 39179
unix 3 [ ] STREAM CONNECTED 95974
unix 3 [ ] STREAM CONNECTED 21568
unix 3 [ ] STREAM CONNECTED 37901
unix 2 [ ] DGRAM 18883
unix 3 [ ] STREAM CONNECTED 17847
unix 3 [ ] STREAM CONNECTED 18904 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 38961
unix 3 [ ] STREAM CONNECTED 36689
unix 3 [ ] STREAM CONNECTED 25661 /run/user/1000/bus
unix 2 [ ] DGRAM 43741
unix 3 [ ] STREAM CONNECTED 39250
unix 3 [ ] STREAM CONNECTED 18832
unix 3 [ ] STREAM CONNECTED 18886
unix 3 [ ] STREAM CONNECTED 38956
unix 3 [ ] STREAM CONNECTED 36553
unix 3 [ ] STREAM CONNECTED 25659 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 18846 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 17848 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 21051 /tmp/sddm-auth5a5e5efe-60e2-4612-81cf-512a8e282e62
unix 3 [ ] STREAM CONNECTED 36763
unix 3 [ ] STREAM CONNECTED 27070
unix 3 [ ] STREAM CONNECTED 25451
unix 3 [ ] STREAM CONNECTED 18885
unix 3 [ ] STREAM CONNECTED 36330
unix 3 [ ] STREAM CONNECTED 24493
unix 3 [ ] STREAM CONNECTED 27093
unix 3 [ ] STREAM CONNECTED 26412
unix 3 [ ] SEQPACKET CONNECTED 25269
unix 3 [ ] STREAM CONNECTED 37595
unix 3 [ ] STREAM CONNECTED 21293
unix 3 [ ] STREAM CONNECTED 35890
unix 3 [ ] STREAM CONNECTED 25650
unix 2 [ ] DGRAM 20141
unix 3 [ ] STREAM CONNECTED 26419 /run/user/1000/pulse/native
unix 3 [ ] SEQPACKET CONNECTED 25267
unix 3 [ ] STREAM CONNECTED 38001
unix 3 [ ] STREAM CONNECTED 37479
unix 3 [ ] STREAM CONNECTED 20262 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 35891
unix 3 [ ] STREAM CONNECTED 25641
unix 3 [ ] STREAM CONNECTED 22222
unix 3 [ ] STREAM CONNECTED 37876
unix 3 [ ] STREAM CONNECTED 20205
unix 3 [ ] STREAM CONNECTED 37596
unix 3 [ ] STREAM CONNECTED 21314
unix 3 [ ] STREAM CONNECTED 38050
unix 3 [ ] SEQPACKET CONNECTED 25490
unix 3 [ ] STREAM CONNECTED 24519
unix 2 [ ] DGRAM 20132
unix 3 [ ] STREAM CONNECTED 20361
unix 3 [ ] STREAM CONNECTED 37248
unix 3 [ ] STREAM CONNECTED 25844
unix 3 [ ] STREAM CONNECTED 21361
unix 3 [ ] STREAM CONNECTED 36319
unix 3 [ ] STREAM CONNECTED 25826
unix 3 [ ] STREAM CONNECTED 22058
unix 3 [ ] STREAM CONNECTED 37660
unix 3 [ ] STREAM CONNECTED 27775
unix 3 [ ] STREAM CONNECTED 21455 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 36896
unix 3 [ ] STREAM CONNECTED 25848
unix 3 [ ] STREAM CONNECTED 21375
unix 3 [ ] STREAM CONNECTED 37902
unix 3 [ ] SEQPACKET CONNECTED 25691
unix 3 [ ] STREAM CONNECTED 23117 @/tmp/.ICE-unix/662
unix 3 [ ] STREAM CONNECTED 27363
unix 3 [ ] STREAM CONNECTED 38053
unix 3 [ ] STREAM CONNECTED 20374 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 21353
unix 3 [ ] STREAM CONNECTED 25694
unix 3 [ ] STREAM CONNECTED 23295 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 37692
unix 3 [ ] STREAM CONNECTED 21290 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 21362 /run/user/1000/bus
unix 3 [ ] SEQPACKET CONNECTED 25692
unix 3 [ ] STREAM CONNECTED 23300 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 20154
unix 3 [ ] STREAM CONNECTED 20367
unix 3 [ ] STREAM CONNECTED 25847
unix 2 [ ] DGRAM 21507
unix 3 [ ] STREAM CONNECTED 25693
unix 3 [ ] STREAM CONNECTED 22220
unix 3 [ ] STREAM CONNECTED 38920
unix 3 [ ] DGRAM 76014
unix 3 [ ] STREAM CONNECTED 38052
unix 3 [ ] STREAM CONNECTED 21456 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 37249
unix 2 [ ] DGRAM 21363
unix 3 [ ] STREAM CONNECTED 25640
unix 3 [ ] STREAM CONNECTED 23299 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 37693
unix 3 [ ] STREAM CONNECTED 21183 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 20368 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 37938
unix 3 [ ] STREAM CONNECTED 25843
unix 3 [ ] STREAM CONNECTED 20266 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 38049
unix 3 [ ] STREAM CONNECTED 25827
unix 3 [ ] STREAM CONNECTED 22223
unix 3 [ ] STREAM CONNECTED 27362
unix 3 [ ] STREAM CONNECTED 26418
unix 3 [ ] STREAM CONNECTED 20362
unix 3 [ ] STREAM CONNECTED 37480
unix 3 [ ] STREAM CONNECTED 36331
unix 3 [ ] STREAM CONNECTED 23091 @/tmp/.X11-unix/X0
unix 3 [ ] DGRAM 76013
unix 3 [ ] STREAM CONNECTED 27776
unix 3 [ ] STREAM CONNECTED 20373
unix 3 [ ] STREAM CONNECTED 38000
unix 3 [ ] STREAM CONNECTED 20237 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 25651 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 24496
unix 3 [ ] STREAM CONNECTED 26409
unix 3 [ ] STREAM CONNECTED 37939
unix 3 [ ] STREAM CONNECTED 20209 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 37903
unix 3 [ ] STREAM CONNECTED 24520
unix 3 [ ] STREAM CONNECTED 24492
unix 3 [ ] STREAM CONNECTED 27079
unix 3 [ ] DGRAM 20151
unix 3 [ ] STREAM CONNECTED 26410
unix 3 [ ] STREAM CONNECTED 21354
unix 3 [ ] STREAM CONNECTED 36318
unix 3 [ ] STREAM CONNECTED 24517
unix 3 [ ] STREAM CONNECTED 24495
unix 3 [ ] STREAM CONNECTED 27092
unix 3 [ ] DGRAM 20150
unix 3 [ ] STREAM CONNECTED 26413
unix 3 [ ] SEQPACKET CONNECTED 25264
unix 3 [ ] STREAM CONNECTED 36897
unix 3 [ ] STREAM CONNECTED 21359
unix 3 [ ] STREAM CONNECTED 24516
unix 3 [ ] STREAM CONNECTED 22051
unix 3 [ ] STREAM CONNECTED 37661
unix 3 [ ] STREAM CONNECTED 37877
unix 3 [ ] STREAM CONNECTED 27078
unix 2 [ ] DGRAM 21508
unix 3 [ ] STREAM CONNECTED 80409 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 22884
unix 3 [ ] STREAM CONNECTED 22788 /run/user/1000/bus
unix 2 [ ] DGRAM 21594
unix 3 [ ] STREAM CONNECTED 95951
unix 3 [ ] STREAM CONNECTED 20357 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 17765
unix 3 [ ] STREAM CONNECTED 38097
unix 2 [ ] DGRAM 21970
unix 3 [ ] STREAM CONNECTED 95953
unix 3 [ ] STREAM CONNECTED 21158 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 17838
unix 3 [ ] STREAM CONNECTED 13693 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 21762
unix 3 [ ] STREAM CONNECTED 22772 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 81120
unix 3 [ ] STREAM CONNECTED 17830
unix 3 [ ] STREAM CONNECTED 17839
unix 3 [ ] STREAM CONNECTED 22883 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 21579
unix 3 [ ] STREAM CONNECTED 22081
unix 3 [ ] STREAM CONNECTED 81119
unix 3 [ ] STREAM CONNECTED 18878 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 12688
unix 3 [ ] STREAM CONNECTED 22923 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 95952
unix 3 [ ] STREAM CONNECTED 22881
unix 3 [ ] STREAM CONNECTED 18599 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 21583
unix 2 [ ] DGRAM 13575
unix 3 [ ] STREAM CONNECTED 81178
unix 3 [ ] STREAM CONNECTED 22888
unix 3 [ ] STREAM CONNECTED 21969
unix 3 [ ] STREAM CONNECTED 21575
unix 3 [ ] STREAM CONNECTED 81117
unix 3 [ ] STREAM CONNECTED 17840 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 21874
unix 3 [ ] STREAM CONNECTED 21584 @/tmp/.ICE-unix/662
unix 3 [ ] STREAM CONNECTED 80475 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 21440 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 18376
unix 3 [ ] DGRAM 11039
unix 3 [ ] STREAM CONNECTED 22892 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 21590
unix 3 [ ] STREAM CONNECTED 22887 /run/user/1000/bus
unix 2 [ ] DGRAM 12745
unix 3 [ ] STREAM CONNECTED 13685 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 22915 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 22599 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 80413 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 20128
unix 3 [ ] STREAM CONNECTED 21988 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 22792 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 21597 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 22082 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 95954
unix 3 [ ] STREAM CONNECTED 22885 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 22571 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 23012
unix 3 [ ] STREAM CONNECTED 38098
unix 3 [ ] STREAM CONNECTED 22874 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 22730 @/tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 80418 /run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 22570
unix 3 [ ] STREAM CONNECTED 20356
unix 3 [ ] STREAM CONNECTED 21979
unix 3 [ ] STREAM CONNECTED 21596
unix 3 [ ] STREAM CONNECTED 22886
unix 3 [ ] DGRAM 22929
unix 3 [ ] STREAM CONNECTED 21916
unix 3 [ ] STREAM CONNECTED 22733 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 22872
unix 3 [ ] STREAM CONNECTED 20354
unix 3 [ ] DGRAM 22928
unix 3 [ ] DGRAM 11040
unix 3 [ ] STREAM CONNECTED 21949
unix 2 [ ] DGRAM 21566
unix 3 [ ] STREAM CONNECTED 22882 /run/user/1000/bus
unix 3 [ ] STREAM CONNECTED 21864 /run/systemd/journal/stdout
unix 3 [ ] STREAM CONNECTED 12518
unix 3 [ ] STREAM CONNECTED 21790
Active AX.25 sockets
Dest Source Device State Vr/Vs Send-Q Recv-Q
I'm using my notebook for testing, a while ago I used it to forward an IP to my PS4 and it worked, but now it won't
Last edited by willianholtz (2020-07-01 21:26:45)
Offline
What is the status of the service?
systemctl status dhcpd4@enp8s0.service
Please note quote tags are not code tags.
Offline
"code", not "quote", please edit your post (there's a link in the lower right corner)
netstat -tulpen
From your notebook run
ip a; sudo nmap --script broadcast-dhcp-discover
I'm using my notebook for testing, a while ago I used it to forward an IP to my PS4 and it worked
Kannst Du bitte kurz erläutern, was das Ziel des Setups ist?
Du hast das WLAN im 192.168.0.0/24 Segment, es bezieht eine IP via DHCP, verm. von Deinem Router?
Ist der Plan, die PS4 über ethernet und das WLAN des Servers an den Router und darüber ins Internet zu kriegen?
Dann wolltest Du nämlich vermutlich eine https://wiki.archlinux.org/index.php/Network_bridge
Wie sind PC und PS4 denn verbunden? Crosslink cable, dummer switch oder ein weiterer Router?
Oder sollen PS4 und Arch-Server in einem isolierten Subnetz hängen (um zB. PS4 gegen PC zu spielen)?
Unabhängig davon kannst Du übrigens der PS4 eine statische IP geben, https://portforward.com/networking/static-ip-ps4/
Wichtig ist, daß die physisch verbundenen NICs im selben Subnetz agieren (dh. wenn die PS4 irgendwie mit dem Kabelgebunden ethernet verbunden ist, muß sie auch im 139.96.30.0/24 Netz sein)
Offline
"code", not "quote", please edit your post (there's a link in the lower right corner)
netstat -tulpen
From your notebook run
ip a; sudo nmap --script broadcast-dhcp-discover
I'm using my notebook for testing, a while ago I used it to forward an IP to my PS4 and it worked
Kannst Du bitte kurz erläutern, was das Ziel des Setups ist?
Du hast das WLAN im 192.168.0.0/24 Segment, es bezieht eine IP via DHCP, verm. von Deinem Router?Ist der Plan, die PS4 über ethernet und das WLAN des Servers an den Router und darüber ins Internet zu kriegen?
Dann wolltest Du nämlich vermutlich eine https://wiki.archlinux.org/index.php/Network_bridge
Wie sind PC und PS4 denn verbunden? Crosslink cable, dummer switch oder ein weiterer Router?Oder sollen PS4 und Arch-Server in einem isolierten Subnetz hängen (um zB. PS4 gegen PC zu spielen)?
Unabhängig davon kannst Du übrigens der PS4 eine statische IP geben, https://portforward.com/networking/static-ip-ps4/
Wichtig ist, daß die physisch verbundenen NICs im selben Subnetz agieren (dh. wenn die PS4 irgendwie mit dem Kabelgebunden ethernet verbunden ist, muß sie auch im 139.96.30.0/24 Netz sein)
Is that German? woow I'm Brazilian lol!
So, in my tests I just want to take the internet from my notebook to my PS4. But the goal is to create a linux server to manage IP's on a network and configure squid to block some inappropriate sites.
Then you ask me: "why not use Debian or another distro?" Because I don't like these distros, I think Arch is more up-to-date and more secure (to a certain extent).
As far as I know, to configure an internet server with a DHCP network, you need to specify the IP of a network card, and in the dhcpd.conf configuration, specify which IP's will be used, and what are the "ranges" used by that network! As described on this site, easy and practical! But it looks like Arch isn't doing that.
Offline
You like arch because it is more modern but use deprecated commands ifconfig replaced by ip and netstat replaced by ss.
You also did not include the state of the service or the other requested outputs.
Offline
Sorry, I assumed your name was "Willi Anholtz" - sounded German enough.
The link explains a dhcpd setup, like the link to the arch wiki ewaller posted.
Aside the oustanding command outputs of the last few posts:
- Is the notebook the archlinux device or is this an extra server?
- Is the archlinux device physically connected to the PS4? How? (Dumb switch, another router or a crosslink cable)
Internet sharing is detailed here, https://wiki.archlinux.org/index.php/Internet_sharing - your iptables don't match that
As for squid, it's "just" a proxy. You can circumvent it by just not using it. If it's not on the filtered machine, your router will have to redirect all traffic on http and ftp ports through it.
@loqs
you can check this locally w/ ss or netstat
Offline
I've been using a pi-hole for 3 years now, and when I installed it, was interested in its' use of dnsmasq's DHCP server capabilities.
I needed a bit more fine-tuning than what pi-hole does out-of-the-box, so I made a drop-in config file (for dnsmasq) just for the DHCP server. Works like a champ.
Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '
Online
I discovered the missing details, just typed dhcpd in the terminal and it worked!
Offline
What were the missing details?
Edit:
You can get dhcpd to work from the console what about using the service file?
Last edited by loqs (2020-07-01 23:07:14)
Offline
Come on, I did the following steps:
1 - I downloaded new .iso from Arch Linux
2 - I did the procedure to put a fixed IP
# ip link set up dev eth0
# ip addr add 139.96.30.100/24 dev eth0
3 - I edited the dhcpd.conf file
option domain-name-servers 8.8.8.8, 8.8.4.4;
option subnet-mask 255.255.255.0;
option routers 139.96.30.100;
subnet 139.96.30.0 netmask 255.255.255.0 {
range 139.96.30.150 139.96.30.250;
}
4 - I created the dhcpd4@.service file (I don't know if you need it, but I did)
in /etc/systemd/system/dhcpd4@.service
[Unit]
Description=IPv4 DHCP server on %I
Wants=network.target
After=network.target
[Service]
Type=forking
PIDFile=/run/dhcpd4.pid
ExecStart=/usr/bin/dhcpd -4 -q -pf /run/dhcpd4.pid %I
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
Only the 4 steps work, it sends the IP to the client machine, but there are 6 steps I had to follow
And of course, I started the dhcpd process.
5 - I created a route for iptables releases the internet for the client
pacman -S iptables
touch /etc/iptables/iptables.rules
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
6 - I created a script to automate all of this at boot
And that, now all client machines work and get an IP of the range that I specified in dhcpd.conf.
Last edited by willianholtz (2020-07-01 23:21:23)
Offline
Would steps 5 and 6 be needed if dhcpd was bound to the same interface that the DHCP requests were received on?
Edit:
I mean just to obtain a DHCP lease not to perform internet connection sharing.
Last edited by loqs (2020-07-01 23:41:06)
Offline
Would steps 5 and 6 be needed if dhcpd was bound to the same interface that the DHCP requests were received on?
It seems so, because only then can you send signal to another network!
I'm sorry if I'm wrong!
Offline
5 is definitely not required for a DHCP server - a DHCP server doesn't pass any traffic through it, it just hands out packets with lease details to any other host that asks for it. Hence no need for ip_forward or NAT MASQUERADE.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Only the 4 steps work, it sends the IP to the client machine, but there are 6 steps I had to follow
And of course, I started the dhcpd process.
He also wants to forward traffic, but confirmed that setting up and running dhcpd works.
@willianholtzm how *exactly* do you run dhcpd directly (complete command)
Also
What is the status of the service?
systemctl status dhcpd4@enp8s0.service
Offline
willianholtz wrote:Only the 4 steps work, it sends the IP to the client machine, but there are 6 steps I had to follow
And of course, I started the dhcpd process.He also wants to forward traffic, but confirmed that setting up and running dhcpd works.
@willianholtzm how *exactly* do you run dhcpd directly (complete command)
Alsoloqs wrote:What is the status of the service?
systemctl status dhcpd4@enp8s0.service
Only dhcpd in the terminal
Offline
This will, in contrast to your service, run dhcp on all interfaces (and including IPv6) - what brings us back to how the subnets are actually arranged, notably how PS4 and arch system are connected (wifi or wired LAN)
We're also still lacking the service status.
Offline