1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-01 00:22:25 +03:00
Commit Graph

531 Commits

Author SHA1 Message Date
43c6d5abac networkd: propagate IPFoward= per-interface setting also to /proc/sys/net/ipv4/ip_forward
We need to turn on /proc/sys/net/ipv4/ip_forward before the
per-interface forwarding setting is useful, hence let's propagate the
per-interface setting once to the system-wide setting.

Due to the unclear ownership rules of that flag, and the fact that
turning it on also has effects on other sysctl flags we try to minimize
changes to the flag, and only turn it on once. There's no logic to
turning it off again, but this should be fairly unproblematic as the
per-interface setting defaults to off anyway.
2015-01-13 20:55:13 +01:00
769d324c99 networkd: make IP forwarding for IPv4 and IPv6 individually configurable 2015-01-13 20:17:07 +01:00
fd6d906cf4 networkd: rename misnamed boolean 2015-01-13 20:17:07 +01:00
cb9fc36a12 networkd: introduce an AddressFamilyBoolean enum type
This introduces am AddressFamilyBoolean type that works more or less
like a booleaan, but can optionally turn on/off things for ipv4 and ipv6
independently. THis also ports the DHCP field over to it.
2015-01-13 20:17:06 +01:00
5a8bcb674f networkd: add minimal IP forwarding and masquerading support to .network files
This adds two new settings to networkd's .network files:
IPForwarding=yes and IPMasquerade=yes. The former controls the
"forwarding" sysctl setting of the interface, thus controlling whether
IP forwarding shall be enabled on the specific interface. The latter
controls whether a firewall rule shall be installed that exposes traffic
coming from the interface as coming from the local host to all other
interfaces.

This also enables both options by default for container network
interfaces, thus making "systemd-nspawn --network-veth" have network
connectivity out of the box.
2015-01-13 13:55:15 +01:00
1e39ff926f network: apply static addresses in specified order
https://bugs.freedesktop.org/show_bug.cgi?id=83270
2015-01-11 18:17:33 -05:00
ba52f15a58 networkctl: avoid potential use of unitialized variables
Those values are based on a file we read from disk, so we should
verify everything we receive, and make sure everything we print
is sensible.

Also, print fractional seconds for TTL.
2015-01-01 13:36:44 -05:00
1bf7dd6e7d networkctl: remove unused variable 2015-01-01 13:36:43 -05:00
ef75325319 network: fix scanf/printf format
usec_t is defined as 64 bit wide, but long is 32 bit on many archs.
2015-01-01 13:36:43 -05:00
fbee1d8587 networkctl: fix strappend() error checking
Make sure to test the right variable for NULL.
2014-12-31 15:56:11 +01:00
bfcdba8d56 networkd: link - plug leak 2014-12-19 08:34:04 +01:00
19727828d2 networkctl: lldp - respect arg_legend 2014-12-19 08:33:46 +01:00
49699bac94 LLDP: Add support for networkctl 2014-12-19 08:15:05 +05:30
ce43e48446 networkd: integrate LLDP
This patch integrates LLDP with networkd.

Example conf:
file : lldp.network

[Match]
Name=em1

