Set default gateway on headless server (via ssh)

I'm trying to configure one of the two ethernet interfaces on a headless Xserve. I managed to give it an address and subnet mask with ifconfig, but I can't figure out how to give it a default gateway or dns server.
I tried using this:
sudo route add default gw xxx.xxx.xxx.xxx en0
but I got the error 'route: bad address: gw'
is there something wrong with my syntax, or does this just not work on OS X?

Something's wrong with your syntax
Try:
<pre class=command>sudo route add default a.b.c.d</pre>
The keyword 'gw' is not needed, and you also don't need to specify an interface since the OS should be able to work it out from the IP address(es) assigned to your interface(s).

Similar Messages

  • Setting Default Views of Mounted Server Shares

    In OS X 10.5 server, how do I change the owner of a volume? So I can do the stuff below? Do I change the owner in the Finder...? Or do you use the OS X Server admin utility type programs?
    Thanks
    Re: Setting Default Views of Mounted Server Shares
    Posted: Dec 18, 2007 9:49 AM in response to: William Read
    Solved
    Have you tried this?
    http://docs.info.apple.com/article.html?artnum=107482
    You can set custom view options (window size, icon placement, and so forth) that clients see when they connect to a server volume via Apple File Service (AFP).
    You can customize the size, position, and other view options of the window that clients see when they connect to a server volume via Apple File Service (AFP). You can do this on a per-volume basis.
    To customize view options, follow these steps:
    1. Log in to a client computer.
    2. Using Connect to Server, connect to the target volume as the owner of the volume; the owner must not be an administrator account (see Notes 1, 2, and 3, below).
    3. Make any desired changes to the window position, view mode (Icons, List, Columns), icon arrangement, or any of the settings found in View Options window (Command-J).
    4. Disconnect from the server volume by dragging it to the Trash.

    In OS X 10.5 server, how do I change the owner of a volume? So I can do the stuff below? Do I change the owner in the Finder...? Or do you use the OS X Server admin utility type programs?
    Thanks
    Re: Setting Default Views of Mounted Server Shares
    Posted: Dec 18, 2007 9:49 AM in response to: William Read
    Solved
    Have you tried this?
    http://docs.info.apple.com/article.html?artnum=107482
    You can set custom view options (window size, icon placement, and so forth) that clients see when they connect to a server volume via Apple File Service (AFP).
    You can customize the size, position, and other view options of the window that clients see when they connect to a server volume via Apple File Service (AFP). You can do this on a per-volume basis.
    To customize view options, follow these steps:
    1. Log in to a client computer.
    2. Using Connect to Server, connect to the target volume as the owner of the volume; the owner must not be an administrator account (see Notes 1, 2, and 3, below).
    3. Make any desired changes to the window position, view mode (Icons, List, Columns), icon arrangement, or any of the settings found in View Options window (Command-J).
    4. Disconnect from the server volume by dragging it to the Trash.

  • How to set default gateway

    I have created two Virtual machine of windows server 2008 R2 (VM1 & VM2 respectively). I am configuring domain controller on VM1 and VM2 will be my member server.
    My Host system is windows 7 and my ISP does NOT provide me with a static IP.
    When I configure domain controller on VM1 it asks me to configure static IP address first. I have given 10.0.0.2 as a static IP on VM1 and the default value of subnet mask is populated. 
    For preferred DNS and Alternate DNS server I have given the same static IP address (i.e 10.0.0.2).
    Note - As am planning to use the local computer (i.e VM1) as my preferred DNS and alternate DNS.
    Q1) What should I set as the 'default gateway' on VM1 ? 
    Q2) Once I've set up the domain controller, can I configure DHCP server on VM1 and assign IP to VM2 ? 
    Q3) VM2 being a (domain)member server, can we assign static IP to it ? If yes What would be the values in gateway, Preferred DNS and Alternate DNS field ?

    Thanks for answers. Doing this configuration for first time this is little confusing for me.
    @Milos
    Step No. 15 says
    "If you do not have static IPv4 and IPv6 addresses assigned to your network adapters, a warning message might appear advising you to set static addresses for both of these protocols before you can continue."
    The warning message did appear. 
    Before I start to configure Active Directory Domain Services, I
    will have to provide a static IP to the system. Correct? 
    I have two virtual machines (windows server 2008 R2) running on my VMware workstation. I do not require two domain controllers, my requirement is the first virtual machine (i.e VM1) should be the domain controller and the second virtual machine (i.e VM2) should
    me a domain member server (NOT a domain controller or a child domain)
    As you have explained, that Before you run DCPROMO,
    there is following configuration:
    IP address            10.0.0.2
    MASK                 255.0.0.0
    Deafault gateway  10.0.0.1  if
    this is IP address of ryour outer.
    Preferred DNS     10.0.0.2
    I would like to understand, is this what you mean by having a static IP ?
    I am pasting three screenshot below, 
    1st) ipconfig of my host system. 

  • Setting Default Gateway on O

    I have a LAG with two VLANs in it.
    Setup
    VLAN 1 (Untaged default) is connected to the '192.168.11.x', which connects to the "10.1.10.x", which connects to the internet.
    VLAN 3 (Tagged) is connected directly to "10.1.10.x" which connects to the internet.
    Situation;
    When both VLAN3 and VLAN1 are up, default gateway is 192.168.11.1
    When VLAN1 is down, default gateway is 10.1.10.1
    *Desired configuration;*
    How do I make the VLAN3 interface the default, or the directly attached network of 10.1.10.x the default, when it is enabled?
    I have tried this, but must be missing something;
    +kevin-cossaboons-mac-pro:~ kevincossaboon$ sudo route -nv add -net 0.0.0.0 10.1.10.1+
    Password:
    +u: inet 0.0.0.0; u: inet 10.1.10.1; RTM_ADD: Add Route: len 128, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,STATIC>+
    +locks: inits:+
    +sockaddrs: <DST,GATEWAY,NETMASK>+
    +default 10.1.10.1 default+
    +route: writing to routing socket: File exists+
    +add net 0.0.0.0: gateway 10.1.10.1: File exists+
    +kevin-cossaboons-mac-pro:~ kevincossaboon$ netstat -r+
    +Routing tables+
    Internet:
    +Destination Gateway Flags Refs Use Netif Expire+
    +default 192.168.11.1 UGSc 30 171 bond0+
    +10.1.10/24 link#13 UCS 3 0 vlan0+
    +10.1.10.1 0.13.f7.af.e7.e6 UHLW 0 93 vlan0 995+
    +10.1.10.13 0.18.39.3b.42.95 UHLW 0 26 vlan0 178+

    In your network preferences click the cog wheel and choose set service order. Then drag vlan3 to the top of the list.

  • Setting default gateway in subnetted network

    I have a /24 that i have been using as 2 x/25. Recently i was asked to subnet the network into 1x /27, 3x /28 and 1x /30. Previously I just had one default gateway. Now how will I set the default gateway for all these subnets?

     Hi ,
         Yes if you want to route the traffic between subnets ,then you need gateway to defined on your network elements (router /L3 switches) . 
             After breaking into number of subnets , ensure you have created appropriate vlan on layer 2 switch if applicable , Switch port access accrodingly . 
    Use Subnet calculator 
    https://www.cisco.com/cgi-bin/Support/IpSubnet/home.pl
    HTH
    sandy

  • How to logout remote server via SSH

    I have a server running flux, I just want to log it out (it auto-logs back in, no GDM screen). How do I do this if I'm connected to it via SSH? Again, I want to log out the server as though I would do ctrl+alt+backspace locally, but through SSH.
    TIA

    I just realised how you start your session by auto login, so my above answer was pretty useless. The way I manage my server with an occasional gui session is to just use gdm and start/stop the daemon as needed via ssh then switch to a vnc  or xdmcp session.

  • Setting default printer with printers deployed via print management

    Would like to set default printer on a windows 7 workstation to a printer deployed through group policy using print management.  However whenever machine reboots the defualt changes to a local printer XPS or something else.
    HOw can I set the default printer to one of the deployed printers?

    Even though this is a "machine" connection, the connection is created in each users security context.  Default printers are tied to user profiles and settings.
    I'm sure what is happening is the connection is getting created after the system sets a default or the network path is not yet available when the default printer is set.
    You can use prnmngr.vbs to get and set the default.  If get returns XPS printer, then set can change to one of the valid connections.
    Alan Morris Windows Printing Team

  • Setting default calendar to iCal Server

    Can anyone help me figure out how to set up our network accounts (actually PHDs) to automatically use the users' calendars on the server instead of the default 'Home' and 'Work' local calendars? I would like to make it easy for our employees to use their server-based calendar by default, so that scheduling will work properly, etc.
    I am using an Advanced setup; I seem to remember reading elsewhere that this is easier in other installations, but hopefully it is also possible somehow in Advanced.
    Thanks for any advice on this,
    Greg

    I haven't found a network setting for that yet. However, you can make event invitations default to the network calendars by closing the heading on the local calendars (on the users iCal). Of course, deleting the local calendars works, too.

  • SSH into headless server

    Hi,
    I'm trying to rescue my headless power pc box at home.
    On my desktop machine I'm running ArchLinux and on my headless server the Debian GNU/Linux Wheezy operating system.
    The headless server can be booted with an USB stick rescue system.
    I have setup my desktop machine to be a DHCPD server. I did followings:
    # nano /etc/dhcpd.conf
    # Using the google's dns in the example.
    # Change it to 192.168.1.1 if you have a dns server installed
    option domain-name-servers 8.8.8.8;
    option subnet-mask 255.255.255.0;
    option routers 192.168.1.1;
    subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.20 192.168.1.020;
    I created the following file too:
    # nano /etc/conf.d/dhcp
    DHCP_ARGS="-q -s 192.168.1.1"
    Then I run the following commands:
    # netctl stop ethernet-dhcp
    # ip link set up dev enp0s20
    # ip addr add 192.168.1.1/24 dev enp0s20
    # systemctl start dhcpd4.service
    and finally I want to connect to my headless server with SSH:
    # ssh [email protected]
    but get the message:
    ssh: connect to host 192.168.1.20 port 22: No route to host
    What did I wrong?
    Regards, from Paul
    Last edited by csanyipal (2014-05-19 13:54:33)

    csanyipal wrote:What I don't know yet is that that how to setup my home network.
    The headless power pc box should be my gateway/router that get it's static IP address from my ISP, and my desktop pc box is on LAN of that headless power pc box ( gateway/router ). Actually, I don't know how to setup the /etc/network/interfaces file on headless powerpc box to achieve this goal.
    It can't get it's static IP from the ISP, you manually enter that yourself or you have DHCP from the ISP (which is normally the case).  If you use whatever DHCP addresses come from the ISP (hopefully this is private addresses), then you don't really need Arch or anything else serving DHCP.  You might be getting into DHCP competition.  You only need one DHCP server.  If you're doing something complex like PXE booting, then you'll need a router/arch box capable of configuring various DHCP options.  One if by static IP, two if by DHCP, you shouldn't have to deal with your /etc/network/interfaces.  Then you can just figure out what IP has been assigned to your headless box.

  • How to access web server with SSH client

    I need to access my web server via SSH. I do not have clue how to go about. I have transmit for ftp but looks like I cannot use SSH with Tranmit.
    I guess I need to know:
    - What ssh client to I need to get?
    - If not detailed instruction provided How do I go about? I know I need the port # and my ip address and I have both of those but not sure what else I am to do.
    TIA for the help!

    Open up Terminal. It's in the Utilities folder.ssh -p <port#> <ipaddress> or, if you need to log on with a different user namessh -p <port#> <username>@<ipaddress>

  • How to Install AIR on Linux via SSH

    How can I install AIR on a linux server via SSH?
    llama

    Hi llama,
    As installing AIR requires a running xserver on linux. So you can install using ssh by providing -Y parameter.
    so connect to your server in the way, e.g: ssh -Y user@server and then perform the installation.
    Regards
    Syed

  • Accessing Disabled Accounts via ssh

    We have user accounts on our OS X Tiger Server where the user has installed a public key into their ~/.ssh/authorized_keys file.
    The problem:
    If I uncheck "access account" in Workgroup Manager for one of those users, they can still login to the server via ssh, authenticating with their private key.
    So, how can I truly disable access to an account that has a key pair installed for ssh?
      Mac OS X (10.4.5)  

    Have you tried using WGM to change their login shell to "none"?

  • The letter "G" shows up in the start when I log in to my HTPC via SSH

    When I log in to my HTPC via SSH the letter "G" shows up in the beginning:
    [ Neytiri ~ ]> ssh hund@<IP> -p <port>
    Last login: Fri May 14 08:54:06 2010 from [...]
    G[hund@Fjuppen ~]$
    I dont have this problem when I log in to my server via SSH. I'm using zsh on my workstation and bash on my HTPC and server. If I use bash on my workstation and log in to my HTPC the problem doesnt occur.
    It doesnt causes any problems, but it's disturbing that it's there and that I cant solve it myself.

    I am not sure what the problem is, but I might know where you can start searching for it.
    I have had a similar problem but it was when I tried to convert the official init scripts to C. I got a G at the beginning and It didn't seem like the utf8 support worked for the console (å,ä, and ö didn't work). The problem that I had was that I couldn't get /etc/profile.d/locale.sh to execute correctly from within the C program, it might be that zsh doesn't execute the locale.sh script correctly. I don't have a solution for the problem since I am still trying to solve it myself.
    Anyway. the script is partly generated from line 372 in rc.sysint (pkg: initscripts 2010.05-3):
    echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\033%%G"; fi' >>/etc/profile.d/locale.sh
    The generated /etc/profile.d/locale.sh looks something like this (it may of course look different but that depends on the utf8 and locale settings in your rc.conf):
    export LANG=sv_SE.utf8
    if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then printf "\033%%G"; fi

  • How to setup default gateway in a DHCP client. The default gateway will be the Ip address of the server that has RRAS installed, hence routing cabalities.

    How to setup default gateway in a DHCP client. The default gateway will be the Ip address of the server that has RRAS installed, hence routing cabalities.

    Hi Bill,
    Thank you for replying back...Yes, I was actually asking how do you set the default gateway address on the DHCP server?,
    I believe I got the answer below:
    To configure the DHCP default gateway option Click Start, point to Administrative Tools and then click DHCP. In the console tree, expand the applicable DHCP server, expand IPv4, and then right-click Scope Options Click Configure Options, check 003
    Router, type the applicable Server name and IP address, and then click OK.
    Thank you

  • Cascading RV180 as DHCP server but pointing to another default gateway router

    Hi,
    My network topology is as follows:
    Internet <-> Residential Gateway (RG) from ISP (OEM: Pace) [192.168.1.254/255.255.255.0] <-> RV180 [192.168.1.253/255.255.255.0] <-> SG500 switch [192.168.1.250/255.255.255.0] <-> rest of network.
    I know this is a cascading LAN-to-LAN arrangement. The cable from the RG to the RV180 is from a LAN port on the RG to a LAN (not WAN) port on the RV180.
    I eventually want to segment my network into a few VLANs from the RV180 down. I am aware most people would recommend DHCP on the "primary" router, but the RG is non-VLAN aware, so I figure I need to handle the DHCP off the RV180. At the same time, I have also opted not to do a LAN-to-WAN cascade because I want to retain the ability to configure the RG from the rest of the network and not have to cart a computer over to the RG to do it.
    On the RG, I've disabled DHCP, and placed 192.168.1.253 in the DMZ.
    On the RV180, I've enabled DHCP and put it in Router mode.
    The issue is that I do not have any Internet connectivity. If I allow the computers in the network to receive IP addresses over DHCP, the default gateway that is communicated is 192.168.1.253, which is the RV180. If I configure static IPv4 information on my computers to point to 192.168.1.254, I am able to connect outside, as you would expect.
    How can I get the RV180 to pass out DHCP IP addresses, but point to 192.168.1.254 as the default gateway? I thought the solution might be to create a default route (or something). I went to the static routes tab but it wouldn't let me enter 0.0.0.0 as a destination IP to route through 192.168.1.254.
    Further down the line, is it possible for both the RG and the RV180 to connect directly to the SG500, along with the other nodes in my network? That way the RV180 only serves to maintain the VLANs and pass out IP addresses via DHCP, instead of having it be the choke through which everything goes through on the way out?
    Sorry if there is a really obvious solution to this. It's really been floundering about in the dark so would appreciate any advice

    Hi Jason, I have considered your post here for quite some time. I came to one conclusion based off your text. The entire purpose of the RV180 is a DHCP server for multiple subnet / vlan.
    Here's the thing, you have a SG500 switch. Based off reading your text, this will do everything the RV180 can except the DHCP service. The limitation you are going to run in to is still going to be your gateway unit, the RG.
    In the end, even with such a configuration using the RV!80 or the SG500 (layer 3), the RG will have to be configured with static routes since the RG has no concept of those other LAN segments.
    Here is a post I wrote about a SG300 connecting to a RV0XX router (which doesn't understand the VLANs)
    https://supportforums.cisco.com/message/3739083#3739083
    Using the concept of this topic, you may be able to add aditional static routes on the RV180 sending each subnet to the common IP interface of the RG.
    It would be very interesting to see if we could make that work.
    -Tom
    Please rate helpful posts

Maybe you are looking for

  • As a solo CC member, can I install different Creative Cloud applications on different computers?

    I have a PC laptop and work desktop PC that I use for Audition to edit podcasts. I have a Mac at home that I want to use for photoshop (and also install it on my work PC, maybe). So that's 3 computers, but each Adobe application will only be on one (

  • Can I create a parent category for a series of categories?

    I have created a list of construction works in categories with subtotals for each article. Can I create a parent category for a selection of categories? For example: categories: - masonry - windows - plumbing each with subtotals. Now I want to create

  • Problem in Hierarchy in BEX Query

    Hi ALL, I have created Query for balance statements & Profit ,Loss statement by using hierarchy. It  is execuiting in perfectly.But the problem is "I want in the query output hierarchy with only 1 node that is Profit/loss node." I have done restricti

  • Colors look radically different

    Sorry if this is such a newbie question-without fail, whenever I find a theme I like, it looks completely different on my system. I can either re-create the color using cmyk or rgb values in Illustrator OR import the theme, and the colors always look

  • JMF: getting player for current service question

    On interactivetvweb.org I found something like this: // Get a reference to the JavaTV ServiceContextFactory ServiceContextFactory factory; factory = ServiceContextFactory.getInstance(); // From this, we can get a reference to the parent // service co