@joe_temp
You can run Ip utility to see what kind of network interfaces you already have.
Code:
# ip address
It should return something like the following. Notice the eth0 .. I changed my ip address to xx.xxx.xx.xxx .. but you should see your ip address there.
Code:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
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: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default
link/ether 7d:5a:93:a0:06:07 brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether d2:3c:f1:73:gf:85 brd ff:ff:ff:ff:ff:ff
inet xx.xxx.xx.xxx/24 brd xx.xxx.xx.xxx scope global eth0
valid_lft forever preferred_lft forever
inet6 2600:3c00::f03c:91ff:fe73:ef85/64 scope global mngtmpaddr dynamic
valid_lft 2591987sec preferred_lft 604787sec
inet6 fe80::f03c:91ff:fe73:ef85/64 scope link
valid_lft forever preferred_lft forever
4: teql0: <NOARP> mtu 1500 qdisc noop state DOWN group default qlen 100
link/void
5: tunl0: <NOARP> mtu 0 qdisc noop state DOWN group default
link/ipip 0.0.0.0 brd 0.0.0.0
6: gre0: <NOARP> mtu 1476 qdisc noop state DOWN group default
link/gre 0.0.0.0 brd 0.0.0.0
7: gretap0: <BROADCAST,MULTICAST> mtu 1476 qdisc noop state DOWN group default qlen 1000
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
8: ip_vti0@NONE: <NOARP> mtu 1500 qdisc noop state DOWN group default
link/ipip 0.0.0.0 brd 0.0.0.0
9: ip6_vti0: <NOARP> mtu 1500 qdisc noop state DOWN group default
link/tunnel6 :: brd ::
10: sit0: <NOARP> mtu 1480 qdisc noop state DOWN group default
link/sit 0.0.0.0 brd 0.0.0.0
11: ip6tnl0: <NOARP> mtu 1452 qdisc noop state DOWN group default
link/tunnel6 :: brd ::
12: ip6gre0: <NOARP> mtu 1448 qdisc noop state DOWN group default
link/gre6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
According to
Network configuration - ArchWiki , with Systemd-networkd (systemd) version >= 209 it is possible to manage network connections with systemd-networkd. You can run the following to see if systemd-network is up and running in your system.
Code:
# systemctl status systemd-networkd
If the above command returns something like the following
Code:
● systemd-networkd.service - Network Service
Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled)
Active: active (running) since Tue 2014-05-20 01:43:19 UTC; 1 day 15h ago
Docs: man:systemd-networkd.service(8)
Main PID: 2200 (systemd-network)
Status: "Processing requests..."
CGroup: /system.slice/systemd-networkd.service
└─2200 /usr/lib/systemd/systemd-networkd
This means that your networking is handled by systemd-networkd service.
Now
systemd-networkd - ArchWiki states that configuration files will be read from /usr/lib/systemd/network
In my previous post, I directed that you should copy the 10-dhcp.network from /usr/lib/systemd/network to /etc/systemd/network to override the settings.
Why move it to /etc/systemd/network ? Becuase files in here will not change in case of an update while /usr/lib/systemd/network could change and revert to default whenever there may be an update to systemd-networkd
Moving on .. the file contents of /usr/lib/systemd/network/10-dhcp.network are as the following
Code:
[Match]
Name=eth0
[Network]
DHCP=yes
According to this, file your IP is assigned to you by the DHCP server and according to
systemd-networkd - ArchWiki ====== systemd-networkd - ArchWiki as of 05/20/2014 =======
Quote:
By default hostname received from the DHCP server will be used as the transient hostname.
To change it add UseHostname=false in section [DHCPv4]
Code:
/etc/systemd/network/MyDhcp.network
----------------------------------------------------------------------------
[DHCPv4]
UseHostname=false
====== end systemd-networkd - ArchWiki ==============
So when you set UseHostname=false system doesnt use hostname provided by DHCP server but instead uses the one you set this hostnamectl command.
Below is what your /etc/systemd/network/10-dhcp.network file should look like in order for you to use your own hostname rather than what DHCP server provides.
Code:
[Match]
Name=eth0
[Network]
DHCP=yes
[DHCPv4]
UseHostname=false
I hope this helped.