Ubuntu Suomen keskustelualueet
Muut alueet => Muut käyttöjärjestelmät ja Linux-jakelut => Aiheen aloitti: kamara - 17.03.19 - klo:17.52
-
Luulin jo osaavani tehdä staattisen IP:n Debianiin (Raspberry Pi 1 B), mutta ei se ollutkaan niin yksinkertaista...
Mikähän minulla on pielessä /etc/dhcpcd.conf:ssa ?
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1
# It is possible to fall back to a static IP if DHCP fails:
# define static profile
profile static_eth0
static ip_address=192.168.11.103
static routers=192.168.11.1
static domain_name_servers=192.168.11.1
# fallback to static profile on eth0
interface static_eth0
fallback static_eth0
-
Ifconfig antaa seuraavaa...
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.11.100 netmask 255.255.255.0 broadcast 192.168.11.255
inet6 2001:14ba:efe:29f1:ba27:ebff:fe43:8782 prefixlen 64 scopeid 0x0<global>
inet6 fe80::ba27:ebff:fe43:8782 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:43:87:82 txqueuelen 1000 (Ethernet)
RX packets 1889 bytes 125304 (122.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1487 bytes 134421 (131.2 KiB)
TX errors 0 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 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Kun haluaisin inet:n seuraavan laiseksi...
inet 192.168.11.103
-
Kas noin: https://forum.ubuntu-fi.org/index.php?topic=52963.msg405550#msg405550
-
Minulla ovat kiinteät asetukset muotoa:
Tiedostossa /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
#auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.189
netmask 255.255.255.0
gateway 192.168.1.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
Toistaiseksi totellut...
Edit:
ja tuo dhcpd.conf ilmeisesti "tehdasasetuksilla"
root@vpi:~# grep -v ^# /etc/dhcpcd.conf
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
option interface_mtu
require dhcp_server_identifier
slaac private
-
Kas noin: https://forum.ubuntu-fi.org/index.php?topic=52963.msg405550#msg405550
Tätä tapaa olin yrittänytkin, mutta ongelma taisi ratketa.
Vaihdoin staattiseksi ip:ksi 192.168.11.103:n tilalle 192.168.11.3:n, niin Raspi suostui jättämään kyseisen IP:n. 103:sta ei suostunut jättämään. Se ehkä johtui siitä, että kyseinen IP kuului NAT:n määrittelemääni DHCP:n ip-avaruuteen.
Katsellaan pari päivää, pysyykö staattinen ip raspissa, mutta merkkaan ratkaistuksi.
Jekku: En todellakaan suosittele puukottamaan /etc/network/interfaces-tiedostoa enää Strechissä, vaan se pitää tehdä kuten raimo neuvoi. ;)
-
....
Jekku: En todellakaan suosittele puukottamaan /etc/network/interfaces-tiedostoa enää Strechissä, vaan se pitää tehdä kuten raimo neuvoi. ;)
Pidetääns mielessä, näkyy olevan sama tyyli yhdessä buster:issakin.
Mutta kunhan tulee uusia asennuksia joihin haluan kiinteän osoitteen niin kokeilen.
Ja mahdollisesti jo jollain testilelullakin ;)
Edit:
Kurkkasin, Ubuntu 18.04
Mutta ei siellä ole tuota raimon vinkkaamaa tiedostoa: /etc/dhcpcd.conf ??
root@E5500:/etc# find . -type f -name "dhc*"
./dhcp/dhclient.conf
Tuolla saattaa olla jotain?
Ja perin oudolta näyttää tuokin: /etc/network/interfaces
Mihin ne oikeasti on hillottu, ubuntun verkkoasetukset?
Tuo kone saa toivotun IP:n koska se on konffattu paikallisverkon dhcp-palvelimelle, isc-dhcp-server.
Taitaa olla ensimmäinen kerta kun edes katsoin.
-
Mihin ne oikeasti on hillottu, ubuntun verkkoasetukset?
Ubuntu Server 18.04:ssä verkkoasetukset tehdään Netplanin kautta. Työpöytä-Ubuntussa taas NetworkManagerilla.
Server-version käyttöohje: https://help.ubuntu.com/lts/serverguide/network-configuration.html.en
Lyhyempi ohje staattisen osoitteen määrittämiseen: https://linuxconfig.org/how-to-configure-static-ip-address-on-ubuntu-18-04-bionic-beaver-linux
Tuo kone saa toivotun IP:n koska se on konffattu paikallisverkon dhcp-palvelimelle, isc-dhcp-server.
Taitaa olla ensimmäinen kerta kun edes katsoin.
Noin se kannattaakin tehdä, jos verkossa on oma DHCP-palvelin, kuten useimmiten on.