Networking Forums

Networking Forums > Computer Networking > Linux Networking > maybe forbidden

Reply
Thread Tools Display Modes

maybe forbidden

 
 
xmen
Guest
Posts: n/a

 
      08-30-2009, 11:43 AM
Hi all,

eth0=net / eth1=LAN.

I wanna use public ip (like 222.222.33.*) on local
network interface. I try

bash# route add -net 222.222.33.0 netmask 255.255.255.0 dev eth1

but dns take the top.

Any ideas to force 222.222.33.0/24 ip dest to take only that interface
way and keeping internet?
 
Reply With Quote
 
 
 
 
Bit Twister
Guest
Posts: n/a

 
      08-30-2009, 12:08 PM
On 30 Aug 2009 11:43:04 GMT, xmen wrote:
> Hi all,
>
> eth0=net / eth1=LAN.
>
> I wanna use public ip (like 222.222.33.*) on local
> network interface. I try
>
> bash# route add -net 222.222.33.0 netmask 255.255.255.0 dev eth1
>
> but dns take the top.
>
> Any ideas to force 222.222.33.0/24 ip dest to take only that interface
> way and keeping internet?


adding network controls/routing from the command line can be lost on
next boot of the system.

I suggest using your system's configuration management tool to do
routing configuration. Guessing you have not setup the GATEWAY ip when
you configured the nics.

You might want to consider providing the Distribution and release of
whatever Linux you are trying to configure. That might get you more
detailed instructions from a subject matter expert.

While waiting for an answer you also may want to show us the output from

/sbin/route -n

Example:
$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 10 0 0 eth0
192.168.3.0 0.0.0.0 255.255.255.0 U 10 0 0 eth1
0.0.0.0 192.168.3.1 0.0.0.0 UG 10 0 0 eth1

In the above you can see the line with UG flag indicates which nic to
use as the default gateway for Internet access.
 
Reply With Quote
 
Allen Kistler
Guest
Posts: n/a

 
      08-30-2009, 03:07 PM
xmen wrote:
> eth0=net / eth1=LAN.
>
> I wanna use public ip (like 222.222.33.*) on local
> network interface. I try
>
> bash# route add -net 222.222.33.0 netmask 255.255.255.0 dev eth1
>
> but dns take the top.
>
> Any ideas to force 222.222.33.0/24 ip dest to take only that interface
> way and keeping internet?


If it's a directly connected network, you'll need to define an address
in that range to eth1.

If it's not a directly connected network, you'll need to add the local
gateway to the route command.

As the other poster noted, be sure to update whatever config your distro
uses to make the change permanent.
 
Reply With Quote
 
xmen
Guest
Posts: n/a

 
      08-30-2009, 04:35 PM
Le Sun, 30 Aug 2009 10:07:59 -0500, Allen Kistler a écritÂ*:

> xmen wrote:
>> eth0=net / eth1=LAN.
>>
>> I wanna use public ip (like 222.222.33.*) on local network interface. I
>> try
>>
>> bash# route add -net 222.222.33.0 netmask 255.255.255.0 dev eth1
>>
>> but dns take the top.
>>
>> Any ideas to force 222.222.33.0/24 ip dest to take only that interface
>> way and keeping internet?

>
> If it's a directly connected network, you'll need to define an address
> in that range to eth1.
>
> If it's not a directly connected network, you'll need to add the local
> gateway to the route command.
>
> As the other poster noted, be sure to update whatever config your distro
> uses to make the change permanent.


Here my conf:



Internet
I
I
________I_________
Public IP I
Provider box I
WAN: 192.168.1.1 I
_________________I
I
________I___________
WAN: 192.168.1.2 I -> ra0
PC I -----------> Next see my/etc/network/interface
LAN: 222.222.222.1 I -> eth0
___________________I
I
________I___________
IP: 222.222.222.33 I
Special MachiNE I --> I cant change its IP
___________________I




/etc/network/interface:

iface raO inet static WAN
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1

iface eth0 ine static
address 222.222.222.1
netmask 255.255.255.0
gateway 192.168.1.2

Resolv.conf 208.67.222.222 & 208.67.220.220

I cant show you route -n, I'm home
but when I:

bash# route add -net 222.222.33.0 netmask 255.255.255.0 dev eth1

I ve 2 line like:
Destination Gateway Genmask Flags Metric Ref Use
Iface
222.222.222.0 0.0.0.0 255.255.255.0 U 10 0 0
eth0
222.222.222.0 0.0.0.0 255.255.255.0 U 10 0 0
eth0
 
Reply With Quote
 
Bit Twister
Guest
Posts: n/a

 
      08-30-2009, 07:51 PM
On 30 Aug 2009 16:35:26 GMT, xmen wrote:
>
> /etc/network/interface:
>
> iface raO inet static WAN
> address 192.168.1.100
> netmask 255.255.255.0
> gateway 192.168.1.1
>
> iface eth0 ine static
> address 222.222.222.1
> netmask 255.255.255.0
> gateway 192.168.1.2



There is part of the problem. All the nics in A system need one
gateway value, not two as shown by you.
That gateway value is the ip of the next system for routing addresses
not on it's network. Change eth0's gateway to 192.168.1.1 and do a

sudo -i
/etc/init.d/networking restart
route -n
ping -c1 yahoo.com

If all is well, exit. If routing is still bad, I would try removing
the gateway line from eth0 and try the above three commands again.
Sorry I have no experience with k/ubuntu/debin configurations.
 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      09-01-2009, 11:21 AM
Hello,

David Schwartz a écrit :
>
> You can't add arbitrary routes to an ethernet interface


Or course you can.

> because
> ethernet requires ARP to work in order to know what device to send a
> packet to.


So what ? It is fine as long as something on the link replies to the ARP
query - or you add a static ARP entry.

> This route asks the host to send a packet bound for, say,
> 222.222.33.1 out an interface even though it has no way to determine
> *how* to send that packet out that interface -- what ethernet hardware
> address should it send it to?


This is what ARP is for.

> If you want to
> reach a network directly connected to an ethernet interface, you need
> to assign the interface an IP address inside that network.


Not necessarily.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




1 2 3 4 5 6 7 8 9 10 11