LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Eth0 / Wireless IP Contention? (https://www.linuxquestions.org/questions/linux-newbie-8/eth0-wireless-ip-contention-4175602978/)

fopetesl 04-01-2017 08:55 AM

Eth0 / Wireless IP Contention?
 
Ubuntu 14.04
Wireless DHCP IP 192.168.1.105 Gateway 192.168.1.1
Eth0 on zero but I need static address on 192.168.1.xx

I have to talk to a process machine which (13 years old)is on fixed IP of 192.168.1.6.and have to use cross-over CAT5 patch because it does not have Auto MDI-X.

I can temporarily set fixed IP on eth0
Code:

root@pcc-ThinkPad-Z60t:/home/pcc# ifconfig eth0 192.168.1.20 netmask 255.255.255.0 broadcast 192.168.1.255
but after an indeterminate period it loses connection and reverts back to DHCP.

I also cannot set a route immediately after checking fixed IP is accepted
Code:

root@pcc-ThinkPad-Z60t:/home/pcc# route add -net 192.168.1.6 gw 0.0.0.0 dev eth0
SIOCADDRT: Invalid argument

Bear in mind that for 13 years the process machine has run without hiccup using Ubuntu Breezy as built in computer communicating with Controller Board via cross over CAT5 patch cable.

michaelk 04-01-2017 10:17 AM

I assume that NetworkManager is running. It is a service that automatically switches between wired and wireless and configures the ethernet adapter (eth0) in addition to wireless functions. I also assume that you don't have to connect your process machine to another computer very often.

You can use the NetworkManager applet to configure a static IP address on eth0 when you need to connect your process machine and then back to DHCP when complete.

Another possibility that I have not verified is adding an IP alias to eth0.

https://ubuntuforums.org/showthread.php?t=1259634

JeremyBoden 04-01-2017 11:31 AM

If you have a router that uses DHCP to allocate ip addresses you can usually associate the unique MAC address of the interface with a fixed ip address.

Shadow_7 04-01-2017 02:34 PM

If you have a manager like network-manager or wicd, it will try to use DHCP on ALL interface by default. Which is likely undo-ing any manual configuration you are attempting. Use the manager to adjust the interface, or stop using a manager. I find the later more productive. Until you have to train someone else to recognize the symptoms and do the administration part. It also helps if the various interfaces are on different subnets to make routing simpler.


All times are GMT -5. The time now is 11:34 PM.