Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-26 Thread Richard Hector
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 24/02/14 12:29, Rob Owens wrote:
 On Sat, Feb 22, 2014 at 11:29:40PM -0300, Markos wrote:
 Tomorrow I'll change the network card of the server and see if
 the problem is on the network card.
 
 Check to see if the network cable is cat 5, cat 5e, or cat 6.  If
 you have a gigabit speed network card, it might reject a cat 5
 cable.  Or it might accept it (led's light on the card), but not
 work properly.

Gigabit is supposed to work on cat 5. And an RTL8139 is 100Mbit.

The cable could be faulty, though.

Richard

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQEcBAEBAgAGBQJTDlk7AAoJELSi8I/scBaNzBAH/3h2t2z9eOUGaY3X4NikrAvB
epUG4/DbjNRpX4Hys/8issltSqv6jwC5JQADTWrGedX/lb0A2iLqvhAhzSYJF9Xg
P+U7InHwS9DW6f8KYN6Wch7vlSjUlK+T8AGMN/EwkgxP399EB0eDjieeHP+lRg46
HhoAWTo2uXnFidPQUMQ9ktccvjGlQimWAufLxku8BVDCFmCuqeOCEmBfZXHoHZV/
TEG4S036d3liDGWK/I0l5SpnthycGJ03R2q4NRGtdwRjvQRgLlQLSzspP/2yAq8I
WWf/SM/ufS12HEVA/NPfsYFE0qrTMk+qr+DNz6kS2xOfExoOourYWipilL7qm2s=
=93M8
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/530e593b.2020...@walnut.gen.nz



Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-24 Thread Markos

On 22-02-2014 23:57, Scott Ferguson wrote:

On 23/02/14 13:09, Markos wrote:
   

On 22-02-2014 20:11, Scott Ferguson wrote:
 

On 23/02/14 09:58, Stephen Powell wrote:

   

On Sat, 22 Feb 2014 17:22:16 -0500 (EST), Markos wrote:

 

I'm trying to configure a machine with two network cards to share
Internet access to an internal network

the /etc/network/interface is:

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
   address 192.168.0.1
   netmask 255.255.255.0

auto eth1
iface eth1 inet dhcp

The card eth0 is used as gateway on the internal network with static IP
192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.

But the modem do not send an IP during initialization.

The IP of modem is 192.168.1.1.

The modem sends the IP address (192.168.0.4) to my laptop by wifi
without problems.

Any suggestions of what I should check?

   

I'm afraid that I don't understand the problem.  Is this a traditional
async dial-up modem?  If so, I would expect it to be configured with
ppp,
its interface name would be ppp0, and it would not be listed in
/etc/network/interfaces at all.  I don't get it.


 

I'm guessing it's a cdc_ether device - probably running a web and dn
server at 192.168.0.100.  Hopefully the OP will correct my assumption
(Vendor and Product codes from dmesg?).
I'm not familiar with that particular model - but I've had to hack Linux
support for the chipset either side of it (model number).


Kind regards



   

Dear Scot and Stephen,

I am using this model of modem:

http://www.4glterouter.de/huawei-b890-4g-lte-smart-hub.html
 

Thanks - yes it's the chipset I was expecting.

   

I just tested on another machine and the modem supplied the IP to my
laptop via wireless and IP to a computer (with 1 NIC) via ethernet
without problem.
 

Yes.

   

Tomorrow I'll change the network card (of the machine with 2 NICs) and
test again to see if the problem is the network card.
 


OK - I misunderstood - I didn't realise you had a second card installed
and assumed you'd just noticed the USB modem cable is seen as a NIC, or
that networkmanager had autoconfigured it for you (it should, if you
have a recent version of usb-modeswitch installed).
You don't need the 2nd network card unless you want to duplicate the
routing functionality build into your modem/hub/router. Just connect the
modem to that computer with the USB cable. Make sure you have
usb_modeswitch installed and add the extra line I suggest (the gateway
stanza).

The modem should then be seen as /dev/eth1 by Debian and will be used as
the gateway for your internet. You'll find that resolv.conf will
automagically use the modem as the nameserver .i.e. /etc/resolv.conf
will contain:-
nameserver 192.18.1.1

You don't need to add netmask and broadcast stanzas to
/etc/network/interfaces, you do need to change auto to hot-plug for the
modem (yes it's USB but the system will see it as an eth device).

Any other devices you connect to the modem should automagically (via
DHCP) do the same - and by default will all be able to communicate with
each other.

NOTE: the route output I quoted (in the previous post) is from a box
connected to a similar Huwaei modem in the same situation.

/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
 address 192.168.0.6
 netmask 255.255.255.0
 gateway 192.168.1.1
 # dns-* options are implemented by the resolvconf package, if
installed

allow-hotplug eth1
iface eth1 inet dhcp
 # you could make this static, but more typing would be involved


NOTE: network and broadcast stanzas are optional

   

Thanks for your attention,
Markos


 

Kind regards


   
Dear Scott Ferguson, Stephen Powell, Dan Purgert, Andrei POPESCU, Pascal 
Hambourg, Rod James Bio and Rob Owens,


Thanks for your comments.

As I said, I tested the modem at home, and it worked well.

I imagine that the initial problem was related to the network adapter.

The next day I changed the network card and realized the following:

When I changed the network card the system started to assign the address 
to eth2 the new card and the modem sent the IP address for this card (eth2).


Despite that the /etc/network/interfaces is:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0

auto eth1
iface eth1 inet dhcp


Then I replace the second NIC by another one and again the system 
assigned the number eth3 for this new card.


And also the modem sent the IP number OK.

Every time I change the card the system increment the number to the 
interface: eth2, eth3 etc..


I searched on the Web and 

Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-23 Thread Andrei POPESCU
On Sb, 22 feb 14, 20:55:28, Dan Purgert wrote:
 
 Now, the downside to this approach is that devices connected to the Wifi AP of
 the Huawei device will not be able to communicate with the stuff behind the 
 *nix
 server.  An easier solution (IMO) would be something like the following:
 
 1. Install DHCP server on the *nix box.
 2. Set eth0 to a static IP address (e.g. 192.168.0.1).
 3. Bind DHCP and DNS to eth0.
 4. Connect eth0 on the Huawei device to eth0 of the *nix box.
 5. Connect eth1 on the Huawei device to a switch (for the other computers).
 
This doesn't make sense to me and even if I assume eth1 is actually on 
the server there is no practical advantage vs. just connecting 
everything to the switch.
 
 auto eth0
 iface eth0 inet static
 address 192.168.0.2
 netmask 255.255.255.0
 gateway 192.168.0.1
 [dns-nameservers 208.67.222.222 208.67.220.220] -- these are openDNS, use 
 your
 ISP, some other DNS provider, or your internal nameservers if you'd like.
 
 
 auto eth1
 iface eth1 inet static
 address 192.168.1.1
 netmask 255.255.255.0
 gateway 192.168.0.2

Two gateways?

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt


signature.asc
Description: Digital signature


Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-23 Thread Andrei POPESCU
On Du, 23 feb 14, 09:57:38, Scott Ferguson wrote:
 On 23/02/14 09:22, Markos wrote:
  Hi all,
  
  
  I'm trying to configure a machine with two network cards to share
  Internet access to an internal network
  
  the /etc/network/interface is:
  
  # The loopback network interface
  auto lo
  iface lo inet loopback
  
  auto eth0
  iface eth0 inet static
  address 192.168.0.1
  netmask 255.255.255.0
 gateway 192.168.1.1
 
  
 snipped
 allow-hotplug eth1
  iface eth1 inet dhcp

Two gateways (one from the static config and one from dhcp)?

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt


signature.asc
Description: Digital signature


Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-23 Thread Andrei POPESCU
On Sb, 22 feb 14, 19:22:16, Markos wrote:
 Hi all,
 
 
 I'm trying to configure a machine with two network cards to share
 Internet access to an internal network
 
 the /etc/network/interface is:
 
 # The loopback network interface
 auto lo
 iface lo inet loopback
 
 auto eth0
 iface eth0 inet static
 address 192.168.0.1
 netmask 255.255.255.0
 
 auto eth1
 iface eth1 inet dhcp
 
 The card eth0 is used as gateway on the internal network with static
 IP 192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.
 
 But the modem do not send an IP during initialization.

How did you check? I would recommend you try configuring eth1 with dhcp 
by hand:

dhclient eth1

This should give you feedback on what is actually happening. I assume 
the physical connection is ok, right?
 
 The IP of modem is192.168.1.1.
 
 The modem sends the IP address (192.168.0.4) to my laptop by wifi
 without problems.

Are you sure about this? The modem should hand out IPs in its own subnet 
(192.168.1.x) or do you mean 192.168.*1*.4?

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt


signature.asc
Description: Digital signature


Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-23 Thread Pascal Hambourg
 On 23/02/14 13:09, Markos wrote:

 Any suggestions of what I should check?

Check that you have a DHCP client installed supported by the dhcp
method in /etc/network/interfaces. List in man interfaces : dhclient,
pump, udhcpc, dhcpcd. Usually dhclient (currently provided by package
isc-dhcp-client) is installed by default.

Try to run that DHCP client on eth1 manually and see what happens.

Try to configure eth1 statically and ping the address of the router to
check connectivity.

Run ifconfig eth1, ethtool eth1 to display the status of eth1.


Scott Ferguson a écrit :
 You don't need the 2nd network card unless you want to duplicate the
 routing functionality build into your modem/hub/router.

Usually a router needs two network interfaces.

 Just connect the modem to that computer with the USB cable.

How will it be different from a second ethernet card, and better ?

 The modem should then be seen as /dev/eth1

No, no. Network interfaces don't appear in /dev. They are not character
nor block devices.

 # The primary network interface
 allow-hotplug eth0
 iface eth0 inet static
 address 192.168.0.6
 netmask 255.255.255.0
 gateway 192.168.1.1

No, no, NO !
The gateway is not connected to eth0 and its address is not in eth0's
subnet so there is no reason to add it in eth0's stanza. First it will
fail, and second the default route will be automatically added to eth1
by the DHCP client.

 allow-hotplug eth1
 iface eth1 inet dhcp


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/5309e1bc.2000...@plouf.fr.eu.org



Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-23 Thread Dan Purgert
On 23/02/2014 06:28, Andrei POPESCU wrote:
 On Sb, 22 feb 14, 20:55:28, Dan Purgert wrote:

 Now, the downside to this approach is that devices connected to the Wifi AP 
 of
 the Huawei device will not be able to communicate with the stuff behind the 
 *nix
 server.  An easier solution (IMO) would be something like the following:

 1. Install DHCP server on the *nix box.
 2. Set eth0 to a static IP address (e.g. 192.168.0.1).
 3. Bind DHCP and DNS to eth0.
 4. Connect eth0 on the Huawei device to eth0 of the *nix box.
 5. Connect eth1 on the Huawei device to a switch (for the other computers).
  
 This doesn't make sense to me and even if I assume eth1 is actually on 
 the server there is no practical advantage vs. just connecting 
 everything to the switch.

I understood him as wanting to use the *nix box as the router, instead of
wanting to use the built-in functionality of the Huawei 4g thing.

  
 auto eth0
 iface eth0 inet static
 address 192.168.0.2
 netmask 255.255.255.0
 gateway 192.168.0.1
 [dns-nameservers 208.67.222.222 208.67.220.220] -- these are openDNS, use 
 your
 ISP, some other DNS provider, or your internal nameservers if you'd like.


 auto eth1
 iface eth1 inet static
 address 192.168.1.1
 netmask 255.255.255.0
 gateway 192.168.0.2
 
 Two gateways?
 
 Kind regards,
 Andrei
 

It's been ages since I've done routing on a 2-NIC PC/router.  I've probably
gotten something a bit wrong.

eth0 is connected to the Huawei device.
eth1 is the LAN side of the server-now-router box.

-Dan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/5309e658.4020...@djph.net



Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-23 Thread Rod James Bio
On 2/23/14, 10:09, Markos wrote:
 On 22-02-2014 20:11, Scott Ferguson wrote:
 On 23/02/14 09:58, Stephen Powell wrote:
   
 On Sat, 22 Feb 2014 17:22:16 -0500 (EST), Markos wrote:
 
 I'm trying to configure a machine with two network cards to share
 Internet access to an internal network

 the /etc/network/interface is:

 # The loopback network interface
 auto lo
 iface lo inet loopback

 auto eth0
 iface eth0 inet static
   address 192.168.0.1
   netmask 255.255.255.0

 auto eth1
 iface eth1 inet dhcp

 The card eth0 is used as gateway on the internal network with static IP
 192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.

 But the modem do not send an IP during initialization.

 The IP of modem is 192.168.1.1.

 The modem sends the IP address (192.168.0.4) to my laptop by wifi
 without problems.

 Any suggestions of what I should check?

 I'm afraid that I don't understand the problem.  Is this a traditional
 async dial-up modem?  If so, I would expect it to be configured with
 ppp,
 its interface name would be ppp0, and it would not be listed in
 /etc/network/interfaces at all.  I don't get it.

  
 I'm guessing it's a cdc_ether device - probably running a web and dn
 server at 192.168.0.100.  Hopefully the OP will correct my assumption
 (Vendor and Product codes from dmesg?).
 I'm not familiar with that particular model - but I've had to hack Linux
 support for the chipset either side of it (model number).


 Kind regards



 Dear Scot and Stephen,
 
 I am using this model of modem:
 
 http://www.4glterouter.de/huawei-b890-4g-lte-smart-hub.html
 
 I just tested on another machine and the modem supplied the IP to my
 laptop via wireless and IP to a computer (with 1 NIC) via ethernet
 without problem.
 
 Tomorrow I'll change the network card (of the machine with 2 NICs) and
 test again to see if the problem is the network card.
 
 Thanks for your attention,
 Markos
 
 
Hi,

If you are having problems with DHCP then why not set eth1 to a static IP?

auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0

auto eth1
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.X
gateway 192.168.1.1

I usually don't set a gateway to the LAN interface in the settings.

*Rod Bio *

Random fortune: /Never try to explain computers to a layman. It's easier
to explain sex to a virgin. -- Robert Heinlein (Note, however, that
virgins tend to know a lot about computers.) /


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/5309f2c6.4050...@gmail.com



Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-23 Thread Andrei POPESCU
On Du, 23 feb 14, 21:08:22, Rod James Bio wrote:
 
 If you are having problems with DHCP then why not set eth1 to a static IP?

Because the root problem could also prevent the static configuration 
from working? The OP has already determined that the DHCP server in the 
router works with other devices, so the problem could be in the server.

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt


signature.asc
Description: Digital signature


Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-23 Thread Rob Owens
On Sun, Feb 23, 2014 at 07:15:20AM -0500, Dan Purgert wrote:
 It's been ages since I've done routing on a 2-NIC PC/router.  I've probably
 gotten something a bit wrong.
 
I *think* for the pc to act as a router you need to have:

net.ipv4.ip_forward=1

in /etc/sysctl.conf 

Then you configure your firewall to restrict what can be forwarded
through the router pc.

-Rob


signature.asc
Description: Digital signature


Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-23 Thread Rob Owens
On Sat, Feb 22, 2014 at 11:29:40PM -0300, Markos wrote:
 Tomorrow I'll change the network card of the server and see if the
 problem is on the network card.
 
Check to see if the network cable is cat 5, cat 5e, or cat 6.  If you
have a gigabit speed network card, it might reject a cat 5 cable.  Or it
might accept it (led's light on the card), but not work properly.

-Rob


signature.asc
Description: Digital signature


How to configure eth0 with static ip and eth1 dhcp

2014-02-22 Thread Markos

Hi all,


I'm trying to configure a machine with two network cards to share 
Internet access to an internal network


the /etc/network/interface is:

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0

auto eth1
iface eth1 inet dhcp

The card eth0 is used as gateway on the internal network with static IP 
192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.


But the modem do not send an IP during initialization.

The IP of modem is192.168.1.1.

The modem sends the IP address (192.168.0.4) to my laptop by wifi 
without problems.


Any suggestions of what I should check?

Thanks,
Markos



Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-22 Thread Scott Ferguson
On 23/02/14 09:22, Markos wrote:
 Hi all,
 
 
 I'm trying to configure a machine with two network cards to share
 Internet access to an internal network
 
 the /etc/network/interface is:
 
 # The loopback network interface
 auto lo
 iface lo inet loopback
 
 auto eth0
 iface eth0 inet static
 address 192.168.0.1
 netmask 255.255.255.0
gateway 192.168.1.1

 
snipped
allow-hotplug eth1
 iface eth1 inet dhcp
 


 The card eth0 is used as gateway on the internal network with static IP
 192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.
 
 But the modem do not send an IP during initialization.
 
 The IP of modem is192.168.1.1.
 
 The modem sends the IP address (192.168.0.4) to my laptop by wifi
 without problems.

I'm not sure what you mean there...

 
 Any suggestions of what I should check?

route(?)
You should probably see something like:-
Kernel IP routing table
Destination Gateway Genmask Flags Metric RefUse
Iface
default modem   0.0.0.0 UG0  00 eth1
localnet*   255.255.255.0   U 0  00 eth0
192.168.1.0 *   255.255.255.0   U 0  00 eth1

 
 Thanks,
 Markos
 


Kind regards


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/53092b62.5040...@gmail.com



Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-22 Thread Stephen Powell
On Sat, 22 Feb 2014 17:22:16 -0500 (EST), Markos wrote:
 
 I'm trying to configure a machine with two network cards to share 
 Internet access to an internal network
 
 the /etc/network/interface is:
 
 # The loopback network interface
 auto lo
 iface lo inet loopback
 
 auto eth0
 iface eth0 inet static
  address 192.168.0.1
  netmask 255.255.255.0
 
 auto eth1
 iface eth1 inet dhcp
 
 The card eth0 is used as gateway on the internal network with static IP 
 192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.
 
 But the modem do not send an IP during initialization.
 
 The IP of modem is 192.168.1.1.
 
 The modem sends the IP address (192.168.0.4) to my laptop by wifi 
 without problems.
 
 Any suggestions of what I should check?

I'm afraid that I don't understand the problem.  Is this a traditional
async dial-up modem?  If so, I would expect it to be configured with ppp,
its interface name would be ppp0, and it would not be listed in
/etc/network/interfaces at all.  I don't get it.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/1768175306.1084654.1393109938930.javamail.r...@md01.wow.synacor.com



Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-22 Thread Scott Ferguson
On 23/02/14 09:58, Stephen Powell wrote:
 On Sat, 22 Feb 2014 17:22:16 -0500 (EST), Markos wrote:

 I'm trying to configure a machine with two network cards to share 
 Internet access to an internal network

 the /etc/network/interface is:

 # The loopback network interface
 auto lo
 iface lo inet loopback

 auto eth0
 iface eth0 inet static
  address 192.168.0.1
  netmask 255.255.255.0

 auto eth1
 iface eth1 inet dhcp

 The card eth0 is used as gateway on the internal network with static IP 
 192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.

 But the modem do not send an IP during initialization.

 The IP of modem is 192.168.1.1.

 The modem sends the IP address (192.168.0.4) to my laptop by wifi 
 without problems.

 Any suggestions of what I should check?
 
 I'm afraid that I don't understand the problem.  Is this a traditional
 async dial-up modem?  If so, I would expect it to be configured with ppp,
 its interface name would be ppp0, and it would not be listed in
 /etc/network/interfaces at all.  I don't get it.
 

I'm guessing it's a cdc_ether device - probably running a web and dn
server at 192.168.0.100.  Hopefully the OP will correct my assumption
(Vendor and Product codes from dmesg?).
I'm not familiar with that particular model - but I've had to hack Linux
support for the chipset either side of it (model number).


Kind regards


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/53092eb2.4040...@gmail.com



Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-22 Thread Dan Purgert
On 22/02/2014 18:11, Scott Ferguson wrote:
 On 23/02/14 09:58, Stephen Powell wrote:
 On Sat, 22 Feb 2014 17:22:16 -0500 (EST), Markos wrote:

 I'm trying to configure a machine with two network cards to share 
 Internet access to an internal network

 the /etc/network/interface is:

 # The loopback network interface
 auto lo
 iface lo inet loopback

 auto eth0
 iface eth0 inet static
  address 192.168.0.1
  netmask 255.255.255.0

 auto eth1
 iface eth1 inet dhcp

 The card eth0 is used as gateway on the internal network with static IP 
 192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.

 But the modem do not send an IP during initialization.

You *could* have things connected backwards. Also, you're missing some
configuration details for eth0.

You need to be bridging eth0 and eth1, I think.  It's been ages since I've set
up a PC as a router, because off-the-shelf ones are usually good enough at the
routing part (DHCP, DNS, etc can be offloaded, but that's easy, and doesn't
require 2 NICs).


 [...]

 
 I'm guessing it's a cdc_ether device - probably running a web and dn
 server at 192.168.0.100.  Hopefully the OP will correct my assumption
 (Vendor and Product codes from dmesg?).
 I'm not familiar with that particular model - but I've had to hack Linux
 support for the chipset either side of it (model number).
 
 
 Kind regards
 
 




He's using a Huawei B-890-53 4G modem/hub[1], and is trying to hook up a *nix
box to act as a router for other devices.


Really rough diagram (from my understanding of the OP) is as follows:

[b-890] --- [eth0] {missing config?} [eth1] --- other device(s).

Not really sure why he needs to do this, as the Huawei box has in integrated
DHCP server/router ... but something like this should work:


1. Set eth0 to have a static IP (e.g. 192.168.0.1)[2]
2. Install DHCP onto the *nix box.
3. Set the IP of eth1 to some other subnet[2] (192.168.1.0/24 or a class A or B
   network -- 10.x.x.0/24 or 172.16.x.0/24).
4. Bind DHCP to eth1 (so it answers requests for internal devices)
5. Set up a route from eth1 to eth0, and vice versa.
6. Set up dnsmasq in iptables.
7. hook up internal switch, etc.


Now, the downside to this approach is that devices connected to the Wifi AP of
the Huawei device will not be able to communicate with the stuff behind the *nix
server.  An easier solution (IMO) would be something like the following:

1. Install DHCP server on the *nix box.
2. Set eth0 to a static IP address (e.g. 192.168.0.1).
3. Bind DHCP and DNS to eth0.
4. Connect eth0 on the Huawei device to eth0 of the *nix box.
5. Connect eth1 on the Huawei device to a switch (for the other computers).

A setup like this will then put all devices (wired and wireless) on the same
subnet so they can communicate without any issues.

Please note, this is really high level, and I'm probably forgetting some of the
finer details.

-Dan

[1]That's what they call it anyway.

[2] Something like this should work:

auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
[dns-nameservers 208.67.222.222 208.67.220.220] -- these are openDNS, use your
ISP, some other DNS provider, or your internal nameservers if you'd like.


auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.0.2

eth1 might be wrong, like I said, it's been ages.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/53095510.1000...@djph.net



Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-22 Thread Markos

On 22-02-2014 20:11, Scott Ferguson wrote:

On 23/02/14 09:58, Stephen Powell wrote:
   

On Sat, 22 Feb 2014 17:22:16 -0500 (EST), Markos wrote:
 

I'm trying to configure a machine with two network cards to share
Internet access to an internal network

the /etc/network/interface is:

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
  address 192.168.0.1
  netmask 255.255.255.0

auto eth1
iface eth1 inet dhcp

The card eth0 is used as gateway on the internal network with static IP
192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.

But the modem do not send an IP during initialization.

The IP of modem is 192.168.1.1.

The modem sends the IP address (192.168.0.4) to my laptop by wifi
without problems.

Any suggestions of what I should check?
   

I'm afraid that I don't understand the problem.  Is this a traditional
async dial-up modem?  If so, I would expect it to be configured with ppp,
its interface name would be ppp0, and it would not be listed in
/etc/network/interfaces at all.  I don't get it.

 

I'm guessing it's a cdc_ether device - probably running a web and dn
server at 192.168.0.100.  Hopefully the OP will correct my assumption
(Vendor and Product codes from dmesg?).
I'm not familiar with that particular model - but I've had to hack Linux
support for the chipset either side of it (model number).


Kind regards


   

Dear Scot and Stephen,

I am using this model of modem:

http://www.4glterouter.de/huawei-b890-4g-lte-smart-hub.html

I just tested on another machine and the modem supplied the IP to my 
laptop via wireless and IP to a computer (with 1 NIC) via ethernet 
without problem.


Tomorrow I'll change the network card (of the machine with 2 NICs) and 
test again to see if the problem is the network card.


Thanks for your attention,
Markos


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/53095846@c2o.pro.br



Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-22 Thread Markos

On 22-02-2014 22:55, Dan Purgert wrote:

On 22/02/2014 18:11, Scott Ferguson wrote:
   

On 23/02/14 09:58, Stephen Powell wrote:
 

On Sat, 22 Feb 2014 17:22:16 -0500 (EST), Markos wrote:
   

I'm trying to configure a machine with two network cards to share
Internet access to an internal network

the /etc/network/interface is:

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
  address 192.168.0.1
  netmask 255.255.255.0

auto eth1
iface eth1 inet dhcp

The card eth0 is used as gateway on the internal network with static IP
192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.

But the modem do not send an IP during initialization.
 

You *could* have things connected backwards. Also, you're missing some
configuration details for eth0.

You need to be bridging eth0 and eth1, I think.  It's been ages since I've set
up a PC as a router, because off-the-shelf ones are usually good enough at the
routing part (DHCP, DNS, etc can be offloaded, but that's easy, and doesn't
require 2 NICs).

   

[...]
 
   

I'm guessing it's a cdc_ether device - probably running a web and dn
server at 192.168.0.100.  Hopefully the OP will correct my assumption
(Vendor and Product codes from dmesg?).
I'm not familiar with that particular model - but I've had to hack Linux
support for the chipset either side of it (model number).


Kind regards


 




He's using a Huawei B-890-53 4G modem/hub[1], and is trying to hook up a *nix
box to act as a router for other devices.


Really rough diagram (from my understanding of the OP) is as follows:

[b-890]---  [eth0] {missing config?} [eth1]---  other device(s).

Not really sure why he needs to do this, as the Huawei box has in integrated
DHCP server/router ... but something like this should work:


1. Set eth0 to have a static IP (e.g. 192.168.0.1)[2]
2. Install DHCP onto the *nix box.
3. Set the IP of eth1 to some other subnet[2] (192.168.1.0/24 or a class A or B
network -- 10.x.x.0/24 or 172.16.x.0/24).
4. Bind DHCP to eth1 (so it answers requests for internal devices)
5. Set up a route from eth1 to eth0, and vice versa.
6. Set up dnsmasq in iptables.
7. hook up internal switch, etc.


Now, the downside to this approach is that devices connected to the Wifi AP of
the Huawei device will not be able to communicate with the stuff behind the *nix
server.  An easier solution (IMO) would be something like the following:

1. Install DHCP server on the *nix box.
2. Set eth0 to a static IP address (e.g. 192.168.0.1).
3. Bind DHCP and DNS to eth0.
4. Connect eth0 on the Huawei device to eth0 of the *nix box.
5. Connect eth1 on the Huawei device to a switch (for the other computers).

A setup like this will then put all devices (wired and wireless) on the same
subnet so they can communicate without any issues.

Please note, this is really high level, and I'm probably forgetting some of the
finer details.

-Dan

[1]That's what they call it anyway.

[2] Something like this should work:

auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
[dns-nameservers 208.67.222.222 208.67.220.220]-- these are openDNS, use your
ISP, some other DNS provider, or your internal nameservers if you'd like.


auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.0.2

eth1 might be wrong, like I said, it's been ages.


   

Dear Dan,

Thanks for your attention.

Let me explain in more detail the situation .

I organized a small network with 6 machines all with static IP and 
centralized log server ( 192.168.0.1 ) with NIS .


This network don't has Internet access, only on weekends I use my mobile 
phone on the server ( 192.168.0.1 ) and through a connection ppp0 share 
the Internet access for other machines on the network .


lan eth0 192.168.0.1 ppp0 Internet

I described all steps of that network on my page (but are in Portuguese ) :

http://www.c2o.pro.br/inf/pimentel/x38.html

And I used iptables to control the network.

But recently bought a modem router :

http://www.4glterouter.de/huawei-b890-4g-lte-smart-hub.html

and today I did my first test with this modem .

I just installed another NIC (RTL8139) in the server (eth1) and replace 
the ppp0 to eth1 in the firewall script below .



I just did a test at home and the modem provided the IP for 2 ethernet 
connections without problems.


Tomorrow I'll change the network card of the server and see if the 
problem is on the network card.


Thanks for your attention,.

Best Regards,
Markos

# ! / bin / bash

start () {

echo 1  / proc/sys/net/ipv4/ip_forward

iptables - A FORWARD -i ppp0 - o eth0 - m state - state ! ESTABLISHED, 
RELATED - j LOG - log -prefix  FIREWALL : . . Tent ext connection 


iptables - A FORWARD -i ppp0 - o eth0 - m state - state ! ESTABLISHED, 
RELATED - j DROP


iptables - A FORWARD -i eth0 - o ppp0 - j ACCEPT

iptables - t nat -A POSTROUTING - o 

Re: How to configure eth0 with static ip and eth1 dhcp

2014-02-22 Thread Scott Ferguson
On 23/02/14 13:09, Markos wrote:
 On 22-02-2014 20:11, Scott Ferguson wrote:
 On 23/02/14 09:58, Stephen Powell wrote:
   
 On Sat, 22 Feb 2014 17:22:16 -0500 (EST), Markos wrote:
 
 I'm trying to configure a machine with two network cards to share
 Internet access to an internal network

 the /etc/network/interface is:

 # The loopback network interface
 auto lo
 iface lo inet loopback

 auto eth0
 iface eth0 inet static
   address 192.168.0.1
   netmask 255.255.255.0

 auto eth1
 iface eth1 inet dhcp

 The card eth0 is used as gateway on the internal network with static IP
 192.168.0.1 and eth1 is connected to the B-890 -53 Huawei modem.

 But the modem do not send an IP during initialization.

 The IP of modem is 192.168.1.1.

 The modem sends the IP address (192.168.0.4) to my laptop by wifi
 without problems.

 Any suggestions of what I should check?

 I'm afraid that I don't understand the problem.  Is this a traditional
 async dial-up modem?  If so, I would expect it to be configured with
 ppp,
 its interface name would be ppp0, and it would not be listed in
 /etc/network/interfaces at all.  I don't get it.

  
 I'm guessing it's a cdc_ether device - probably running a web and dn
 server at 192.168.0.100.  Hopefully the OP will correct my assumption
 (Vendor and Product codes from dmesg?).
 I'm not familiar with that particular model - but I've had to hack Linux
 support for the chipset either side of it (model number).


 Kind regards



 Dear Scot and Stephen,
 
 I am using this model of modem:
 
 http://www.4glterouter.de/huawei-b890-4g-lte-smart-hub.html

Thanks - yes it's the chipset I was expecting.

 
 I just tested on another machine and the modem supplied the IP to my
 laptop via wireless and IP to a computer (with 1 NIC) via ethernet
 without problem.

Yes.

 
 Tomorrow I'll change the network card (of the machine with 2 NICs) and
 test again to see if the problem is the network card.


OK - I misunderstood - I didn't realise you had a second card installed
and assumed you'd just noticed the USB modem cable is seen as a NIC, or
that networkmanager had autoconfigured it for you (it should, if you
have a recent version of usb-modeswitch installed).
You don't need the 2nd network card unless you want to duplicate the
routing functionality build into your modem/hub/router. Just connect the
modem to that computer with the USB cable. Make sure you have
usb_modeswitch installed and add the extra line I suggest (the gateway
stanza).

The modem should then be seen as /dev/eth1 by Debian and will be used as
the gateway for your internet. You'll find that resolv.conf will
automagically use the modem as the nameserver .i.e. /etc/resolv.conf
will contain:-
nameserver 192.18.1.1

You don't need to add netmask and broadcast stanzas to
/etc/network/interfaces, you do need to change auto to hot-plug for the
modem (yes it's USB but the system will see it as an eth device).

Any other devices you connect to the modem should automagically (via
DHCP) do the same - and by default will all be able to communicate with
each other.

NOTE: the route output I quoted (in the previous post) is from a box
connected to a similar Huwaei modem in the same situation.

/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.6
netmask 255.255.255.0
gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if
installed

allow-hotplug eth1
iface eth1 inet dhcp
# you could make this static, but more typing would be involved


NOTE: network and broadcast stanzas are optional

 
 Thanks for your attention,
 Markos
 
 

Kind regards


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/53096387.7000...@gmail.com