Commit Graph

359 Commits

Author SHA1 Message Date
Susant Sahani 062c2eea3a networkd: ipv6ra allow to ignore addresses
Allows to ignore prefixes.

```
UseAutonomousPrefix=
UseOnLinkPrefix=
```

closes #9582
2019-02-14 21:05:17 +05:30
Susant Sahani 93b4dab57e networkd: Allow to retain configs even if carrier is lost
When there is bad link in the network the carrier goes up/down.
This makes networkd stops all the clients and drop config.
But if the remote router/dhcpserver running a prevention
of DHCP Starvation attack or DHCP Flood attack it does not allow
networkd to take a DHCP lease resulting failure in configuration.
This patch allows to keep the client running and keep the conf
also for this scenario.

Closes #9111
2019-02-06 13:35:11 +01:00
Lennart Poettering 7ece6f5897 networkd: permit DNS "DefaultRoute" configuration in .network files 2018-12-21 12:10:07 +01:00
Thomas Haller 8217ed5ec3 network: fix handling of uninitialized and zero IAID setting
An earlier commit 0e408b82b (dhcp6-client: handle IAID with value zero)
introduced a flag to sd_dhcp6_client to distinguish between an unset
IAID and a value set to zero.

However, that was not sufficient and broke leaving the setting
uninitialized in networkd configuration. The configuration parsing
also must distinguish between the default, unset value and an
explict zero configuration.

Fixes: 0e408b82b8
2018-12-10 14:25:28 +01:00
William A. Kennington III e4a71bf36f networkd: Static neighbor support
When using networkd we currently have no way of ensuring that static
neighbor entries are set when our link comes up. This change adds a new
section to the network definition that allows multiple static neighbors
to be set on a link.
2018-12-09 16:56:37 -08:00
Yu Watanabe 801503d22b
Merge pull request #10988 from ssahani/IFLA_BRPORT_MCAST_TO_UCAST
networkd: bridge add support to configure multicast_to_unicast
2018-12-06 14:32:52 +01:00
Susant Sahani 8b220643b1 networkd: RPDB rule - add support to configure inverted rule.
Closes #10706
2018-12-06 10:42:36 +05:30
Susant Sahani d3aa8b49e5 networkd: bridge add support to configure multicast_to_unicast
closes #10649
2018-12-03 23:49:46 +05:30
Yu Watanabe 97f9df9e30 network: rename Protocol= in [RoutingPolicyRule] to IPProtocol= 2018-12-02 06:13:47 +01:00
Susant Sahani 926062f083 networkd: add support to configure ip rule port range and protocol.
Please see:

iprule: support for ip_proto, sport and dport match options
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=f686f764682745daf6a93b0a6330ba42a961f858

Closes 10622
2018-11-28 20:06:28 +05:30
Yu Watanabe d493d82647 network: fix offset for IPv6MTUByte=
Fixes oss-fuzz#11302 and oss-fuzz#11314.
2018-11-09 11:44:51 +09:00
Yu Watanabe fd3005f9b8 network: fix worng offset for .network parser 2018-11-04 00:31:46 +09:00
Yu Watanabe 598c85cc46 network: fix alignment 2018-09-27 17:48:34 +09:00
Patrik Flykt 125f20b4de networkd-network: Introduce DHCPv6 PD knob for RFC 7084 WPD-4
RFC 7084, WPD-4, requires Customer Edge end routers to behave
according to the following:

"WPD-4:  By default, the IPv6 CE router MUST initiate DHCPv6 prefix
           delegation when either the M or O flags are set to 1 in a
           received Router Advertisement (RA) message.  Behavior of the
           CE router to use DHCPv6 prefix delegation when the CE router
           has not received any RA or received an RA with the M and the
           O bits set to zero is out of scope for this document."

Since it cannot be automatically detected whether DHCPv6 is to be
operated as an CE end router or whether to initiate an Informational
exchange to obtain other useful network information via DHCPv6 when the
Router Advertisement 'O' bit is set, a 'ForceDHCPv6PDOtherInformation'
boolean network configuration option in the '[DHCP]' section of a is
introduced. Setting this option causes DHCPv6 to be started in stateful
mode, although only the 'O' bit is seen in the Router Advertisement.

When 'ForceDHCPv6PDOtherInformation' is set and the Router Advertisement
has only the Other information 'O' bit set, disable requests for IA_NA
addresses.

