I'm not sure what you're asking. Normally, you will have at least two IP addresses: 1) your loop back address, and 2) your network address. Typically your loop back address (ipv4) is going to be 127.0.0.1 and you network address will be 192.168.xxx.xxx depending on your home router, dhcp, etc.solar3000 wrote:I copied some of the old 'interfaces' parameters like address, netmask, and gateway.
It seems to work, but hostname -I says I have two IPs.
I only have a ethernet connected. No wifi.
What's the proper configuration for static IP for just eth0 now?
For me, with "iface eth0 inet manual" and getting its IP address via DHCP ...MarkHaysHarris777 wrote:What does ifconfig show?
Code: Select all
eth0 Link encap:Ethernet HWaddr b8:27:eb:b6:78:11
inet addr:192.168.0.203 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2281 errors:0 dropped:0 overruns:0 frame:0
TX packets:1116 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:115191 (112.4 KiB) TX bytes:101193 (98.8 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:82 errors:0 dropped:0 overruns:0 frame:0
TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6552 (6.3 KiB) TX bytes:6552 (6.3 KiB)
Code: Select all
eth0 Link encap:Ethernet HWaddr b8:27:eb:b6:78:11
inet addr:198.162.99.99 Bcast:198.162.99.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2714 errors:0 dropped:0 overruns:0 frame:0
TX packets:1386 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:136474 (133.2 KiB) TX bytes:123923 (121.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:84 errors:0 dropped:0 overruns:0 frame:0
TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6652 (6.4 KiB) TX bytes:6652 (6.4 KiB)
Code: Select all
192.168.99.99 192.168.0.203
Code: Select all
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether b8:27:eb:b6:78:11 brd ff:ff:ff:ff:ff:ff
inet 192.168.99.99/24 brd 192.168.99.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.0.203/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.99.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
That explains it. Many thanks.spl23 wrote:With the new network mods, DHCP is taken care of by a new package called dhcpcd. In order for this to work, the iface lines in /etc/network/interfaces need to be "manual" rather than "dhcp". This is why the file has changed, and why we've backed it up in case you want to go back, in which case you will need to uninstall raspberrypi-net-mods.
Thanks from me too.spl23 wrote:With the new network mods, DHCP is taken care of by a new package called dhcpcd. In order for this to work, the iface lines in /etc/network/interfaces need to be "manual" rather than "dhcp". This is why the file has changed, and why we've backed it up in case you want to go back, in which case you will need to uninstall raspberrypi-net-mods.
Really? I just thought it looked a real mess so replaced it with what I usually use and had no problems with eth or wifi not working. And what is raspberrypi-net-mods? Where is there documentation on the new network set up if there is any.spl23 wrote:With the new network mods, DHCP is taken care of by a new package called dhcpcd. In order for this to work, the iface lines in /etc/network/interfaces need to be "manual" rather than "dhcp". This is why the file has changed, and why we've backed it up in case you want to go back, in which case you will need to uninstall raspberrypi-net-mods.
Code: Select all
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Using the GUI and specifying an IP address ( with /etc/network/interfaces set to "manual" ) gave me just a single static IP, though not entirely without other problems as described above.solar3000 wrote:I forgot to mention. Adding an entry to /etc/network/interfaces creates one IP.
The new 2015 05 05 's setup creates its own ip. so that looks like why I got two IPs when I typed hostname -I. No no one seems to know this and it looks like no one knows how to set up a static IP in the new system either.
This issue is also discussed in viewtopic.php?f=66&t=111887hippy wrote:That explains it. Many thanks.spl23 wrote:With the new network mods, DHCP is taken care of by a new package called dhcpcd. In order for this to work, the iface lines in /etc/network/interfaces need to be "manual" rather than "dhcp". This is why the file has changed, and why we've backed it up in case you want to go back, in which case you will need to uninstall raspberrypi-net-mods.
With raspberrypi-net-mods described in the middle of "Another raspbian desktop user interface update" I thought it only affected the desktop interface side of things". Turning the TV on and re-booting shows dhcpcd doing its stuff right there -
dhcpcd[2032] : eth0 : rebinding lease of ...
So, to have only a static address, it's either enter it via the new network GUI or use the -S option as described here - http://roy.marples.name/man/html8/dhcpcd.html
Going the GUI route seems to have worked for me, got just the static address specified ( and the other static address specified in /etc/network/interfaces ), but did have to re-boot after changing the setting to get it to take effect. Using Apply wasn't enough.
Also, after re-booting the GUI icon is stuck on "eth0: Link is up, configuring".
I finally decided to give up configuring dhcpcd for static ip (unable to figure out how to configure dhcpcd with static IP and not end up with two IP addresses - one static and on dhcp).spl23 wrote:With the new network mods, DHCP is taken care of by a new package called dhcpcd. In order for this to work, the iface lines in /etc/network/interfaces need to be "manual" rather than "dhcp". This is why the file has changed, and why we've backed it up in case you want to go back, in which case you will need to uninstall raspberrypi-net-mods.
Code: Select all
sudo update-rc.d -f dhcpcd remove
Code: Select all
sudo update-rc.d dhcpcd defaults
Code: Select all
denyinterfaces eth0
Code: Select all
sudo update-rc.d -f dhcpcd remove
Code: Select all
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet manual
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Code: Select all
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="xxxx"
psk="yyyy"
# scan_ssid=1
# proto=WPA2 # can be RSN (for WPA2) or WPA (for WPA1)
# key_mgmt=WPA-PSK # can be WPA-PSK or WPA_EAP (for enterprise networks)
# pairwise=CCMP TKIP # can be CCMP( for WPA2) or TKIP (for WPA1), or both
# auth_alg=OPEN # can be OPEN, LEAP and SHARED
# group=CCMP TKIP
# priority=1
}
Code: Select all
# Static IP configuration
interface eth0
static ip_address=192.168.100.21/24
static routers=192.168.100.1
static domain_name_servers=8.8.8.8 8.8.4.4
interface wlan0
static ip_address=192.168.100.20/24
static routers=192.168.100.1
static domain_name_servers=8.8.8.8 8.8.4.4
With this setup, I can switch between LAN and/or WLAN, and have either one or both active depending on the LAN cable plugged in, or the WIFI dongle plugged in, or both.interface Subsequent options are only parsed for this interface.
Return to “General discussion”
Users browsing this forum: Haris1977 and 25 guests