[Network]
LLDP=yes
2014-12-19 08:02:45 +05:30
266b538958 networkctl: port to verbs helper 2014-12-19 03:16:45 +01:00
b98b483bac networkd: add FDB support 2014-12-18 15:28:16 +01:00
81fd1dd3a2 networkctl: port from libudev to sd-hwdb 2014-12-15 20:40:09 +01:00
17d1f37d0d networkd: failing to track links is a serious problem so log at warning level rather than debug 2014-12-15 17:57:51 +01:00
b7378b89d2 networkctl: remove unused variable 2014-12-12 21:57:44 +01:00
b1acce80cd networkctl: also draw a nice unicode cirlce when "networkctl status" is run without parameters 2014-12-12 19:11:35 +01:00
1693a943ca networkctl: show interface names next to IP addresses if we dump adresses from all interfaces 2014-12-12 19:07:26 +01:00
69fb1176c4 networkctl: also show gateway address when "networkctl status" without further arguments is passed 2014-12-12 18:57:15 +01:00
888943fc62 networkctl: show MAC address OUI vendor next to MAC addresses 2014-12-12 18:56:35 +01:00
d076c6f9e4 networkd/resolved: correct spacing near eol in code comments 2014-12-11 15:04:43 +01:00
7303ec8f30 networkd: rename section [BridgePort] → [Bridge]
Let's stick to generic sections that describe the general technology,
instead of specific per-object sections, unless we really have a reason
to do that otherwise.
2014-12-10 19:07:48 +01:00
85bd849f09 networkd-dhcp6: Support ICMPv6 Other information
When ICMPv6 Other information is received, enable Information request
in DHCPv6. If the DHCPv6 client already exists, only update the client
if there is a transition from Other to Managed state.
2014-12-10 18:31:21 +01:00
5c79bd7983 networkd-dhcp6: Move ICMPv6 and DHCPv6 configuration to new file
Handle all aspects of ICMPv6 and DHCPv6 in a file of its own as is done
with DHCPv4 and IPv4LL.
2014-12-10 18:31:21 +01:00
1372d5eff4 networkd: remove unused variable
It is no longer used after 45af44d47d
2014-12-09 20:51:58 +01:00
45af44d47d networkd: manager - enumerate addresses globally, rather than per-link
The kernel always returns all addresses, rather than only for the given link, so let's only enumerate once.
2014-12-08 22:13:40 +01:00
1e19f35297 networkd: link - typo 2014-12-08 18:38:55 +01:00
935c0d26f7 networkd: route - ignore unknown address family 2014-12-08 18:38:55 +01:00
ca6038b896 udev: link-config - simplify net-match 2014-12-08 18:38:55 +01:00
285760fedf Check return value from reading name_assign_type attr
This file won't exist on kernels earlier than 3.17.
2014-12-08 18:38:55 +01:00
32bc8adcd8 net_setup/networkd: warn if matching is done on possibly unstable ifname 2014-12-05 16:01:18 +01:00
c106cc36b9 networkd: add basic [Link] settings to .network files
This allows the default link settings (set in .link files) to be overridden per Network. Only MTU and MACAddress is supported for now.
2014-12-05 00:38:10 +01:00
7eb08da4b3 udev: net_setup - allow matching on OriginalName=
This has been requested repeatedly, so let's give it a go. We explicitly do not allow matching
on names that have already been changed (from a previous udev run, or otherwise), and matching
on unpredictable names (ethX) is discouraged (but not currently disallowed).

We also currently allow:

[Match]
Name=veth0

[Link]
Name=my-name0
SomeOtherSetting=true

Which means that the link file will be applied the first time it is invoked, but
not on subsequent invocations, which may be surprising.
2014-12-04 18:53:47 +01:00
7bdb04298f networkd: tunnel - allow INADDR_ANY as the local address 2014-12-04 16:02:05 +01:00
9e7e440835 networkd: add support for source routing 2014-12-04 16:02:05 +01:00
00e8d83a5a networkd: fix compile
Rebase failure on my side.
2014-12-04 12:19:57 +01:00
b6a3ca6d87 networkctl: use the shared functions for enumerating the local gateways 2014-12-04 12:19:27 +01:00
e1853b00ef networkd: Add bridge port path cost
This patch add support to specify path cost of the
bridge port to be configured via conf file.

Exampe: conf

file: br.netdev

[NetDev]
Name=br-test
Kind=bridge

file: br.network
[Match]
Name=em1

[Network]
Bridge=br-test

[BridgePort]
Cost=332

 bridge link
2: em1 state UP : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master
br-test state disabled priority 32 cost 332
2014-12-04 11:13:32 +01:00
85a8eeee36 networkd: support vxlan parameters
V3: fix copy paste error
V4: Make manual and config more readable

Add vxlan paramertes to config.
2014-12-04 11:13:32 +01:00
1d050e1e0a rtnl: when querying local addresses and gateways, take address family into account 2014-12-04 01:42:42 +01:00
6c03d27d9f networkctl: remove unused variable 2014-12-03 23:51:56 +01:00
144232a8e0 networkd: fix typo
V2: found another one
2014-12-03 21:36:10 +01:00
d8500c5378 shared: add format helpers for printing MAC addresses
Use these in networctl.
2014-12-02 14:31:16 +01:00
c09da72900 networkctl: print the Gateway in the status output
This is the IP address of the default route on the link, if present. A
description is printed when available (the manufacturer of the gateway NIC based
on its MAC address).

In the future we should prefer LLDP information over MAC info.
2014-12-02 10:46:22 +01:00
82b1412852 network: remove unused variable 2014-11-30 02:35:52 +01:00
4a62c710b6 treewide: another round of simplifications
Using the same scripts as in f647962d64 "treewide: yet more log_*_errno
+ return simplifications".
2014-11-28 19:57:32 +01:00
56f64d9576 treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.

Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'

Plus some whitespace, linewrap, and indent adjustments.
2014-11-28 19:49:27 +01:00