Fixes #9745.
2018-09-19 13:45:17 -06:00
Yu Watanabe 0cf7c3fd21 network: accept additional time-value after ':' when DUIDType=link-layer-time 2018-08-08 10:15:00 +09:00
Iwan Timmer c9299be2f5 resolve: rename PrivateDNS to DNSOverTLS
PrivateDNS is not considered a good name for this option, so rename it to DNSOverTLS
2018-06-14 09:57:56 +02:00
Iwan Timmer d050561ac3 resolve: make PrivateDNS configurable per link
Like with DNSSec, make PrivateDNS configurable per link, so you can have trusted and untrusted links.
2018-06-11 21:35:58 +02:00
Hiram van Paassen 06828bb617 networkd-link: add support to configure CAN interfaces
This patch adds support for kind "can". Fixes: #4042.
2018-06-09 15:12:31 +02:00
Susant Sahani 866e6b7a12 networkd: enable to set IFF_ALLMULTI to network device (#9146)
networkd: allow setting set IFF_ALLMULTI flag on network devices
2018-06-01 16:22:12 +02:00
Susant Sahani e6ebebbe6a networkd: Add ability to set MULTICAST flag on interface
Closes #9113

fix ARP toggling flag
2018-05-30 12:59:24 +02:00
Susant Sahani cea79e6643 networkd: Support the ability to set MTU in [Route] sections
Add support to set the route MTU.

Closes #9047
2018-05-24 16:42:40 +02:00
Yu Watanabe 0fbddd042c network,udev: sort included headers 2018-05-09 12:00:27 +09:00
Yu Watanabe e90d037411 network,udev: make MACAddress= in [Match] section take multiple MAC addresses 2018-05-09 11:59:18 +09:00
Susant Sahani af1c0de0e1 networkd: add support to send DHCP user class option (#7499)
This patch add support to enables to send User Class option code 77
RFC 3004.

This option MAY carry multiple User Classes.

The format of this option is as follows:

         Code   Len   Value
        +-----+-----+---------------------  . . .  --+
        | 77  |  N  | User Class Data ('Len' octets) |
        +-----+-----+---------------------  . . .  --+

   where Value consists of one or more instances of User Class Data.
   Each instance of User Class Data is formatted as follows:

         UC_Len_i     User_Class_Data_i
        +--------+------------------------  . . .  --+
        |  L_i   | Opaque-Data ('UC_Len_i' octets)   |
        +--------+------------------------  . . .  --+

UserClass=
A DHCPv4 client can use UserClass option to identify the type or category of user or applications
it represents. The information contained in this option is an string that represents the user class
of which the client is a member. Each class sets an identifying string of information to be used by the DHCP service to classify clients. Takes a whitespace-separated list.

UserClass= hello world how are you

Closes: RFC: #5134
2018-05-07 14:21:02 +02:00
Susant Sahani 7f9915f0de networkd: Bridge Property Use kernel defaults. (#8825)
Rather than choosing to set or unset any of these flag
use kernel defaults. This patch makes following properties to unset.

UseBPDU = unset
HairPin = unset
FastLeave = unset
AllowPortToBeRoot = unset
UnicastFlood = unset
2018-04-27 10:32:28 +02:00
Lennart Poettering 4e964aa05c networkd,udev: clean up MTU handling
This cleans up handling of MTU values across the codebase. Previously
MTU values where stored sometimes in uint32_t, sometimes in uint16_t,
sometimes unsigned and sometimes in size_t. This now unifies this to
uint32_t across the codebase, as that's what netlink spits out, and what
the majority was already using.

Also, all MTU parameters are now parsed with config_parse_mtu() and
config_parse_ipv6_mtu() is dropped as it is now unneeded.

(Note there is one exception for the MTU typing: in the DCHPv4 code we
continue to process the MTU as uint16_t value, as it is encoded like
that in the protocol, and it's probably better stay close to the
protocol there.)
2018-04-26 13:51:44 +02:00
Susant Sahani 11102cba69 networkd: add support to configure IPv6 MTU (#8664)
This patch supports to configure IPv6 MTU.

Closes #8632
2018-04-20 11:38:39 +02:00
Susant Sahani fb5c821664 networkd: DHCPv6 client allow to configure Rapid Commit (#6930)
The DHCPv6 client can obtain configuration parameters from a
DHCPv6 server through a rapid two-message exchange solicit and reply).
When the rapid commit option is enabled by both the DHCPv6 client and
the DHCPv6 server, the two-message exchange is used, rather than the default
four-method exchange (solicit, advertise, request, and reply). The two-message
exchange provides faster client configuration and is beneficial in environments
in which networks are under a heavy load.

Closes #5845
2018-01-22 17:09:18 +09:00
Susant Sahani 09f5dfad2c networkd: add quickack option to route (#7896)
This patch adds quickack option to enable/disable TCP quick ack
mode for per-route.
2018-01-20 08:49:15 +09:00
Patrik Flykt 56a23cb40a networkd: Add DHCPv6 as a configuration option to radv prefixes
The Network section IPv6PrefixDelegation= option takes two new
configuration values, namely "static" and "dhcpv6" in addition
to boolean yes and no values. Static prefixes in IPv6Prefix
sections are used when IPv6PrefixDelegation= option contains
"static", and DHCPv6 is queried for prefixes when the option
contains "dhcpv6". Both DHCPv6 and static prefixes are used when
the option contains a boolean true value. The default value is
false as before, meaning no prefixes are delegated.
2018-01-04 15:22:43 +02:00
Susant Sahani 323d9329e7 networkd: allow to configure default/initial send/recv congestion window and store persistentl (#7750)
Currently we can only change initcwnd/initrwnd in the following way, and it does not store persistently:
sudo ip route change default via 192.168.1.1 dev tun0 initcwnd 20
sudo ip route change default via 192.168.1.1 dev tun0 initrwnd 20

For more details about initcwnd/initrwnd, please look at:
http://hjzhao.blogspot.com/2012/05/increase-initcwnd-for-performance.html
http://www.cdnplanet.com/blog/tune-tcp-initcwnd-for-optimum-performance
or google 'initcwnd initrwnd'

This work allows to configure the initcwnd and initrwnd.

Closes #2118
2017-12-29 23:18:05 +09:00
Lennart Poettering 5022f08a23 core,udev,networkd: add ConditionKernelVersion=
This adds a simple condition/assert/match to the service manager, to
udev's .link handling and to networkd, for matching the kernel version
string.

In this version we only do fnmatch() based globbing, but we might want
to extend that to version comparisons later on, if we like, by slightly
extending the syntax with ">=", "<=", ">", "<" and "==" expressions.
2017-12-26 17:39:44 +01:00
Saran Tunyasuvunakool 30cda194e8 networkd: RouteTable option in [IPv6AcceptRA] is now properly processed (#7633)
Fixes: #7632
2017-12-14 14:11:03 +09:00
Mathieu Trudel-Lapierre c1a3890410 Add a "RequiredForOnline=" Link attribute for .network files (#7347)
RequiredForOnline= denotes a link/network that does/does not require being up
for systemd-networkd-wait-online to consider the system online; this makes it
possible to ignore devices without modifying parameters to wait-online.
2017-11-30 18:03:50 +01:00
Zbigniew Jędrzejewski-Szmek 82a27ba821
Merge pull request #7389 from shawnl/warning
tree-wide: adjust fall through comments so that gcc is happy
2017-11-22 07:38:51 +01:00
Susant Sahani 762e2659b9 networkd: support incoming/outgoing device for rule matching (#7223)
Closes #7210
2017-11-21 11:51:50 +01:00
Shawn Landden 4831981d89 tree-wide: adjust fall through comments so that gcc is happy
Distcc removes comments, making the comment silencing
not work.

I know there was a decision against a macro in commit
ec251fe7d5
2017-11-20 13:06:25 -08:00
Patrik Flykt 9e25315caa networkd: Add EmitDNS and EmitDomains configuration options
Add EmitDNS= and EmitDomains= options to the IPv6PrefixDelegation
network configuration file section so that sending DNS servers
and DNS search domains can be configured independent of each other.

The default values for both are set to true.
2017-10-06 12:30:27 +03:00
Lennart Poettering cd4826e0e6 Merge pull request #6924 from andir/vrf-dhcpv4
networkd: use VRFs routing table for DHCP routes
2017-09-28 09:46:03 +02:00
Andreas Rammhold fc1ba79d65 networkd: use VRFs routing table for DHCP routes
When an interface has been enslaved to a VRF the received routes should
be added to the VRFs RT instead of the main table.

This change modifies the default behaviour of routes in the case where a
network belongs to an VRF.  When the user does not configure a
`DHCP.RouteTable` in a `systemd.network` file and the interface belongs
to a VRF, the VRFs routing table is used instead of RT_TABLE_MAIN.

When the user has configured a custom routing table for DHCP the VRFs
table is ignored and the users preference takes precedence.
2017-09-27 20:02:15 +02:00
Susant Sahani 983226f35a networkd: route - support unicast,blackhole,unreachable and prohibited (#6861)
Resolves issues #797 and #967.

Conf

```
[Route]
Type=blackhole
Destination=202.54.1.2
```

ip route

```
blackhole 202.54.1.2 proto static
2017-09-19 16:28:26 +02:00
Patrik Flykt 700f1186e3 networkd: Parse DNS search domain information for Router Advertisement
Parse DNS search domains from .network files so that they are included
in Router Advertisement DNSSL options.

DNS search domains are added to the [IPv6PrefixDelegation] section using
the following syntax:

    Domains=foo.example.com bar.example.com

If IDNA libraries are enabled in systemd, international domain names
are supported.
2017-09-15 10:34:57 +03:00
Susant Sahani bce67bbee3 networkd: add support to configure IP Rule (#5725)
Routing Policy rule manipulates rules in the routing policy database control the
route selection algorithm.

This work supports to configure Rule
```
[RoutingPolicyRule]
TypeOfService=0x08
Table=7
From= 192.168.100.18

```

```
ip rule show
0:	from all lookup local
0:	from 192.168.100.18 tos 0x08 lookup 7
```

V2 changes:

1. Added logic to handle duplicate rules.
2. If rules are changed or deleted and networkd restarted
   then those are deleted when networkd restarts next time

V3:

1. Add parse_fwmark_fwmask
2017-09-14 21:51:39 +02:00
Lennart Poettering 9ecf63a457 Merge pull request #6616 from pfl/rdnss
networkd: RDNSS option for systemd-networkd prefix delegation
2017-09-07 19:01:57 +02:00
Patrik Flykt 88295a05db networkd: Parse DNS IPv6 information for Router Advertisement
Parse DNS IPv6 addresses and DNS server lifetime from .network files
so that they can be included in Router Advertisement RDNSS options.

RDNSS address and lifetime information is added to the
[IPv6PrefixDelegation] section according to the following syntax:

DNS=2001:db8:🅰️b 2001:db8::c:d
DNSLifetimeSec=1042
2017-09-07 09:51:26 +03:00
juga0 7585baa016 networkd: RFC7844, add configuration variable
to enable Anonymity Profiles and document it.
2017-09-06 19:03:25 +02:00
Susant Sahani dad2d78e1a networkd: Allow configure a specific link even if it has no carrier. (#6740)
This work allows to configure a specific link even if it has no carrier.

Closes #6645.
2017-09-06 16:57:04 +02:00
Susant Sahani 2959fb07cb networkd: add scope to address section (#6449)
This work allows to configure address Scope to

host | link | global or a number.

Closes #6446
2017-08-01 09:44:08 +02:00
Patrik Flykt 7d5cac19b5 networkd: Add Router Advertisement variables
Add variables for enabling Router Advertisements, router lifetime as
well as managed and other information flags indicating use of DHCPv6.
Add configuration of default router preferences as defined in RFC 4191.

IPv6PrefixDelegation in the [Network] section has to be set in order
to enable prefix delegation. The rest of the prefix delegation values
are stored in the [IPv6PrefixDelegation] section. The host will act as
a default router if it is given a non-zero lifetime with
RouterLifetimeSec. Managed and OtherInformation booleans set the level
of DHCPv6 support, and the RouterPreference configures the router's
preference between low, medium and high. Words 'normal' and 'default'
are added as synonyms for 'medium' just to make configuration simpler.

This adds a section like the following to .network configuration files:
[Network]
IPv6PrefixDelegation=true

[IPv6PrefixDelegation]
RouterLifetimeSec=2000
Managed=false
OtherInformation=true
RouterPreference=medium
2017-05-15 14:49:50 +03:00
Patrik Flykt 9d5d0090ca networkd: Add IPv6Prefix sections to the network configuration files
Support zero or more [IPv6Prefix] sections in the network configuration
files. Each section can have one Prefix=<subnet>[/<prefixlength>]
option, with the preferred and valid lifetimes specified by
ValidLifetimeSec and PreferredLifetimeSec measured in seconds, and
with onlink and address autoconfiguration booleans specified by
OnLink and AddressAutoconfiguration variables.

This adds a section like the following to .network configuration files:
[IPv6Prefix]
Prefix=2001:db8:dead:beef::/64
OnLink=true
AddressAutoconfiguration=true
ValidLifetimeSec=1500
PreferredLifetimeSec=1000
2017-05-15 14:49:50 +03:00
Hristo Venev 465dfe59fc networkd: add IPv6ProxyNDP (#5913)
This allows enabling proxy_ndp even if no addresses are configured in
networkd, as well as disabling proxy_ndp from a drop-in.
2017-05-09 20:04:55 +02:00
Susant Sahani c83ecc04d9 networkd: add support to configure route protocol. (#5890)
Closes: #5889
2017-05-09 20:01:25 +02:00
Dimitri John Ledkov f00ff0de40 network: reject bridge port priorities above kernel's max value. (#5877)
Bridge port priority in the kernel can only be between 0 and 63. Therefore
reject values above maximum.

Fixes: #5729
2017-05-02 15:32:42 -04:00
Susant Sahani 95b74ef6ea networkd: add support for address label
IPv6 address labels are used for address selection; they are described in RFC 3484.
Precedence is managed by userspace, and only the label itself is stored in the kernel.

enp0s25.network

[Match]
Name=enp0s25

[Network]
DHCP=yes
Address = 2001:db8:f00:baa::b

[AddressLabel]
Label=199
Prefix=2001:db8:41::/64

[AddressLabel]
Label=11
Prefix=2001:db8:31::/64

[AddressLabel]
Label=123
Prefix=2001:db8:21::/64

[AddressLabel]
Label=124
Prefix=2001:db8:11::/64
[sus@maximus label]$ ip addrlabel list

prefix ::1/128 label 0
prefix ::/96 label 3
prefix ::ffff:0.0.0.0/96 label 4
prefix 2001:db8:41::/64 dev enp0s25 label 199
prefix 2001:db8:31::/64 dev enp0s25 label 11
prefix 2001:db8:21::/64 dev enp0s25 label 123
prefix 2001:db8:11::/64 dev enp0s25 label 124
prefix 2001::/32 label 6
prefix 2001:10::/28 label 7
prefix 3ffe::/16 label 12
prefix 2002::/16 label 2
prefix fec0::/10 label 11
prefix fc00::/7 label 5
prefix ::/0 label 1
2017-04-26 16:00:44 +05:30
Susant Sahani b5bf6f645e networkd: make IPv6 route preference configurable (#5700)
The work supports route preference configurable.
i.e. able to set low, medium and high.
2017-04-25 09:32:59 +02:00
Susant Sahani 28959f7d3e networkd: route - support 'onlink' routes (#5734)
This work based on Tom's original patch
teg@1312172

By setting GatewayOnlink=yes, the kernel will assume that the gateway is onlink
even if there is no route to it.

Resolves issue #1283.
2017-04-21 11:22:30 +02:00
Dimitri John Ledkov b56be2966a networkd: Add bridge port priority setting (#5545)
Allow setting bridge port priority in the Bridge section of the network file,
similar to e.g. port path cost setting.

Set the default to an invalid value of 128, and only set the port priority when
it's not 128. Unlike e.g. path cost, zero is a valid priority value.

Add a networkd-test.py to check that bridge port priority is correctly set.

Incidently, fix bridge port cost type and document valid ranges.
2017-04-11 23:17:31 +02:00
Florian Klink a0e5c15d4f networkd: add IPv6ProxyNDPAddress support (#5174)
IPv6 Neighbor discovery proxy is the IPv6 equivalent to proxy ARP for IPv4.
It is required when ISPs do not unconditional route IPv6 subnets
to their designated target, but expect neighbor solicitation messages
for every address on a link.

A variable IPv6ProxyNDPAddress= is introduced to the [Network] section,
each representing a IPv6 neighbour proxy entry in the neighbour table.
2017-02-11 00:47:55 +01:00
Zbigniew Jędrzejewski-Szmek cbd50adce0 networkd: reorder gperf fields
In eb64b435eb ActiveSlave/PrimarySlave were inserted in between
IPv6AcceptRA and IPv6AcceptRouterAdvertisements and the comment then didn't
make sense. It turns out that gperf does not understand C-style comments, and
that there's no comment syntax in the keywords section. The following was
generated:

      {"/* legacy alias for the above */"},
      {"Network.IPv6AcceptRA",                   config_parse_tristate,                          0,                             offsetof(Network, ipv6_accept_ra)},

In practice this wouldn't lead to problems because this fake pattern would be
hard to match, but it seems better to remove the comments altogether.

Readers of the .gperf file will have to look for the repeated output field to
notice legacy options. To make this easier, let's always keep the legacy option
second.
2017-01-11 16:37:13 -05:00
Susant Sahani 8f9a206b6c networkd: Rename ProxyARP to IPv4ProxyARP (#4947)
Rename the arp proxy option to IPv4ProxyARP= in order to clarify
its relationship to IPv4, and map to the various IPv6 options we have.

Fixes: #4768
2016-12-22 10:23:29 +01:00
Susant Sahani eb64b435eb networkd: bond support primary slave and active slave (#4873)
active_slave:

Specifies the new active slave for modes that support it
(active-backup, balance-alb and balance-tlb).

primary slave:
systemd-networks currently lacks the capability to set the primary slave
in an
active-backup bonding. This is necessary if you prefer one interface
over the
other. A common example is a eth0-wlan0 bonding on a laptop where you'd
want to
switch to the wired connection whenever it's available.

Fixes: #2837
2016-12-21 19:10:36 +01:00
Susant Sahani 9c77d1079d networkd: Use dhcp correct type for IP port (#4840)
Fixes: #4839
2016-12-06 12:22:33 +01:00
David Michael a09dc5467a networkd: support marking links unmanaged 2016-12-01 14:41:51 -08:00
Lennart Poettering 265759908d networkd: validate NTP server strings configured in .network files
Let's be a bit stricter, and make sure users only configure proper DNS names or
IP addresses, but not any other strings.
2016-11-21 22:58:26 +01:00
Tom Gundersen 23f53b99b1 networkd: clean up main header file a bit
Rename networkd.h to networkd-manager.h, to more accurately describe what it
contains.
2016-11-14 01:05:06 +01:00
Susant Sahani 9faed222fc networkd: support setting dhcp client listen port (#4631)
Allow setting custom port for the DHCP client to listen on in networkd.

[DHCP]
ListenPort=6677
2016-11-10 18:34:19 -05:00
Susant Sahani 5325382440 networkd : verify dns ip address when parsing configuration (#4492)
Invalid IP addresses would be passed through as-is:
$ networkctl status wlp3s0:
● 2: wlp3s0
       Link File: /usr/lib/systemd/network/99-default.link
    Network File: /etc/systemd/network/wlp3s0.network
            Type: wlan
           State: routable (configured)
            Path: pci-0000:03:00.0
          Driver: iwlwifi
          Vendor: Intel Corporation
           Model: Centrino Advanced-N 6205 [Taylor Peak] (Centrino Advanced-N 6205 AGN)
      HW Address: XXXXXXXXXX (Intel Corporate)
         Address: 192.168.2.103
                  XXXXXXXXXXX
         Gateway: 192.168.2.1 (Arcadyan Technology Corporation)
             DNS: 127.0.0.5553

Instead verify that DNS= has a valid list of addresses when parsing configuration.

Fixes #4462.
2016-10-26 19:31:04 -04:00
Susant Sahani e63be0847c networkd: address add support to configure flags (#4201)
This patch enables to configure

IFA_F_HOMEADDRESS
IFA_F_NODAD
IFA_F_MANAGETEMPADDR
IFA_F_NOPREFIXROUTE
IFA_F_MCAUTOJOIN
2016-10-08 13:05:41 +02:00
Jason Kölker 2ba31d29a5 networkd: Allow specifying RouteTable for RAs 2016-09-19 03:27:46 +00:00
Jason Kölker f594276b86 networkd: Allow specifying RouteTable for DHCP 2016-09-19 03:27:42 +00:00
Tobias Jungel ffff9abe1d networkd: apply bridge vlan configuration correct
bridge vlan configuration was applied even if it wasn't configured.

fixes #3876
2016-08-04 17:14:18 +02:00
Susant Sahani 99d2baa2ca networkd: add support to configure NOARP/ARP for interface (#3854)
https://lists.freedesktop.org/archives/systemd-devel/2016-August/037268.html
2016-08-04 10:00:58 -04:00
Lennart Poettering 5733d88dc1 networkd: fix bad memory access when parsing DNSSECNegativeTrustAnchors= 2016-06-21 13:20:47 +02:00
Andreas Rammhold 6cb955c6a1 networkd: vrf: add support for enslaving devices to VRFs 2016-06-16 00:25:06 +02:00
Tobias Jungel 13b498f967 networkd: add support to configure VLAN on bridge ports 2016-06-10 09:10:41 +02:00
Lennart Poettering f921f5739e networkd: rename IPv6AcceptRouterAdvertisements to IPv6AcceptRA
The long name is just too hard to type. We generally should avoid using
acronyms too liberally, if they aren't established enough, but it appears that
"RA" is known well enough. Internally we call the option "ipv6_accept_ra"
anyway, and the kernel also exposes it under this name. Hence, let's rename the
IPv6AcceptRouterAdvertisements= setting and the
[IPv6AcceptRouterAdvertisements] section to IPv6AcceptRA= and [IPv6AcceptRA].

The old setting IPv6AcceptRouterAdvertisements= is kept for compatibility with
older configuration. (However the section [IPv6AcceptRouterAdvertisements] is
not, as it was never available in a published version of systemd.
2016-06-07 11:24:30 +02:00
Lennart Poettering 1e7a0e21c9 network: beef up ipv6 RA support considerably
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more
comprehensively. Since the API is extended quite a bit networkd has been ported
over too, and the patch is not as straight-forward as one could wish. The
rework includes:

- Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two
  new configuration options have been added to networkd to make this
  configurable.

- sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA
  message, and has direct, friendly acessor functions for the singleton RA
  properties, as well as an iterative interface to iterate through known and
  unsupported options. The router object may either be retrieved from the wire,
  or generated from raw data. In many ways the sd-ndisc API now matches the
  sd-lldp API, except that no implicit database of seen data is kept. (Note
  that sd-ndisc actually had a half-written, but unused implementaiton of such
  a store, which is removed now.)

- sd-ndisc will now collect the reception timestamps of RA, which is useful to
  make sd_ndisc_router fully descriptive of what it covers.

Fixes: #1079
2016-06-06 20:11:38 +02:00
Clemens Gruber 77ff6022fa networkd: Add EmitRouter= option for DHCP Server (#3251)
Add an option to disable appending DHCP option 3 (Router) to the DHCP
OFFER and ACK packets.
This commit adds the boolean option EmitRouter= for the [DHCPServer]
section in .network files.

Rationale: On embedded devices, it is very useful to have a DHCP server
running on an USB OTG ethernet gadget interface to avoid manual setup on
the client PCs, but it should only serve IP addresses, no route(r)s.
Otherwise, Windows clients experience network connectivity issues, due
to them using the address set in DHCP option 3 as default gateway.

Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
2016-05-17 19:34:25 -04:00
Lennart Poettering 7272b25e16 networkd: reworkd LLDP emission to allow control of propagation level
This allows selecting the propagation level of emitted LLDP packets
(specifically: the destination MAC address of the packets). This is useful
because it allows generating LLDP packets that optionally cross certain types
of bridges.

See 802.11ab-2009, Table 7-1 for details.
2016-05-09 15:45:31 +02:00
Lennart Poettering d05def163e networkd: move the IAID configuration option into the [DHCP] section
It's only relevant to DHCP, and it should be where the DUID is configured too.
2016-05-06 17:04:05 +02:00
Lennart Poettering 5119d304ff Merge pull request #3156 from keszybz/duid-settings
Rework DUID setting
2016-05-04 11:31:59 +02:00
Susant Sahani b5834a0b38 networkd: Add support to configure IPv6 preferred lifetime (#3102)
Closes #2166.

We only allow 0, infinity and forever.
infinity and forever is same.
2016-05-03 15:54:26 -04:00
Susant Sahani c953b24c65 networkd: add support to set route table
networkd: add support to set route table
1. add support to configure the table id.
   if id is less than 256 we can fit this in the header of route as
   netlink property is a char. But in kernel this proepty is a
   unsigned 32. Hence if greater that 256 add this as RTA_TABLE
attribute.

2. we are not setting the address family now. Now set this property.
2016-05-03 23:18:21 +05:30
Zbigniew Jędrzejewski-Szmek 8341a5c381 networkd: rework duid_{type,duid_type,duid,duid_len} setting
Separate fields are replaced  with a struct.

Second second duid type field is removed. The first field was used to carry
the result of DUIDType= configuration, and the second was either a copy of
this, or contained the type extracted from DuidRawData. The semantics are changed
so that the type specified in DUIDType is always used. DUIDRawData= no longer
overrides the type setting.

The networkd code is now more constrained than the sd-dhcp code:
DUIDRawData cannot have 0 length, length 0 is treated the same as unsetting.
Likewise, it is not possible to set a DUIDType=0. If it ever becomes necessary
to set type=0 or a zero-length duid, the code can be changed to support that.
Nevertheless, I think that's unlikely.

This addresses #3127 § 1 and 3.

v2:
- rename DUID.duid, DUID.duid_len to DUID.raw_data, DUID.raw_data_len
2016-05-03 12:23:01 -04:00
Lennart Poettering 076ea6f6d2 networkd: clean up DUID code a bit
Let's move DUID configuration into the [DHCP] section, since it only makes
sense in a DHCP context, and should be close to the configuration of
ClientIdentifier= and suchlike.

This really shouldn't be a section of its own, we don't have any for any of our
other per-protocol specific identifiers...

Follow-up for #2890 #2943
2016-04-29 12:23:34 +02:00
Susant Sahani 23d8b221c0 networkd: Add support to configure proxy arp support to interfaces (#3020)
Fixes: #2889
2016-04-14 11:56:57 +02:00
Vinay Kulkarni 413708d106 DHCP DUID, IAID configuration options 2016-03-30 16:33:55 -07:00
Zbigniew Jędrzejewski-Szmek afec45395f Revert "DHCP DUID and IAID configurability" 2016-03-21 18:24:24 -04:00
Vinay Kulkarni c83321e6d4 DHCP DUID and IAID configurability 2016-03-09 21:58:44 -08:00
Lennart Poettering 8e1ad1eaf7 networkd: add basic LLDP transmission support
Let's add some minimalistic LLDP sender support. The idea is that this is
either on or off, and all fields determined automatically rather than
configured explicitly.
2016-02-21 20:58:59 +01:00
Lennart Poettering 34437b4f9c sd-lldp: rework sd-lldp API
This reworks the sd-lldp substantially, simplifying things on one hand, and
extending the logic a bit on the other.

Specifically:

- Besides the sd_lldp object only one other object is maintained now,
  sd_lldp_neighbor. It's used both as storage for literal LLDP packets, and for
  maintainging info about peers in the database. Separation between packet, TLV
  and chassis data is not maintained anymore. This should be a major
  simplification.

- The sd-lldp API has been extended so that a couple of per-neighbor fields may
  be queried directly, without iterating through the object. Other fields that
  may appear multiple times, OTOH have to be iterated through.

- The maximum number of entries in the neighbor database is now configurable
  during runtime.

- The generation of callbacks from sd_lldp objects is more restricted:
  callbacks are only invoked when actual data changed.

- The TTL information is now hooked with a timer event, so that removals from
  the neighbor database due to TTLs now result in a callback event.

- Querying LLDP neighbor database will now return a strictly ordered array, to
  guarantee stability.

- A "capabilities" mask may now be configured, that selects what type of LLDP
  neighbor data is collected. This may be used to restrict collection of LLDP
  info about routers instead of all neighbors. This is now exposed via
  networkd's LLDP= setting.

- sd-lldp's API to serialize the collected data to text files has been removed.
  Instead, there's now an API to extract the raw binary data from LLDP neighbor
  objects, as well as one to convert this raw binary data back to an LLDP
  neighbor object. networkd will save this raw binary data to /run now, and the
  client side can simply parse the information.

- support for parsing the more exotic TLVs has been removed, since we are not
  using that. Instead there are now APIs to extract the raw data from TLVs.
  Given how easy it is to parse the TLVs clients should do so now directly
  instead of relying on our APIs for that.

- A lot of the APIs that parse out LLDP strings have been simplified so that
  they actually return strings, instead of char arrays with a length. To deal
  with possibly dangerous characters the strings are escaped if needed.

- APIs to extract and format the chassis and port IDs as strings has been
  added.

- lldp.h has been simplified a lot. The enums are anonymous now, since they
  were never used as enums, but simply as constants. Most definitions we don't
  actually use ourselves have eben removed.
2016-02-21 20:40:56 +01:00
Lennart Poettering b2a81c0b52 networkd: optinally use DHCP lease domain info for routing only
This changes the UseDomains= setting of .network files to take an optional third value "route", in addition to the
boolean values. If set, the passed domain information is used for routing rules only, but not for the search path
logic.
2016-01-26 14:42:04 +01:00
Lennart Poettering 27cb34f574 networkd: rename a few Network object properties to be more like the configuration settings
All booleans called dhcp_xyz are now called ".dhcp_use_xyz", to match their respective configuration file settings. This
should clarify things a bit, in particular as there is a DHCP hostname that was previously called just ".hostname"
because ".dhcp_hostname" was already existing as a bool. Since this confusion is removed now because the bool is called
".dhcp_use_hostname", the string field is now renamed to ".dhcp_hostname".
2016-01-26 14:42:04 +01:00
Lennart Poettering 3df9bec57c networkd: rework Domains= setting
Previously, .network files only knew a vaguely defined "Domains=" concept, for which the documentation declared it was
the "DNS domain" for the network connection, without specifying what that means.

With this the Domains setting is reworked, so that there are now "routing" domains and "search" domains. The former are
to be used by resolved to route DNS request to specific network interfaces, the latter is to be used for searching
single-label hostnames with (in addition to being used for routing). Both settings are configured in the "Domains="
setting. Normal domain names listed in it are now considered search domains (for compatibility with existing setups),
while those prefixed with "~" are considered routing domains only. To route all lookups to a specific interface the
routing domain "." may be used, referring to the root domain. An alternative syntax for this is the "*", as was already
implemented before using the "wildcard" domain concept.

This commit adds proper parsers for this new logic, and exposes this via the sd-network API. This information is not
used by resolved yet, this will be added in a later commit.
2016-01-26 14:42:03 +01:00
Lennart Poettering 8a516214c4 resolved: introduce support for per-interface negative trust anchors 2016-01-06 18:36:32 +01:00
Lennart Poettering ad6c047561 resolved,networkd: add a per-interface DNSSEC setting
This adds a DNSSEC= setting to .network files, and makes resolved honour
them.
2016-01-05 20:10:31 +01:00
Lennart Poettering aaa297d4e5 networkd,resolved: add a per-interface mdns configuration option 2016-01-05 17:41:41 +01:00
Lennart Poettering af49ca27ff resolved,networkd: unify ResolveSupport enum
networkd previously knew an enum "ResolveSupport" for configuring
per-interface LLMNR support, resolved had a similar enum just called
"Support", with the same value and similar pasers.

Unify this, call the enum ResolveSupport, and port both daemons to it.
2016-01-05 17:30:51 +01:00
Susant Sahani b69c318040 networkd: Add support to configure IPV6 hop limit
This patch adds support to configure IPV6 hop limit.

For example:
/proc/sys/net/ipv6/conf/wlp3s0/hop_limit
2015-11-10 09:26:38 +05:30
Susant Sahani 8749cbcd4f networkd: add support for configure IPv6 DAD
Configures Ipv6 Duplicate Address Detection.

10
2015-10-16 10:53:20 +05:30
Jens Kuske 0d07e595cc networkd: add support to configure preferred source of static routes 2015-09-24 14:04:51 +02:00
Susant Sahani 4f2e437ad7 networkd:add support to configure ipv6 acceprt ra
This patch support to configure the ipv6 acceprt ra option.

for more information see
http://www.tldp.org/HOWTO/Linux+IPv6-HOWTO/proc-sys-net-ipv6..html
2015-09-12 08:18:06 +05:30
Tom Gundersen 9b3a67c55b networkd: dhcp-server - allow configuration of the pool
The constraints we place on the pool is that it is a contiguous
sequence of addresses in the same subnet as the server address, not
including the subnet nor broadcast addresses, but possibly including
the server address itself. If the server address is included in the
pool it is (obviously) reserved and not handed out to clients.
2015-08-31 21:42:33 +02:00
Lennart Poettering 1a04db0fc9 dhcp,network: support emitting DNS/NTP server information from DHCP server
For now, this is very simple and IP addresses have to be configured
manually.
2015-08-27 14:48:37 +02:00
Lennart Poettering 586ac6f711 networkd: make DHCP lease timeouts configurable 2015-08-27 01:47:42 +02:00
Lennart Poettering 8eb9058dc1 dhcp,network: implement RFC 4833 (DHCP Timezone option)
This one is simply to add: encode the tzdata timezone in the DHCP
options and optionally make use of it.
2015-08-26 20:44:20 +02:00
Daniel Mack a7e5da6e33 sd-network: make LLMNR specific config parser generic
Rename the enum, the lookup functions and the parser for LLMNRSupport so
the type can be reused for mDNS.
2015-08-25 14:26:01 +02:00
Susant Sahani f33ff02b1a networkd: add support for macvtap
This patch add support for macvtap.

see http://virt.kernelnewbies.org/MacVTap
2015-07-27 11:18:28 +05:30
Zbigniew Jędrzejewski-Szmek 23da66bb40 networkd: rename RootBlock to AllowPortToBeRoot
Justification is similar to BPDUGuard rename. "Positive" values
are easier. This is a rather uncommon option, so using a slightly
longer name should not be a problem, and may in fact may make it
easier to guess what the option does without reading the
documentation.
2015-07-24 23:44:42 -04:00
Zbigniew Jędrzejewski-Szmek 84c3409631 networkd: rename BPDUGuard to UseBPDU
Rename to follow the follow the style of other options.

In general "positive" options are preferred to "negative" ones,
because they are easier to describe and easier for humans to
parse (c.f. the shortening on the man page entry).
2015-07-24 23:44:42 -04:00
Susant Sahani eb7ff4dd5f networkd: add bridge link properties
new bridge properties

br.network

[Match]
Name=enp0s25

[Network]
Bridge=br-test

[Bridge]
Cost=332
BPDUGuard = true
HairPin = true
FastLeave = true
RootBlock = true
UnicastFlood = true
2015-07-23 23:31:58 +05:30
Susant Sahani a7d0ef446e networkd: DHCP override hostname
This patch enhances the DHCP client to send the hostname
reference
http://lists.freedesktop.org/archives/systemd-devel/2014-July/021550.html

Tested with
Example conf:

[Match]
Name=eth1

[Network]
DHCP=v4

[DHCP]
SendHostname=true
Hostname=test
2015-07-10 15:42:27 +05:30
Susant Sahani 49092e22c2 networkd: Add support for ipv6 privacy extension
This patch add support for ipv6 privacy extensions.

The variable  /proc/sys/net/ipv6/conf/<if>/use_tempaddr

can be changed via the boolean

IPv6PrivacyExtensions=[yes/no/prefer-temporary]

When true enables privacy extensions, but prefer public addresses over
temporary addresses.
prefer-temporary  prefers temporary adresses over public addresses.
Defaults to false.

[Match]
Name=enp0s25

[Network]
IPv6PrivacyExtensions=prefer-temporary
2015-07-05 11:24:31 +05:30
Nick Owens 8add5f7970 networkd: create "kernel" setting for IPForwarding
In 5a8bcb674f, IPForwarding was introduced
to set forwarding flags on interfaces in .network files. networkd sets
forwarding options regardless of the previous setting, even if it was
set by e.g. sysctl. This commit creates a new option for IPForwarding,
"kernel", that preserves the sysctl settings rather than always setting
them.

See https://bugs.freedesktop.org/show_bug.cgi?id=89509 for the initial
bug report.
2015-06-11 12:09:21 -07:00
Michael Marineau 301f4073fe network: add UseNTP DHCP option
Despite having the internal logic in place to enable/disable using NTP
servers provided by DHCP the network config didn't expose the option.
2015-03-15 17:26:58 -04:00
Jan Janssen 3e43b2cd97 networkd: Make DHCP client ID creation configurable 2015-03-04 11:01:39 +01:00
Alin Rauta 0d4ad91dd4 networkd: add support for Uplink Failure Detection
Introduce BindCarrier= to indicate the set of links that determine if
the current link should be brought UP or DOWN.

[tomegun: add a bit to commit message]
2015-02-27 13:58:30 -05:00
Tom Gundersen 60c3556660 networkd: network - rename ipv6token parser
Too generic name.
2015-02-14 00:32:56 +01:00
Tom Gundersen 56fd6bf795 networkd: .network - rename LinkLocal to LinkLocalAddressing
Makes it a bit less ambiguous.
2015-02-14 00:32:26 +01:00
Tom Gundersen 5256e00e8b net: support globbing and disjunction in Match logic
Match{Name,OrginalName,Type,Driver,Path} can now take a space-separated glob of matches.
2015-02-10 22:30:35 +01:00
Tom Gundersen 769b56a308 networkd: support route scopes
For now we only support the hardcoded values RT_SCOPE_{UNIVERSE,LOCAL,HOST},
and not numerical values or values from /etc/iproute2/rt_scopes.

This addresses https://bugs.freedesktop.org/show_bug.cgi?id=88508.
2015-02-09 16:53:54 +01:00
Tom Gundersen 7f77697a17 networkd: add support for IPv6 tokens
This allows the admin to set the host-specific part of IPv6 addresses, but still
receive the prefix via SLAAC.

.network file snippet:

[Network]
IPv6Token=::12

gives:

$ ip token
token ::12 dev eth0

This closes https://bugs.freedesktop.org/show_bug.cgi?id=81177.
2015-02-09 12:20:10 +01:00
Tom Gundersen d0d6a4cd70 networkd: generalize IPv4LL to LinkLocal
This allows both IPv4 and IPv6 link-local addresses to be enabled or disabled. By default
we still enable IPv6LL and disable IPv4LL. The old config option is kept for backwards
compatibility, but removed from the documentation.
2015-02-09 12:20:10 +01:00
Tom Gundersen c4a5ddc9f2 networkd: netdev - add ipvlan support 2015-01-19 23:25:16 +01:00
Lennart Poettering 769d324c99 networkd: make IP forwarding for IPv4 and IPv6 individually configurable 2015-01-13 20:17:07 +01:00
Lennart Poettering 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
Susant Sahani 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
Alin Rauta b98b483bac networkd: add FDB support 2014-12-18 15:28:16 +01:00
Lennart Poettering 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
Tom Gundersen 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
Tom Gundersen 9e7e440835 networkd: add support for source routing 2014-12-04 16:02:05 +01:00
Susant Sahani 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
Angus Gibson 84b5b79a8f networkd: allow specification of DHCP route metric
This lets the routing metric for links to be specified per-network,
still defaulting to DHCP_ROUTE_METRIC (1024) if unspecified. Hopefully
this helps with multiple interfaces configured via DHCP.
2014-09-08 15:09:08 +02:00
Tom Gundersen 6192b846ca networkd: add support for Domains= to .network files
This allows the search/routing domanis to be specified per link/network and be passed
on to resolved.
2014-08-15 15:15:24 +02:00
Tom Gundersen ad0734e890 networkd: rename UseDomainName to UseDomains
This option will also apply to the search domains, so make it plural.
2014-08-15 12:53:34 +02:00
Tom Gundersen bd8f653876 networkd: add and expose per-link LLMNR config option 2014-08-04 16:56:34 +02:00
Tom Gundersen 6a0a2f860f networkd: unify handling of stacked netdevs 2014-07-28 12:16:40 +02:00
Tom Gundersen bfa695b5cc networkd: ipv4ll - default to setting up ipv4ll routes
This is necessary for non-ipv4ll hosts to communicate with ipv4ll-only hosts on the same link. Defaults
to being enabled, but can be opted out.

See: <http://avahi.org/wiki/AvahiAutoipd#Routes>
2014-07-25 02:14:23 +02:00
Tom Gundersen b0e39c8284 networkd: merge DNS and NTP entries when exporting
In the state files, do not distinguish where the various entries came from
(static or DHCP), but include them all in the same list.
2014-07-23 23:54:51 +02:00
Tom Gundersen f5de5b0020 sd-dhcp-client: make request broadcasts opt-in
It appears there is no good way to decide whether or not broadcasts should be enabled,
there is hardware that must have broadcast, and there are networks that only allow
unicast. So we give up and make this configurable.

By default, unicast is used, but if the kernel were to inform us abotu certain
interfaces requiring broadcast, we could change this to opt-in by default in
those cases.
2014-07-15 18:55:31 +02:00
Tom Gundersen dde2efef37 networkd: add back route destination support
This was accidentally dropped when adding metric support.
2014-07-14 12:14:23 +02:00
Susant Sahani edb85f0d8d networkd: dhcp add vendor class indentifier option 60
Vendor Class Identifier be used by DHCP clients to identify
their vendor type and configuration. When using this option,
vendors can define their own specific identifier values, such
as to convey a particular hardware or operating system
configuration or other identifying information.

Vendor-specified DHCP options—features that let administrators assign
separate options to clients with similar configuration requirements.
For example, if DHCP-aware clients for example we want to separate
different gateway and option for different set of people
(dev/test/hr/finance) in a org or devices for example web/database
servers or let's say in a embedded device etc and require a different
default gateway or DNS server than the rest of clients.
2014-07-14 11:39:20 +02:00
Susant Sahani 5d8e593dce networkd: make metric of routes configurable
Now route metric can be configuted via conf file:

example conf:

[Match]
Name=em1

[Route]
Gateway=192.168.1.12
Metric=10

Test:
ip route output
default via 192.168.1.12 dev em1 metric 10

[tomegun: squash TODO update and reword man page a bit]
2014-07-14 11:39:20 +02:00
Susant Sahani c081882f07 networkd: add support for peer address
This patch adds peer address support for
networkd . In the  [Address]  a new configurable
param is Peer.

[Match]
Name=ipip-tun

[Address]
Address=10.0.0.1/32
Peer=10.0.0.2/32
2014-07-07 13:32:14 +02:00
Filipe Brandenburger 72165d6191 networkd: fix alignment of gperf source 2014-07-01 23:44:27 +02:00
Eugene Yakubovich 4cc7a82c94 networkd: send hostname to dhcp server
Send hostname (option 12) in DISCOVER and REQUEST messages so the
DHCP server could use it to register with dynamic DNS and such.

To opt-out of this behaviour set SendHostname to false in [DHCP]
section of .network file

[tomegun: rebased, made sure a failing set_hostname is a noop and moved
          config from DHCPv4 to DHCP]
2014-07-01 22:02:25 +02:00
Eugene Yakubovich e1ea665eda Add support for DHCP static route options
This adds support for DHCP options 33 and 121: Static Route and
Classless Static Route. To enable this feature, set UseRoutes=true
in .network file. Returned routes are added to the routing table.
2014-06-29 15:18:21 +02:00
Tom Gundersen ed942a9eb2 networkd: merge DHCPv4 and DHCPv6 config
If there are v4 or v6 specific options we can keep those in separate sections,
but for the common options, we will use only one.

Moreovere only use DHCP=[yes/both|no/none|v4|v6] to enable or disable the clients.
2014-06-29 15:18:21 +02:00
Patrik Flykt 4138fb2c79 networkd: Add initial DHCPv6 support
Enable DHCPv6 support by creating a DHCPv6 boolean in the Network
section. Add necessary DHCPv6 structures and initial function calls.
2014-06-19 15:44:44 +03:00
Susant Sahani 326cb4061a networkd: introduce vxlan
This patch enables netwokd to create vxlan

Changes:
Added:
	1. File networkd networkd-vxlan.c
	2. to netdev
	    bool learning
	    struct in_addr group
	    uint64_t vxlanid;
	3. VXLAN subsection and config
	   parameters
2014-06-16 20:38:22 +02:00
Tom Gundersen dd43110f78 networkd: add dhcp server support
When enabled in [Network] it will set up a dhcp server on the interface, listening
on one of its statically configured IPv4 addresses and with a fixed size pool of
leases determined from it.

Example:

[Match]
Name=ve-arch-tree

[Network]
Address=192.168.12.5/24
DHCPServer=yes

[Route]
Gateway=192.168.12.5
Destination=192.168.12.0/24

In this case we will configure ve-arch-tree with the address 192.168.12.5 and
hand out addresses in the range 192.168.12.6 - 192.168.12.38.

In the future, we should (as suggested by Lennart) introduce a syntax to pick the
server address automatically.
2014-06-13 17:07:20 +02:00
Tom Gundersen bcb7a07e0a networkd/sd-network: expose statically configured NTP servers 2014-05-19 18:42:14 +02:00
Susant Sahani 7951dea209 networkd: introduce ipip tunnel
This patch enables basic ipip tunnel support.
It works with kernel module ipip

example conf:

file: ipip.netdev

[NetDev]
Name=ipip-tun
Kind=ipip
MTUBytes=1480

[Tunnel]
Local=192.168.223.238
Remote=192.169.224.239
TTL=64

file: ipip.network

[Match]
Name=em1

[Network]
Tunnel=ipip-tun

[tomegun:
         - drop unused variable
         - take ref when enslaving]
2014-05-12 17:37:12 +02:00
Tom Gundersen 69a93e7db4 networkd: network - merge all netdev parsing into one function 2014-05-09 14:41:27 +02:00
Tom Gundersen c6f7c917a1 libsystemd-network: move network-utils from src/shared
This does not belong in shared as it is mostly a detail of our networking subsystem.

Moreover, now we can use libudev here, which will simplify things.
2014-03-21 21:54:37 +01:00
Umut Tezduyar Lindskog 5c1d3fc93d sd-network: IPv4 link-local support [v2]
Implements IPv4LL with respect to RFC 3927
(http://tools.ietf.org/rfc/rfc3927.txt) and integrates it
with networkd. Majority of the IPv4LL state machine is
taken from avahi (http://avahi.org/) project's autoip.

IPv4LL can be enabled by IPv4LL=yes under [Network]
section of .network file.

IPv4LL works independent of DHCP but if DHCP lease is
aquired, then LL address will be dropped.

[tomegun: removed a trailing newline and a compiler warning]
2014-03-03 23:24:34 +01:00
Tom Gundersen fe6b2d55bc networkd: add basic support for MACVLANs 2014-02-25 21:19:08 +01:00
Tom Gundersen edbb03e95a .network/.netdev/.link: allow to match on architecture 2014-02-21 16:05:02 +01:00
Tom Gundersen c0dda18697 networkd: netdev - allow filtering on kernel cmdline, host and virt 2014-02-20 22:12:25 +01:00