Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I am setting up a new server running debian and have run into a stange problem. Everything is correctly configured and works fine until I attach the cable for ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! TheMayhem's Avatar
    Join Date
    Apr 2007
    Location
    Sweden
    Posts
    32

    Wrong default gateway set when attaching cable


    Hello,

    I am setting up a new server running debian and have run into a stange problem. Everything is correctly configured and works fine until I attach the cable for the internal network. As soon as I do that the default gateway is set to the IP of the internal NIC, and I loose all internet connectivity.

    Here is my setup:
    eth0 - internal facing - IP 192.168.200.1
    eth1 - external facing - IP 89.253.82.xx

    Both IPs are static, the server is acting as the DHCP server for the internal (192.168.200.0/24) network. I have disabled firewall (shorewall) to eliminate that part of the process for now.

    I am using a combination of webmin and terminal to find/set all configurations.

    I have the server set to act as a router.

    route -n shows everything correctly with 89.253.82.xx as default gateway until I connect the cable to eth0. As soon as I do that route -n show the default gateway as 192.168.200.1.

    I'll supply any and all logs and config files, just let me know which ones you need.

    dhcpd.conf (through I doubt this is where the problem lies)
    Code:
    ddns-update-style none;
    authoritative;
    DHCPD_INTERFACE = "eth0";
    subnet 192.168.200.0 netmask 255.255.255.0 {
    	option routers 192.168.200.1;
    	option subnet-mask 255.255.255.0;
    	option broadcast-address 192.168.200.255;
    	option domain-name "mydomain.com";
    	option domain-name-servers 84.246.88.xx, 84.246.88.xx;
    
    	range 192.168.200.100 192.168.200.149;
    	default-lease-time 21600;
    	max-lease-time 43200;
    
    
    	# one fixed
    	host speedster {
    		hardware ethernet 6c:f0:49:05:43:FB;
    		fixed-address 192.168.200.150;
    		}
    }
    Thanks!

    PS. Obfuscated domain name and end of IPs on purpose

  2. #2
    Just Joined! TheMayhem's Avatar
    Join Date
    Apr 2007
    Location
    Sweden
    Posts
    32
    route -n with eth0 disconnected
    Code:
    root@holisrv2:/home/marten# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         89.253.82.xx   0.0.0.0         UG    0      0        0 eth1
    89.253.82.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
    169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth1
    route -n with eht0 connected
    Code:
    root@holisrv2:/home/marten# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.200.1   0.0.0.0         UG    0      0        0 eth0
    89.253.82.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
    169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth1
    192.168.200.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
    As you can see the default gateway is immediately replaced.


    etc/network/interfaces
    Code:
    auto lo eth1 eth0
    iface lo inet loopback
            allow-hotplug eth1
    
    # The primary network interface
    iface eth1 inet static
            address 89.253.82.xx
            netmask 255.255.255.0
            broadcast 89.253.82.255
            network 89.253.82.0
            gateway 89.253.82.xx
    
    #       gateway 89.253.82.xx
            # dns-* options are implemented by the resolvconf package, if installed
    
    
    iface eth0 inet static
            address 192.168.200.1
            netmask 255.255.255.0
            broadcast 192.168.200.255
            network 192.168.200.0
    Other output
    Code:
    root@holisrv2:/home/marten# cat /etc/networks
    default         0.0.0.0
    loopback        127.0.0.0
    link-local      169.254.0.0
    localnet        89.253.82.0
    Code:
    root@holisrv2:/home/marten# cat /etc/NetworkManager/NetworkManager.conf 
    [main]
    plugins=ifupdown,keyfile
    
    [ifupdown]
    
    managed=true
    ifconfig eth0 disconnected
    Code:
    root@holisrv2:/home/marten# ifconfig
    eth0      Link encap:Ethernet  HWaddr d4:3d:7e:4f:30:b8  
              inet6 addr: fe80::d63d:7eff:fe4f:30b8/64 Scope:Link
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:39 errors:0 dropped:0 overruns:0 frame:0
              TX packets:115 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:4146 (4.0 KiB)  TX bytes:13787 (13.4 KiB)
              Interrupt:43 Base address:0x8000 
    
    eth1      Link encap:Ethernet  HWaddr 00:0e:0c:da:63:66  
              inet addr:89.253.82.137  Bcast:89.253.82.255  Mask:255.255.255.0
              inet6 addr: fe80::20e:cff:feda:6366/64 Scope:Link
              inet6 addr: 2a01:3b8:1265:aaaa:853a:3c70:1a2f:9432/64 Scope:Global
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:9969 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6053 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:7368748 (7.0 MiB)  TX bytes:1188294 (1.1 MiB)
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:3072 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3072 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:485052 (473.6 KiB)  TX bytes:485052 (473.6 KiB)
    ifconfig eth0 connected
    Code:
    root@holisrv2:/home/marten# ifconfig
    eth0      Link encap:Ethernet  HWaddr d4:3d:7e:4f:30:b8  
              inet addr:192.168.200.1  Bcast:192.168.200.255  Mask:255.255.255.0
              inet6 addr: fe80::d63d:7eff:fe4f:30b8/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:39 errors:0 dropped:0 overruns:0 frame:0
              TX packets:148 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:4146 (4.0 KiB)  TX bytes:18143 (17.7 KiB)
              Interrupt:43 Base address:0x8000 
    
    eth1      Link encap:Ethernet  HWaddr 00:0e:0c:da:63:66  
              inet addr:89.253.82.137  Bcast:89.253.82.255  Mask:255.255.255.0
              inet6 addr: fe80::20e:cff:feda:6366/64 Scope:Link
              inet6 addr: 2a01:3b8:1265:aaaa:853a:3c70:1a2f:9432/64 Scope:Global
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:10033 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6071 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:7373108 (7.0 MiB)  TX bytes:1189634 (1.1 MiB)
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:3072 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3072 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:485052 (473.6 KiB)  TX bytes:485052 (473.6 KiB)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •