LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-27-2015, 04:34 PM   #1
cnschulz
LQ Newbie
 
Registered: Dec 2007
Posts: 4

Rep: Reputation: 0
second adapter gateway not visible on different subnet


Gday,

I have a Vodafone (Huawei) K4203 dongle. It is NOT a modem ie: it creates a network adapter on the machine. I am attempting to run it on a headless ubuntu 12.04 server in addition to the current ethernet network in that machine. I wish for this machine to become my "gateway" to the internet. Im very close but cant get the rest of the network to see the gateway. Im not sure what I need to do from here.

The card is installed correctly and the on-board web-server indicates connectivity. The host machine has internet access.

The server has two network interfaces:
eth3 is a traditional wired nic on 192.168.1.3. Gateway is 192.168.9.1
eth4 is the usb adapter which by default uses its own DHCP. It has a local address of 192.168.9.100 but has its own status page reachable at 192.168.9.1.

I have a wireless router with 4 wired ports at 192.168.1.2. This *used* to be my gateway to a traditonal DSL modem but this is no longer the case. I wish to route through the USB adapter now.

All machines on the 192.168.1.x network can see the 192.168.9.100 address but CANNOT see the 192.168.9.1 gateway (!!) only the host machine 192.168.1.3 can see this.

So, what do I need to do to have all machines on the 192.168.1.x network able to see the internet?

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.9.1     0.0.0.0         UG        0 0          0 eth4
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth3
192.168.9.0     0.0.0.0         255.255.255.0   U         0 0          0 eth4

Code:
# 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 eth3 eth4
iface lo inet loopback

# The primary network interface
iface eth3 inet static
        address 192.168.1.3
        netmask 255.255.255.0
        broadcast 192.168.1.255
        network 192.168.1.0

# The usb network interface
iface eth4 inet dhcp
What else can I tell you?
Thanks for any help.
 
Old 09-27-2015, 10:01 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,790

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
So, I understand you are configure like this, with your PC acting as a router

LAN-----eth3 (192.168.1.3/24)<PC>eth4 (192.168.9.100)-----gw (192.168.9.1)

The LAN clients should be able to reach the internet directly with the routing table you have shown, and from the LAN perspective the local gateway is 192.168.1.3, with your PC taking care of the routing to the VF dongle.
 
Old 09-28-2015, 03:18 AM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,790

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Another thought that I had was to make sure that IP forwarding is enabled too.

Check with
Code:
cat /proc/sys/net/ipv4/ip_forward
If necessary
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
It can be made permanent by adding the following to /etc/sysctl.conf
Code:
net.ipv4.ip_forward=1
 
Old 09-28-2015, 04:33 AM   #4
cnschulz
LQ Newbie
 
Registered: Dec 2007
Posts: 4

Original Poster
Rep: Reputation: 0
SOLVED!!!

Thankyou so much. It was a combination of two things:

1. allowing ip_forward as you suggested and...
2. enabling NAT on eth4 (internet side) on the firewall (the firewall wasnt enabled at all) as suggested in this post : http://www.linuxquestions.org/questi...in-4175427064/

 
Old 09-28-2015, 04:37 AM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,790

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Glad to have been of help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gateway in other subnet tincboy Linux - Networking 1 01-01-2011 01:22 PM
two gateway for one subnet bondoq Linux - Networking 12 05-14-2007 09:05 AM
Two NIC's on same subnet/gateway TBKDan Linux - Networking 4 04-06-2007 10:20 PM
How to connect to a gateway on a different subnet? anGeR Linux - Networking 1 04-09-2004 08:50 AM
Gateway on different subnet mikewelter Linux - Networking 2 12-17-2003 12:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration