0

I am trying to configure a new Alpine server, and I have some basic knowledge of networking & Linux only.

Everything works seamlessly if I use the default configs with DHCP, but breaks when I try to use a static IP config. I have to configure adguard home and a few apps on this system, every day

By default, the network config with DHCP gives a dynamic IP like 192.168.68.110

I changed the config using nano /etc/network/interfaces and below are my config samples:

Default config had:

auto eth0
  iface eth0 inet dhcp

My new config is:

auto eth0
  iface eth0 inet static
  address 192.168.10.1
  netmask 255.255.0.0
  gateway 192.168.29.1

If I do an ifconfig I get the below:

eth0      Link encap:Ethernet  HWaddr XXXXXXXX
          inet addr:192.168.10.1  Bcast:0.0.0.0  Mask:255.255.255.0
          inet6 addr: fe80::e65f:1ff:fe31:9e45/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3826 errors:0 dropped:87 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:367860 (359.2 KiB)  TX bytes:516 (516.0 B)

The output for ip addr is

inet 192.168.10.1/24 scope global eth0        
valid_lft forever preferred_lft forever

But I am even not able to ping the machine with a new config from 192.168.68.103 machine.

Samdeesh
  • 101
  • 4
  • What is your goal with the static address configuration? What does the dhcp-provided configuration look like? In addition to the output of `ip addr` (which you should be using instead if `ifconfig`), also include the output of `ip route`. Does your system have multiple interfaces? Your gateway needs to be on the same network as your one of your interfaces. Given your netmask for `eth0`, we would expect your gateway to be `192.168.10.`. – larsks Sep 21 '22 at 12:22
  • What is the network topology, that is, how are the server, router and client machine connected? – Tero Kilkanen Sep 21 '22 at 15:51
  • The IP is changing frequently and I have to configure adguard home and a few apps on this system, every day I try to ssh I find a new ip on this. I am using tp link deco router which is my secondary gateway on `192.168.68.1` having dhcp enabled, the primary gateway is `192.168.29.1` which is my ISP-provided router. All my devices are connected to the deco router after a switch in a star topology – Samdeesh Sep 22 '22 at 05:05
  • the output for `ip addr` is `inet 192.168.10.1/24 scope global eth0 valid_lft forever preferred_lft forever` – Samdeesh Sep 22 '22 at 05:22

1 Answers1

1

The netmask in the ip config output is still a /24 subnetmask. Please verify that. Maybe you need to reboot. Please check the routing as well

ip route

w3ich3rt
  • 13
  • 4