You are not logged in.

#1 2009-11-20 21:19:53

milomak
Member
Registered: 2009-11-04
Posts: 61

[Solved] Two ethernet ports (dhcp and static)

For various reasons I connect to the internet as follows:

Computer --> eth0 --> Linksys Router --> Aztech Modem/Router --> Internet

From time to time I need to access the Aztech. Usually I change the eth0 cable connecting to the Linksys to the Aztech. And restart networking. Access the Aztech. Then change the cable from Aztech to Linksys. Restart network.                 

In Debian (to avoid this cable changing), what I did was to also have a cable as follows:

Computer --> eth1 --> Aztech Modem/Router

eth1 is a static configuration. The debian /etc/network/interfaces file looks like

     
auto eth0
iface eth0 inet dhcp
                                                                       
auto eth1                                                                         
iface eth1 inet static                                                            
address 10.0.0.3                                                                  
netmask 255.255.255.0

So in Debian I plug a cable into eth1 (from the Aztech). I can then access the Aztech without it interfering with resolv.conf so I can still browse the internet via eth0.                                                     

I have tried the following in ArchLinux:

                                  
HOSTNAME="milomak-arch"                                                    

eth0="dhcp"
INTERFACES=(eth0)

eth1="eth1 10.0.0.1 netmask 255.255.255.0"
INTERFACES=(eth1)                         
                                                     
gateway="default gw 192.168.1.1 10.0.02"              
ROUTES=(!gateway)

However when I boot this is what I see

                               
# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:24:8C:52:DC:5F
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::224:8cff:fe52:dc5f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:468 (468.0 b)
          Interrupt:17

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:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1280 (1.2 Kb)  TX bytes:1280 (1.2 Kb)

what am i missing?

Last edited by milomak (2009-11-21 10:35:16)

Offline

#2 2009-11-20 21:32:07

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [Solved] Two ethernet ports (dhcp and static)

Put both interfaces in the INTERFACES= array.

/etc/rc.conf includes this detail, with a slightly different wording i.e.

# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES

Offline

#3 2009-11-21 10:34:41

milomak
Member
Registered: 2009-11-04
Posts: 61

Re: [Solved] Two ethernet ports (dhcp and static)

cool. thanks that did the trick

Offline

Board footer

Powered by FluxBB