1

Scenario:

               +---+        
           eth0| S |        +----------+
internet ======|   |        |          |------PC1
               | / |        |  switch  |------PC2
               |   |========|          |------PC3
               | R |eth1    +----------+
               +---+

S/R: Server as Router

eth0: connection from the internet/other network        
eth1: internal network        
PC1,PC2,PC3: Ubuntu OS  

*addition PC4 connected to switch which is on windows OS.

I set PC1, PC2 and PC4 to auto DHCP to have an access with the network and internet but

PC3 is on static.      
PC3 has an IP address same of a router(dhcp:interface=eth1). e.g.        

PC3:(fake)           
address 192.168.1.2          
network 192.168.1.0             
netmask 255.255.255.0              
gateway 192.168.1.2  

Problem encounter:
The PC4 can access to the network/internet while
PC1 and PC2 cannot.

Observation:
Window OS automatically can detect real gateway(router) while
Ubuntu OS cannot. :(

How can we fix this if someone configured a static ip add same with the gateway(router)?

3

Honestly, this sounds more like a user problem than a technological one. Just don't allow people on your home network if they cannot configure their devices correctly.

When configuring addresses manually, people tend to choose them from the low end of the address space. You could move your gateway to .254, set your DHCP pool to .100 - .199 and keep statically allocated addresses in the low end of your subnet. Remeber to document everything (a single post-it will do!) so that people don't reuse existing allocations.

You could also set the ARP tables manually on the PCs to point 192.168.1.2 to the eth1 interface of S/R. On the Linux PCs, run sudo arp -i <iface> -s 192.168.1.2 <macaddr> where <iface> is the Ethernet interface, likely eth0. <macaddr> is the hardware MAC address of the eth1 adapter on S/R, which you can find by running ifconfig eth1 on the server.

If you are a professional network admin, you likely already have the skills and hardware budget to keep misconfigured hosts from disrupting the network.

  • Hello Sir Andyn, is this automatically saved? – rjbarsal Jul 19 '13 at 7:29
  • The ARP cache is cleaned at least whenever the computers are rebooted. If you want to run it automatically, you could edit the /etc/network/interfaces file – andyn Jul 19 '13 at 7:58
1

/etc/network/interfaces

...

iface eth0 inet dhcp
post-up arp -i <iface> -s 192.168.1.2 <macaddr>    

...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.