Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 23rd May 2012, 11:44
liran liran is offline
Junior Member
 
Join Date: May 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ubuntu change default gateway - please help

Hello,

I need to change the default gateway on an Ubuntu PC to 10.1.3.2, which is a different PC (with Firewall / NAT / Gateway configured in it).

I have tried several ways, and did not succeed.
ifconfig output:
Code:
ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:04:23:c7:a6:3e  
          inet addr:10.1.2.2  Bcast:10.1.2.255  Mask:255.255.255.0
          inet6 addr: fe80::204:23ff:fec7:a63e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:1026 (1.0 KB)  TX bytes:3282 (3.2 KB)

eth4      Link encap:Ethernet  HWaddr 00:14:22:23:8a:50  
          inet addr:192.168.1.153  Bcast:192.168.3.255  Mask:255.255.252.0
          inet6 addr: fe80::214:22ff:fe23:8a50/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1513 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1164 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:173508 (173.5 KB)  TX bytes:151594 (151.5 KB)

eth5      Link encap:Ethernet  HWaddr 00:14:22:23:8a:51  
          inet addr:10.1.2.2  Bcast:10.1.2.255  Mask:255.255.255.0
          inet6 addr: fe80::214:22ff:fe23:8a51/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:0 (0.0 B)  TX bytes:3784 (3.7 KB)

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:164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:17725 (17.7 KB)  TX bytes:17725 (17.7 KB)

/etc/network interfaces file:
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
iface lo inet loopback

#
# XXX abuse of mapping function follows.
# The findcnet script DHCPs on all interfaces the first time it is invoked
# and uses the results of that for every other invocation.  The script
# returns "cnet" for the interface that is the control net, and the physical
# interface name for all others.
#
mapping eth*
    script /usr/local/etc/emulab/findcnet

#
# The control network has been identified and configured indirectly
# via the mapping above.  Here we just make sure that if shutdown, we
# remove the indicator file so that we will re-DHCP next time.
#
auto eth0 eth1 eth2 eth3 eth4 eth5 eth6 eth7 eth8 eth9
#iface cnet inet manual
#    up echo "Emulab control net is $IFACE"
#    down rm -f /var/run/cnet
#    down ifconfig $IFACE down
iface eth4 inet static
address 192.168.1.153
netmask 255.255.255.0
gateway 10.1.3.2
Can you please write me a fixed interfaces file which will work ?

Thanks !
Reply With Quote
Sponsored Links
  #2  
Old 24th May 2012, 13:20
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,744 Times in 2,577 Posts
Default

Try
Code:
iface eth4 inet static
  address 192.168.1.153
  netmask 255.255.255.0
  gateway 10.1.3.2
(The lines following iface must be indented.)
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 24th May 2012, 13:51
liran liran is offline
Junior Member
 
Join Date: May 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think it is ok now, with command line commands.

Thanks !

Last edited by liran; 24th May 2012 at 14:55. Reason: mistake
Reply With Quote
Reply

Bookmarks

Tags
default gateway, gateway

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix: can send emails outside, none received daseagle Server Operation 9 11th October 2011 12:03
RoundCube Sends but will not receive. happz Installation/Configuration 33 17th April 2010 21:55
Connection timed out on intermail outgoing mails gouravgarg Server Operation 6 5th March 2010 20:31
Unbale to login to Postfix from webmail wasimriz HOWTO-Related Questions 5 6th April 2009 13:49
High Availability Samba cluster - DRBD + Heartbeat djalex Server Operation 58 25th May 2007 19:38


All times are GMT +2. The time now is 15:39.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.