M
M
Millerish2015-12-13 00:26:36
linux
Millerish, 2015-12-13 00:26:36

linux. How to set a static IP correctly?

Good evening!
Help to correctly register the network settings.
At the moment it works like this:
1. Internet (PPPoE), accesses the Tenda N30 router.
2. There are “Port Range Forwarding” settings in the router, where I set the internal IP and the port through which the routing takes place.
3. Through WI-FI distributes the Internet to other devices.
Everything is fine, only if the router is rebooted and the server IP gets another device first, access to the server is lost.
How can I set the correct settings to solve this issue?
I currently have the following settings:
/etc/network/interfaces

auto lo
iface lo inet loopback

Tried different settings, for example:
iface eth0 inet static
   address 192.168.0.999

With this option, the network does not work at all.
How to solve my issue?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LESHIY_ODESSA, 2015-12-13
@Millerish

address 192.168.0.999

Hmm. Maximum 254. THEN is - 192.168.0.1-192.168.0. 254
iface eth0 inet static
address 192.168.0.99
But it's all useless, because there is a DHCP server on the router that issues IP and of course it can take your "static" IP.
Therefore, go to the router and reserve the desired IP at the mac address.
It is no longer necessary to register IP in Linux, he will receive it from the router anyway.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question